public ActionResult Show(int?semester, int?id) { if (semester == null) { var subjects = ScheduleRepository.GetAllSchedule(this.CurrentUser.Class_id); var s1 = SubjectsRepository.GetSubjectsByClassAndSemester(this.CurrentUser.Class_id, 1); var s2 = SubjectsRepository.GetSubjectsByClassAndSemester(this.CurrentUser.Class_id, 2); var allSubjects = SubjectsRepository.GetAllSubjects(); var vm = new GradesViewModel() { Semester1 = s1, Semester2 = s2, AllSubjects = allSubjects }; return(View(vm)); } else if (semester == 1) { return(ShowFirstSemesterGrades(1, id)); } else { return(ShowSecondSemesterGrades(2, id)); } return(View()); }