private void OnIncomeAmountPropertyChanged(object sender, EventArgs propertyChangedEventArgs)
        {
            if (!this.isLoadingBudgetModel && IncomeTotal != 0)
            {
                Dirty = true;
            }

            IncomeTotal = Incomes.Sum(x => x.Amount);
            Surplus     = IncomeTotal - ExpenseTotal;
        }
示例#2
0
        public int Balance()
        {
            if (Incomes != null &&
                Expenses != null &&
                TransfersTo != null &&
                TransfersFrom != null)
            {
                return(OpeningBalance +
                       Incomes.Sum(i => i.Amount) -
                       Expenses.Sum(e => e.Amount) -
                       TransfersFrom.Sum(t => t.Amount) +
                       TransfersTo.Sum(t => t.Amount));
            }

            return(0);
        }
示例#3
0
 private Amount TotalIncome() => Amount.FromDecimal(Incomes.Sum(i => i.Amount));
示例#4
0
 public virtual int Rest()
 {
     return(Incomes.Sum(income => income.QuantityCurrent));
 }