Example #1
0
        public DateTime GetEndDate(DateTime StartDate, double estimatedEfforts, string acrStatus, int numberOfAssignees)
        {
            if (acrStatus == "ACR Scheduled")
               {
               int totalDays = Convert.ToInt32(Math.Ceiling(estimatedEfforts / numberOfAssignees));
               DateTime endDate = StartDate.AddBusinessDays(totalDays);
               return endDate;
               }

               else
               {
               throw new InvalidOperationException("ACR Not Scheduled");
               }
        }
Example #2
0
        private static DateTime GetHourWithinBusinessDay(DateTime dateTime, int startOfDayHour, int endOfDayHour, int startOfDayMinute, int endOfDayMinute)
        {
            var startOfDay = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, startOfDayHour, startOfDayMinute, 0);
            var endOfDay = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, endOfDayHour, endOfDayMinute, 0);

            if (dateTime < startOfDay)
                return startOfDay;

            return dateTime > endOfDay
                       ? startOfDay.AddBusinessDays(1)
                       : dateTime;
        }