/// <summary> /// 查询分页 /// </summary> /// <param name="entity"></param> /// <param name="pageInfo"></param> /// <returns></returns> public List<TNumEntity> GetList(TNumEntity entity, ref PageInfo pageInfo) { entity.IncludeAll(); entity.OrderBy(a => a.ID, EOrderBy.DESC); int rowCount = 0; List<TNumEntity> listResult = this.TNum.GetList(entity,pageInfo.PageSize,pageInfo.PageIndex,out rowCount); pageInfo.RowCount = rowCount; return listResult; }
public static TNum_CE ToCE(TNumEntity item) { TNum_CE target = new TNum_CE(); target.ID=item.ID; target.Num=item.Num; target.MinNum=item.MinNum; target.MaxNum=item.MaxNum; target.Day=item.Day; target.TabName=item.TabName; return target; }
public ActionResult Sequence() { string TabName = WebUtil.GetFormValue<string>("TabName",string.Empty); string Day = WebUtil.GetFormValue<string>("Day",""); int PageIndex = WebUtil.GetFormValue<int>("PageIndex",1); int PageSize = WebUtil.GetFormValue<int>("PageSize",10); TNumProivder provider = new TNumProivder(); TNumEntity entity = new TNumEntity(); if (!TabName.IsEmpty()) { entity.Where("TabName",ECondition.Like,"%"+TabName+"%"); } if (!Day.IsEmpty()) { entity.Where(a => a.Day == Day); } PageInfo pageInfo = new PageInfo() { PageIndex=PageIndex,PageSize=PageSize }; List<TNumEntity> listResult = provider.GetList(entity,ref pageInfo); listResult = listResult.IsNull() ? new List<TNumEntity>() : listResult; string json = JsonConvert.SerializeObject(listResult); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return Content(this.ReturnJson.ToString()); }