Пример #1
0
        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);
        }
Пример #2
0
        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);
                }
            }
        }
Пример #3
0
 /// <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);
 }