public List <DataBook> Get(DataBookFilter Filter) { using (var db = GetDbContext()) { var query = db.DataBooks.AsQueryable(); if (Filter.Status != CheckStatus.All) { query = query.Where(e => e.Status == Filter.Status); } if (!string.IsNullOrEmpty(Filter.Name)) { query = query.Where(e => e.Name == Filter.Name); } if (!string.IsNullOrEmpty(Filter.Checker)) { query = query.Where(e => e.Checker == Filter.Checker); } if (!string.IsNullOrEmpty(Filter.GroupName)) { query = query.Where(e => e.GroupName == Filter.GroupName); } if (Filter.Label.HasValue) { query = query.Where(e => e.Label == Filter.Label.Value); } if (Filter.Page != null) { Filter.Page.RecordCount = query.Count(); query = query.OrderBy(e => e.ID).Skip(Filter.Page.PageSize * (Filter.Page.PageIndex - 1)).Take(Filter.Page.PageSize); } return(query.ToList()); } }
/// <summary> /// 申请权限历史 管理者和普通用户 /// </summary> /// <param name="status"></param> /// <param name="page"></param> /// <returns></returns> public ActionResult History(CheckStatus status = CheckStatus.All, int page = 1) { var filter = new DataBookFilter { Name = Identity.Name, Status = status, Page = new PageParameter(page, 20) }; ViewBag.List = Core.DataBookManager.Get(filter); ViewBag.Page = filter.Page; return(View()); }
public ActionResult History(CheckStatus status = CheckStatus.All, int page = 1) { var filter = new DataBookFilter { Name = sAMAccountName, Status = status, Page = new Page(page) }; ViewBag.List = Core.DataBookManager.Get(filter); ViewBag.Page = filter.Page; return(View()); }
public ActionResult CHistory(bool?Label, CheckStatus status = CheckStatus.All, string Name = null, string GroupName = null, int page = 1) { var filter = new DataBookFilter { Status = status, Checker = Identity.Name, Name = Name, GroupName = GroupName, Label = Label, Page = new Page(page) }; ViewBag.List = Core.DataBookManager.Get(filter); ViewBag.Page = filter.Page; var list = Core.DataBookManager.GetList(Identity.Name); ViewBag.NList = list.GroupBy(e => e.Name).Select(e => e.Key).ToList(); ViewBag.GList = list.GroupBy(e => e.GroupName).Select(e => e.Key).ToList(); return(View()); }