public static bool IsHoliday(this DateTime date, IHolidayService holidayService)
        {
            bool retorno = false;

            retorno = holidayService.IsHoliday(date);

            return(retorno);
        }
Beispiel #2
0
        public DateTime CheckDate(DateTime dueDate)
        {
            if (_holidayService.IsHoliday(dueDate) && dueDate.DayOfWeek == DayOfWeek.Friday)
            {
                return(dueDate.AddDays(3));
            }
            else if (_holidayService.IsHoliday(dueDate))
            {
                return(dueDate.AddDays(1));
            }

            if (dueDate.DayOfWeek == DayOfWeek.Saturday)
            {
                return(dueDate.AddDays(2));
            }
            if (dueDate.DayOfWeek == DayOfWeek.Sunday)
            {
                return(dueDate.AddDays(1));
            }

            return(dueDate);
        }