public static MonthlySave getMostRecentSave(List <MonthlySave> allSaves) { MonthlySave mostRecentSave = null; foreach (MonthlySave save in allSaves) { if (save.Date.CompareTo(mostRecentSave.Date) > 0) { mostRecentSave = save; } } return(mostRecentSave); }
private static void comparesBudgets(MonthlySave monthlySave) { bool exists; foreach (Budget budget in monthlySave.allBudgets) { exists = false; foreach (DistinctBudget distinctBudget in sortedBudgets) { if (budget.name.ToUpper() == distinctBudget.name.ToUpper()) { exists = true; distinctBudget.addBudget(budget); } } if (!exists) { DistinctBudget distinctBudget = new DistinctBudget(budget.name); distinctBudget.addBudget(budget); sortedBudgets.Add(distinctBudget); } } }
/// <summary> /// Vérifie si une sauvegarde mensuelle est nulle. /// </summary> /// <param name="monthlySave">Sauvegarde à vérifier.</param> /// <returns>True si null, false sinon.</returns> public static bool isNull(MonthlySave monthlySave) { return(monthlySave == null); }