/// <summary> /// 基本工资表列表展示 /// </summary> /// <param name="rows"></param> /// <param name="page"></param> /// <param name="searchModel"></param> /// <returns></returns> public ActionResult ShowModify(int rows, int page, TBL_GZMXBSearch searchModel) { searchModel.PageIndex = page; searchModel.PageSize = rows; var list = TBL_GZMXBService.LoadSerachEntities(searchModel); return(Content(SerializeHelper.SerializeToList(searchModel.TotalCount, list).Callback())); }
public IQueryable <TBL_GZMXB> LoadSerachEntities(TBL_GZMXBSearch searchModel) { var temp = CurrentDal.LoadEntities(t => true); if (!string.IsNullOrEmpty(searchModel.XM)) { temp = temp.Where(t => t.XM.Contains(searchModel.XM)); } if (!string.IsNullOrEmpty(searchModel.XB)) { temp = temp.Where(t => t.XB.Contains(searchModel.XB)); } if (!string.IsNullOrEmpty(searchModel.WHCD)) { temp = temp.Where(t => t.WHCD.Contains(searchModel.WHCD)); } if (!string.IsNullOrEmpty(searchModel.XLLB)) { temp = temp.Where(t => t.XLLB.Contains(searchModel.XLLB)); } if (!string.IsNullOrEmpty(searchModel.SFZHM)) { temp = temp.Where(t => t.SFZHM.Contains(searchModel.SFZHM)); } if (!string.IsNullOrEmpty(searchModel.GZGW)) { temp = temp.Where(t => t.GZGW.Contains(searchModel.GZGW)); } if (!string.IsNullOrEmpty(searchModel.BM)) { temp = temp.Where(t => t.BM.Contains(searchModel.BM)); } if (searchModel.JRBDWSJ != null) { temp = temp.Where(t => t.JRBDWSJ == searchModel.JRBDWSJ); } if (searchModel.ZXSJ != null) { temp = temp.Where(t => t.ZXSJ == searchModel.ZXSJ); } searchModel.TotalCount = temp.Count(); return(temp.OrderBy(u => u.XM).Skip((searchModel.PageIndex - 1) * searchModel.PageSize).Take(searchModel.PageSize)); }