Dao/DishMenuCategoryRepository.cs
(开头部分) 10KB这里只显示每个文件的开头 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 PWMIS.DataProvider.Adapter;
namespace Dao
{
/// <summary>
/// DishMenuCategory 仓储
/// </summary>
public class DishMenuCategoryRepository : Repository<DishMenuCategoryMdl>, IDishMenuCategoryRepository
{
public IList<DishMenuCategoryMdlExt> GetDynamicPagination(CommonQueryOption option, string shopid, out int totalcount)
{
AdoHelper helper = MyDB.GetDBHelper(); //可直接写SQL语句
IList<DishMenuCategoryMdlExt> lisOmdl = null;
totalcount = 0;
int pageCount = option.pageNumber * option.limit;
int psgeseiz = 0;
string sqlstr = string.Empty;
string orderWhen = string.Empty; //主表
string OutWhen = string.Empty; //外表
if (!string.IsNullOrEmpty(option._ID))
orderWhen += string.Format(@" and F.ID = '{0}' ", option._ID);
if (!string.IsNullOrEmpty(option._Status))
orderWhen += string.Format(@" and F.Status = '{0}' ", option._Status);
if (!string.IsNullOrEmpty(option._Name))
orderWhen += string.Format(@" and F.DishCategoryName = '{0}' ", option._Name);
if (!string.IsNullOrEmpty(option._DateStart))
orderWhen += string.Format(@" and F.CreateDate >= '{0}' ", option._DateStart);
if (!string.IsNullOrEmpty(option._DateEnd))
orderWhen += string.Format(@" and F.CreateDate <= '{0}' ", option._DateEnd);
if (!string.IsNullOrEmpty(option._ShopID))
orderWhen += string.Format(@" and F.Shop_ID = '{0}' ", option._ShopID);
sqlstr = string.Format(@" select count(1) page from DishMenuCategory F where isnull(F.IsValid,1) = 1 " + orderWhen);
DataSet ds = helper.ExecuteDataSet(sqlstr);
if (ds != null && ds.Tables[0].Rows.Count > 0)
totalcount = Convert.ToInt32(ds.Tables[0].Rows[0]["page"]);
else
{
totalcount = 0;
return lisOmdl;
}
if (pageCount > totalcount)
psgeseiz = option.limit - (pageCount - totalcount);
else
后面还有 165 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
