internal static List<Day> GetWeekDays(WeekSummary weekSummary) { var daysDone = GetDaysList().Where(d => d.WeekId == weekSummary.WeekId).ToList(); var initialCount = daysDone.Count; for (int i = weekSummary.NoOfDays; i > initialCount; i--) daysDone.Add(new Day { DayId = i, Status = Status.NotStarted, WeekId = weekSummary.WeekId, WeekSummary = weekSummary }); return daysDone.OrderBy(d => d.DayId).ToList(); }
internal static void SaveWeekHistory(WeekSummary finishedWeek) { List<WeekSummary> weekSummaries = GetWeeksHistory(); var foundWeek = weekSummaries.FirstOrDefault(w => w.WeekId == finishedWeek.WeekId); if (foundWeek != null) weekSummaries.Remove(foundWeek); weekSummaries.Add(finishedWeek); SaveWeeks(weekSummaries); }