public override async Task Load() { CoursesList = await _courseService.GetList(); SemestersList = await _semesterService.GetList(); if (!Context.IsPostBack) { var course = CoursesList.FirstOrDefault(); if (course != null) { SelectedCourseId = course.Id; } var semester = SemestersList.FirstOrDefault(); if (semester != null) { SelectedSemesterId = semester.Id; } } CourseInstanceExist = await _courseService.CourseInstanceExists(SelectedCourseId, SelectedSemesterId); if (CourseInstanceExist) { ExamsList = await _examService.GetOralExamsListForCourseInstance(SelectedCourseId, SelectedSemesterId); EnrolmentsList = await _enrolmentService.GetForCourseInstance(SelectedCourseId, SelectedSemesterId); if (AddNewStudent) { StudentsList = await _studentService.GetAll(); } } AnyExistingExams = ExamsList != null && ExamsList.Any(); if (!Context.IsPostBack) { if (!AnyExistingExams) { IsExistingExams = false; } } await base.Load(); }
public async Task GetEnrolments(CourseInstanceBase courseInstance) { EnrolmentsList = await _enrolmentService.GetForCourseInstance(courseInstance); }