public DateTime GetEndDate(DateTime start, int period, PerfomancePeriodType periodType) { if (periodType == PerfomancePeriodType.Calendar) return start.AddDays(period); using (var uofw = _unitOfWorkFactory.CreateSystem()) { var dtmEnd = start; var weekends = uofw.GetRepository<Weekend>().All().Where(x => !x.Hidden).Select(x => x.Start).ToList(); while (period > 0) { dtmEnd = dtmEnd.AddDays(1); if (weekends.All(x => x.Date != dtmEnd.Date)) { period--; } } return dtmEnd; } }
public int GetPeriod(DateTime start, DateTime end, PerfomancePeriodType periodType) { throw new NotImplementedException(); }