private void RefreshDayOfWeekHeadersAndListViews() { SundayHeader = StartDate.ToShortDateString(); MondayHeader = StartDate.AddDays(INCREMENT_TO_MONDAY).ToShortDateString(); TuesdayHeader = StartDate.AddDays(INCREMENT_TO_TUESDAY).ToShortDateString(); WednesdayHeader = StartDate.AddDays(INCREMENT_TO_WEDNESDAY).ToShortDateString(); ThursdayHeader = StartDate.AddDays(INCREMENT_TO_THURSDAY).ToShortDateString(); FridayHeader = StartDate.AddDays(INCREMENT_TO_FRIDAY).ToShortDateString(); SaturdayHeader = StartDate.AddDays(INCREMENT_TO_SATURDAY).ToShortDateString(); SundayList.Clear(); MondayList.Clear(); TuesdayList.Clear(); WednesdayList.Clear(); ThursdayList.Clear(); FridayList.Clear(); SaturdayList.Clear(); }
private void ProcessNewWeekOfShifts(List <Shift> processShiftList) { RefreshDayOfWeekHeadersAndListViews(); foreach (Shift shift in processShiftList) { if (shift.StartTime.Date == StartDate) { SundayList.Add(shift); } else if (shift.StartTime.Date == StartDate.AddDays(INCREMENT_TO_MONDAY)) { MondayList.Add(shift); } else if (shift.StartTime.Date == StartDate.AddDays(INCREMENT_TO_TUESDAY)) { TuesdayList.Add(shift); } else if (shift.StartTime.Date == StartDate.AddDays(INCREMENT_TO_WEDNESDAY)) { WednesdayList.Add(shift); } else if (shift.StartTime.Date == StartDate.AddDays(INCREMENT_TO_THURSDAY)) { ThursdayList.Add(shift); } else if (shift.StartTime.Date == StartDate.AddDays(INCREMENT_TO_FRIDAY)) { FridayList.Add(shift); } else if (shift.StartTime.Date == StartDate.AddDays(INCREMENT_TO_SATURDAY)) { SaturdayList.Add(shift); } } }