Beispiel #1
0
        private void LoadChecks(DateTime currentDate)
        {
            AppointmentGenerator generator = new AppointmentGenerator();

            DateTime lastMonth = currentDate.AddMonths(-1);
            DateTime nextMonth = currentDate.AddMonths(1);

            YearMonthInfo forLastMonth    = CreateSearchParameter(lastMonth);
            YearMonthInfo forCurrentMonth = CreateSearchParameter(currentDate);
            YearMonthInfo forNextMonth    = CreateSearchParameter(nextMonth);

            _checksInLastMonth = _checkRepository.GetChecksByMonth(forLastMonth);
            _checksInThisMonth = _checkRepository.GetChecksByMonth(forCurrentMonth);
            _checksInNextMonth = _checkRepository.GetChecksByMonth(forNextMonth);

            _allChecks = new List <Check>();
            _allChecks.AddRange(_checksInLastMonth);
            _allChecks.AddRange(_checksInThisMonth);
            _allChecks.AddRange(_checksInNextMonth);

            List <Check> checksWithFlag = ApplyCheckFlagQuery();

            List <AppointmentCheck> allAppointments = generator.CreateAppointmentObjects(checksWithFlag);

            ScheduleView.AppointmentsSource = allAppointments;
            ScheduleView.Commit();
            ScheduleView.SelectedAppointment = null;
        }