public ActionResult Remove(RemoveTrackViewModel model) { if (model.IsManualTest) { this.manualTestForSolvingService.RemoveByStudentCourseTest(model.StudentId, model.CourseId, model.TestId); } else { this.autoTestForSolvingService.RemoveByStudentCourseTest(model.StudentId, model.CourseId, model.TestId); //if (this.solvedAutomaticTestService.IsWholeTestCompleteTrack(model.TestId,model.CourseId,1)) if (model.CountForSeen - 1 == 0) { var students = this.courseService.GetById(model.CourseId).Students; List <int> testIds = new List <int>(); foreach (var item in students) { foreach (var test in item.SolvedAutomaticTests) { testIds.Add(test.Id); } } this.solvedAutomaticTestService.SetShow(testIds); } } return(Redirect("/TrackExamination")); }
public RemoveTrackView() { InitializeComponent(); _dataContext = new RemoveTrackViewModel(Token); DataContext = _dataContext; AddKeyBindings<BaseEntity>(); Closed += RemoveTrackNewView_Closed; }
void RemoveTrackNewView_Closed(object sender, System.EventArgs e) { _dataContext.Dispose(); _dataContext = null; }