コード例 #1
0
ファイル: XmlDataStore.cs プロジェクト: oduma/Fitas
 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();
 }
コード例 #2
0
ファイル: XmlDataStore.cs プロジェクト: oduma/Fitas
 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);
 }