Ejemplo n.º 1
0
        ///<summary>Calculates the due date by adding the number of business days listed.  Adds an additional day for each office holiday.</summary>
        public static DateTime ComputeDueDate(DateTime startDate, int days)
        {
            DateTime date    = startDate;
            int      counter = 0;

            while (counter < days)
            {
                date = date.AddDays(1);
                if (date.DayOfWeek == DayOfWeek.Saturday || date.DayOfWeek == DayOfWeek.Sunday)
                {
                    continue;
                }
                if (Schedules.DateIsHoliday(date))
                {
                    continue;
                }
                counter++;
            }
            return(date + TimeSpan.FromHours(17));         //always due at 5pm on day specified.
        }