コード例 #1
0
        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;
            }
        }
コード例 #2
0
 public int GetPeriod(DateTime start, DateTime end, PerfomancePeriodType periodType)
 {
     throw new NotImplementedException();
 }