public ActionResult Semester(string publicDivisionAlias, int studentGroupId, int?autumn) { var studentGroup = studentGroupRepository.GetStudentGroupById(studentGroupId); var publicDivision = publicDivisionRepository.GetPublicDivisionByAlias(publicDivisionAlias); if (studentGroup != null) { var viewModel = StudentGroupEventsSemesterViewModel.Build(studentGroup, publicDivision, autumn); return(View(viewModel.ViewName, viewModel)); } return(View()); }
public FileStreamResult ExcelSemester(string publicDivisionAlias, int studentGroupId, int?autumn) { var studentGroup = studentGroupRepository.GetStudentGroupById(studentGroupId); var publicDivision = publicDivisionRepository.GetPublicDivisionByAlias(publicDivisionAlias); if (studentGroup != null) { var viewModel = StudentGroupEventsSemesterViewModel.Build(studentGroup, publicDivision, autumn); return(File( GetXmlContentAsStream(studentGroup, viewModel), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"расписание {studentGroup.Name} {(viewModel.IsSpringSemester ? "весенний": "осенний")} семестр {studentGroup.CurrentStudyYear.DisplayName}.xlsx")); } return(null); }