public ActionResult EditCourse(int?CourseID) { if (!CourseID.HasValue || !ASS.CourseExist(CourseID)) { throw new Exception(); } var Model = AS.GetCourse(CourseID.Value); return(View(Model)); }
public ActionResult CreateAssignment(int?CourseID) { if (CourseID != null) { if (!AS.CourseExist(CourseID)) { throw new Exception(); } } var AssignmentViewModel = new AssignmentViewModel(); AssignmentViewModel.UserModel = US.GetUserOverviewByUserName(User.Identity.GetUserName(), CourseID); return(View(AssignmentViewModel)); }
public void CourseExistTest() { int CourseID = 1; var TheCourse = _AS.CourseExist(CourseID); Assert.IsTrue(TheCourse); }