public DynamicStaffFilter GetStaffFilter() { DynamicStaffFilter f = new DynamicStaffFilter(FilterId); f.Refresh(); return f; }
public DynamicStaffFilter GetStaffFilter() { if (CurrentTemplate != null) { DynamicStaffFilter stu = new DynamicStaffFilter(CurrentTemplate.HomeFolderId); stu.Refresh(); return stu; } else { throw new Exception("Could not get the staff filter. The OU has not been set"); } }
public ActionResult Preview(Guid id, int? page, int? pageSize) { MemberFilter f = DbContext.MemberFilters.Find(id); ViewBag.FilterId = id; ViewBag.FilterTitle = f.Title; if (page == null) page = 1; if (pageSize == null) pageSize = 12; FilterPreviewModel m = new FilterPreviewModel(); m.Filter = f; if (f.FilterClass == MemberFilterClass.Staff) { DynamicStaffFilter dsf = new DynamicStaffFilter(id); dsf.Refresh(); List<HRStaffRecord> rr = dsf.Execute(); ViewBag.Total = rr.Count().ToString(); PagedList<HRStaffRecord> pl = new PagedList<HRStaffRecord>(rr, page.Value, pageSize.Value); m.StaffList = pl; } else { DynamicStudentFilter stu = new DynamicStudentFilter(id); stu.Refresh(); List<StudentRecord> ss = stu.Execute(); ViewBag.Total = ss.Count().ToString(); PagedList<StudentRecord> pl = new PagedList<StudentRecord>(ss, page.Value, pageSize.Value); m.StudentList = pl; } return View(m); }
public PagedList<HRStaffRecord> GetStaffMembers(Guid id, int? page) { LcpsDbContext db = new LcpsDbContext(); MemberFilter f = db.MemberFilters.Find(id); if (page == null) page = 1; else { if (page == 0) page = 1; } DynamicStaffFilter stf = new DynamicStaffFilter(id); stf.Refresh(); List<HRStaffRecord> ss = stf.Execute(); PagedList<HRStaffRecord> pl = new PagedList<HRStaffRecord>(ss, page.Value, 12); return pl; }