public async Task StartExport() { ModalMessage = null; CoursesList = await _courseService.GetList(); SemestersList = await _semesterService.GetList(); CourseId = CoursesList.FirstOrDefault()?.Id; SemesterId = SemestersList.FirstOrDefault()?.Id; Context.ResourceManager.AddStartupScript("$('div[data-id=export]').modal('show');"); }
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(); }