예제 #1
0
 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"));
 }
예제 #2
0
 public RemoveTrackView()
 {
     InitializeComponent();
     _dataContext = new RemoveTrackViewModel(Token);
     DataContext = _dataContext;
     AddKeyBindings<BaseEntity>();
     Closed += RemoveTrackNewView_Closed;
 }
예제 #3
0
 void RemoveTrackNewView_Closed(object sender, System.EventArgs e)
 {
     _dataContext.Dispose();
     _dataContext = null;
 }