Beispiel #1
0
        private static DateTime GetNewWorkDay(DateTime date, HolidayProvider holidays)
        {
            var newDate = GetNewDate(date.AddDays(1), new TimeSpan(8, 0, 0));

            newDate = WorkDayProvider.Validate(newDate, holidays);
            newDate = WorkHourProvider.Validate(newDate, holidays);
            return(holidays.Validate(newDate));
        }
Beispiel #2
0
        private DateTime CheckEndDate(DateTime newStartDate, int minutes, HolidayProvider holidays)
        {
            var endDate = TimeTools.AddMinutes(newStartDate, minutes, holidays);

            endDate = holidays.Validate(endDate);
            endDate = WorkDayProvider.Validate(endDate, holidays);
            endDate = WorkHourProvider.Validate(endDate, holidays);
            return(endDate);
        }
Beispiel #3
0
 private DateTime CheckStartDate(DateTime start, HolidayProvider holidays)
 {
     //Check the start date
     start = holidays.Validate(start);
     //Compensate for Saturday and Sunday
     start = WorkDayProvider.Validate(start, holidays);
     //Ensure only work hours are used
     start = WorkHourProvider.Validate(start, holidays);
     return(start);
 }