public static List<v_WorkPlan> getWeekPlanByCondition(int indexPg, int pgSize, ref pub.PagerTClass pageT,int deptid, String content = "", String startTime = "", String endTime = "") { IEnumerable<v_WorkPlan> items; using (DataClassesEduDataContext dc = new DataClassesEduDataContext()) { items = dc.v_WorkPlan; items = items.Where(i => i.detpId == deptid); if (!String.IsNullOrEmpty(content)) items = items.Where(i => i.content.Contains(content)); if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime)) items = items.Where(i => i.createTime >= Convert.ToDateTime(startTime) && i.createTime <= Convert.ToDateTime(endTime)); else if (!String.IsNullOrEmpty(startTime)) items = items.Where(i => i.createTime >= Convert.ToDateTime(startTime)); items = pageT.ShowPage(items, indexPg, pgSize); return items.ToList(); } }
public static List<v_GZL_MyApplyItem> getApplyItemsByCondition(int indexPg,int pgSize,ref pub.PagerTClass pageT,String deptId="",String itemName="",String startTime="",String endTime="") { IEnumerable<v_GZL_MyApplyItem> items; using (DataClassesEduDataContext dc = new DataClassesEduDataContext()) { items = dc.v_GZL_MyApplyItem; if (!String.IsNullOrEmpty(deptId)) items = items.Where(i => i.deptId == Convert.ToInt16(deptId)); if (!String.IsNullOrEmpty(itemName)) items = items.Where(i => i.ItemName.Contains(itemName)); if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime)) items = items.Where(i => i.ApplyDate >= Convert.ToDateTime(startTime) && i.ApplyDate <= Convert.ToDateTime(endTime)); else if (!String.IsNullOrEmpty(startTime)) items = items.Where(i => i.ApplyDate >= Convert.ToDateTime(startTime)); items = pageT.ShowPage(items, indexPg, pgSize); return items.ToList(); } }
public static List<Users> getUsers(int indexPg, int pgSize,ref pub.PagerTClass pageT,String XMPY = "") { IEnumerable<Users> u; using (DataClassesEduDataContext dc = new DataClassesEduDataContext()) { if (!String.IsNullOrEmpty(XMPY)) { u = dc.Users.Where(us => us.XMPY.Contains(XMPY)); } else { u = dc.Users.OrderBy(a=>a.orderNo); } u = pageT.ShowPage(u, indexPg, pgSize); return u.ToList(); } }