示例#1
0
        public ActionResult GetModuleSets(int testId, AjaxGridRequest model)
        {
            var list = TestModuleSetService
                       .GetAll(x => x.TestId == testId).OrderBy(x => x.Number).Select(x =>
                                                                                      new { x.Id, x.Number, x.Description }).ToPagedList(model.Page - 1, model.Rows);

            return(JsonGet(new GridData(list.PageCount,
                                        model.Page,
                                        list.Count,
                                        list)));
        }
示例#2
0
        public ActionResult CoursePlanned(string courseTC)
        {
            var course = CourseService.GetByPK(courseTC);
            var testId = course.TestId;

            var moduleSets = TestModuleSetService.GetAll(x => x.TestId == testId)
                             .OrderBy(x => x.Number).ToList();
            var moduleStatuses = UserTestService.GetAll(x =>
                                                        x.IsBest && x.TestId == testId && x.TestModuleSetId.HasValue).ToList()
                                 .GroupBy(x => x.TestModuleSetId.Value)
                                 .ToDictionary(x => x.Key, x => x.First());

            var model = new CoursePlannedTestVM {
                ModuleSets = moduleSets,
                Statuses   = moduleStatuses,
                Course     = course,
            };


            return(BaseViewWithModel(new CoursePlannedTestView(), model));
        }
示例#3
0
 short MaxModuleSetNumber(int testId)
 {
     return(TestModuleSetService.GetAll(x => x.TestId == testId)
            .Max(x => (short?)x.Number).GetValueOrDefault());
 }