Dao/CustomerRepository.cs
(开头部分) 11KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using Domain;
using IDao;
using Entity.Common;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Common;
using PWMIS.DataMap.Entity;
using PWMIS.DataProvider.Data;
using System.Data;
using Dao.Page;
using PWMIS.DataProvider.Adapter;
namespace Dao
{
/// <summary>
/// Customer 仓储
/// </summary>
public class CustomerRepository : Repository<CustomerMdl>, ICustomerRepository
{
public IList<CustomerExtMdl> GetDynamicPagination(CommonQueryOption option, string shopid, out int totalcount)
{
AdoHelper helper = MyDB.GetDBHelper(); //可直接写SQL语句
IList<CustomerExtMdl> lisOmdl = null;
int pageCount = (option.pageNumber - 1) * option.limit;
int psgeseiz = 0;
totalcount = 0;
string sqlstr = string.Empty;
string orderWhen = "";
//主表 = ''
if (!string.IsNullOrEmpty(option._RuleTableID) && option._RuleTableID != "0")
{
if (option._RuleTableID != "00000000-0000-0000-0000-000000000000")
orderWhen += " and A.DiscountRule_ID ='" + option._RuleTableID + "'";
else
orderWhen += " and A.DiscountRule_ID ='00000000-0000-0000-0000-000000000000'";
}
if (!string.IsNullOrEmpty(option._ID))
orderWhen += " and F.ID ='" + option._ID + "'";
if (!string.IsNullOrEmpty(option._Name))
orderWhen += " and F.NickName like '%" + option._Name.Trim() + "%'";
if (!string.IsNullOrEmpty(option.Tel))//联系电话
{
orderWhen += " and F.Tel like '%" + option.Tel.Trim() + "%'";
}
if (!string.IsNullOrEmpty(option._DateStart))//会员加入日期
{
orderWhen += string.Format(@" and F.CreateData >= '{0}' ", option._DateStart);
}
if (!string.IsNullOrEmpty(option._DateEnd))
{
orderWhen += string.Format(@" and F.CreateData <= '{0}' ", option._DateEnd);
}
sqlstr = "select count(F.ID) num from Customer F left join GlobleCustomerDiscount A on A.Customer_ID = F.ID where 1 = 1" + orderWhen;
DataSet ds = helper.ExecuteDataSet(sqlstr);
if (ds != null && ds.Tables[0].Rows.Count > 0)
后面还有 205 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
