private static IEnumerable <StudyEventItemViewModel> GetEducatorEvents( EducatorMasterPerson educatorMasterPerson, DateTime fromDate, DateTime toDate) { using (var appointmentsRepository = new EducatorAppointmentsRepository(educatorMasterPerson.Persons.SelectMany(p => p.EducatorEmployments), fromDate, toDate)) { var appointments = appointmentsRepository.GetAppointments(); return(appointments .Where(a => a.IsPublicMaster) .OrderBy(a => a.Start) .ThenBy(a => a.SubjectEnglish) .Select(a => StudyEventItemViewModel.Build(a, forEducator: educatorMasterPerson))); } }
public static IEnumerable <StudyEventItemViewModel> GetStudyEventIndexViewModelsForTerm( StudentGroup studentGroup, StudyEventsTimeTableKind studyEventsTimeTableKind, StudyEventsTimeTableKindCode studyEventsTimeTableKindCode) { if (IsTimeTableKindWebAvailable(studentGroup, studyEventsTimeTableKind)) { using (var appointmentsRepository = new StudentGroupAppointmentsRepository(studentGroup, studyEventsTimeTableKind)) { var appointments = appointmentsRepository.GetAppointments(); return(appointments .Where(a => a.IsPublicMaster) .Where(a => !String.IsNullOrEmpty(a.EducatorsDisplayText)) .OrderBy(a => a.Start) .ThenBy(a => a.Subject) .Select(a => StudyEventItemViewModel.Build(a))); } } return(Enumerable.Empty <StudyEventItemViewModel>()); }
private static IEnumerable <StudyEventItemViewModel> GetStudyEventIndexViewModelsByDateRange( StudentGroup studentGroup, StudyEventsTimeTableKind studyEventsTimeTableKind, DateTime fromDate, DateTime toDate) { if (IsTimeTableKindWebAvailable(studentGroup, studyEventsTimeTableKind)) { using (var appointmentsRepository = new StudentGroupAppointmentsRepository(studentGroup, studyEventsTimeTableKind, fromDate, toDate)) { var appointments = appointmentsRepository.GetAppointments(); return(appointments .Where(a => a.IsPublicMaster) .Where(a => a.EducatorsDisplayText != null) .OrderBy(a => a.Start) .ThenBy(a => a.SubjectEnglish) .Select(a => StudyEventItemViewModel.Build(a))); } } return(Enumerable.Empty <StudyEventItemViewModel>()); }