Ejemplo n.º 1
0
        public static WeekWithoutProgressDto GetNullWeek()
        {
            WeekWithoutProgressDto nullWeek = new WeekWithoutProgressDto();

            nullWeek.Id         = -1;
            nullWeek.Number     = 0;
            nullWeek.MondayDate = DateTime.Now;
            if (nullWeek.MondayDate.DayOfWeek != DayOfWeek.Monday)
            {
                var offset = (int)DayOfWeek.Monday - (int)nullWeek.MondayDate.DayOfWeek;

                //following two lines could be combined.
                var monday = nullWeek.MondayDate + TimeSpan.FromDays(offset);
                nullWeek.MondayDate = monday;
            }
            nullWeek.DayCount = 5;

            return(nullWeek);
        }
Ejemplo n.º 2
0
 public WeekForCreationDto(WeekWithoutProgressDto previousWeek)
 {
     Number     = previousWeek.Number + 1;
     MondayDate = previousWeek.MondayDate.AddDays(7);
     DayCount   = 5; //TODO: method to get day count based on recognized holidays. upload school calendar? Hah!
 }