예제 #1
0
        public DynamicStudentFilter GetStudentFilter()
        {
            DynamicStudentFilter f = new DynamicStudentFilter(FilterId);
            f.Refresh();

            return f;
        }
예제 #2
0
        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);
        }
예제 #3
0
        public ActionResult AddStudentClause(StudentFilterClauseModel m)
        {
            try
            {
                DynamicStudentFilter f = new DynamicStudentFilter(m.FilterId);
                f.CreateClause(m.ToFilterClause());
                f.Refresh();

                return RedirectToAction("EditFilter", new { id = m.FilterId });
            }
            catch (Exception ex)
            {
                AnvilExceptionModel em = new AnvilExceptionModel(ex, "Create Student Clause", m.FormArea, m.FormController, "Index");

                return View("Error", em);
            }
        }
예제 #4
0
        public PagedList<StudentRecord> GetStudents(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;
            }

            DynamicStudentFilter stu = new DynamicStudentFilter(id);
            stu.Refresh();
            List<StudentRecord> ss = stu.Execute();

            PagedList<StudentRecord> pl = new PagedList<StudentRecord>(ss, page.Value, 12);

            return pl;
        }
예제 #5
0
 public DynamicStudentFilter GetStudentFilter()
 {
     if (CurrentTemplate != null)
     {
         DynamicStudentFilter f = new DynamicStudentFilter(CurrentTemplate.GroupId);
         f.Refresh();
         return f;
     }
     else
     {
         throw new Exception("Could not get student filter. The Group has not been set");
     }
 }
예제 #6
0
 public ActionResult AddStudentClause(StudentFilterClauseModel m)
 {
     DynamicStudentFilter f = new DynamicStudentFilter(m.FilterId);
     f.CreateClause(m.ToFilterClause());
     return RedirectToAction("StudentMembership", new { id = m.FilterId });
 }