Esempio n. 1
0
 public BudgetMonth(BudgetMonth budgetMonth)
 {
     Month         = budgetMonth.Month;
     Year          = budgetMonth.Year;
     BudgetReal    = new BudgetReal(budgetMonth.BudgetReal);
     BudgetPlanned = new BudgetPlanned(budgetMonth.BudgetPlanned);
 }
Esempio n. 2
0
        public static BudgetMonth Create(List <BudgetCategoryTemplate> categories, DateTime date)
        {
            var month = new BudgetMonth();

            month.SetupCategories(categories);
            month.SetupDate(date);

            return(month);
        }
Esempio n. 3
0
        public BudgetMonth GetMonth(DateTime date)
        {
            var month = _months.Find(x => x.Month == date.Month && x.Year == date.Year);

            if (month == null)
            {
                month = BudgetMonth.Create(BudgetDescription.Categories, date);
                month.onBudgetPlannedChanged += OnPlannedBudgetChanged;
                month.UpdatePlannedBudget(budgetPlanned);
                month.Setup();
                _months.Add(month);
                //??
                //Save();
            }

            return(month);
        }