public ActionResult EditModuleSet(int testId, int?id) { EditTestPermission(testId); var model = new ModuleSetVM(); var set = new TestModuleSet(); var modulePercents = new Dictionary <int, int>(); set.TestPassRule = new TestPassRule(); if (id.HasValue) { TestModuleSetService.LoadWith(x => x.TestPassRule); set = TestModuleSetService.GetByPK(id.Value); modulePercents = EntityUtils.GetModulePercents(set.TestPassRule); } else { set.TestId = testId; set.Number = (short)(1 + MaxModuleSetNumber(testId)); } model.ModulePercents = modulePercents; model.ModuleSet = set; model.Modules = TestModuleService.GetForTest(testId).ToList(); return(BaseViewWithModel(new ModuleSetEditView(), model)); }
public ModuleSetStat(TestModuleSet set, List <UserTest> userTests) { Set = set; UserTests = userTests; }
public void Validate(TestModuleSet set) { ErrorIfFalse(!set.Description.IsEmpty(), "Описание не должно быть пустым"); }