//Return all exam to choosen subject. public ActionResult ViewExam(Guid id) { ViewBag.subjectId = id; if (examService.CountExamForSubject(id) < 1) { return(View("ViewEmptyExam")); } return(View(examService.ReturnViewExamSub(id))); }
// Return all exams which exist in db choosen by subject and sorted (grid). public ActionResult ViewExams(Guid?id) { ViewBag.subject = new SelectList(subjectService.GetSubjects(), "Id", "Name"); Guid idSubj = id ?? Guid.Empty; ViewBag.id = id; if (idSubj == Guid.Empty) { return(View(examService.ReturnViewExamSub(idSubj))); } else { if (examService.CountExamForSubject(idSubj) < 1) { return(View("ViewEmptyExam")); } return(View(examService.ReturnViewExamSub(idSubj))); } }