/// <summary> /// Sums both Income & Expense DataLists. /// </summary> public void UpdateData() { if (ExpenseDataList != null) { IncomeTotal = IncomeDataList.Sum(x => x.Amount); ExpenseTotal = ExpenseDataList.Sum(x => x.Amount); NetDifference = IncomeTotal - ExpenseTotal; } }
/// <summary> /// Sums the Expense DataList Values. Sorts all Expense SubCategories. /// </summary> public void UpdateExpense() { ExpenseTotal = ExpenseDataList.Sum(x => x.Amount); NetDifference = IncomeTotal - ExpenseTotal; if (Expense.AllExpenseCategories != null) { Expense.AllExpenseCategories = SortCategories(ExpenseDataList.ToList(), Expense.AllExpenseCategories); } }