public double GetActivityAmountByPeriod(int year, int period) { AccountActivity activity = GetActivity(year, period); if (activity == null) { return(0); } return(activity.Amount); }
public override bool Equals(object obj) { if (obj is AccountActivity) { AccountActivity _obj = obj as AccountActivity; if (_obj.FromDb && FromDb) { return(_obj.AccountActivityID == AccountActivityID); } return(_obj.AccountID == AccountID && _obj.Period == Period && _obj.FinancialYear == FinancialYear && _obj.Amount == Amount); } return(false); }
public double GetAccountBalance(int year, int period, bool budgets) { double sum = 0; if (budgets) { AccountBudget _obj = RepositoryMgr.AccountBudgetMgr.FindByAccountYearPeriod(AccountID, year, period); if (_obj != null) { sum += _obj.Amount; } } else { AccountActivity _obj = RepositoryMgr.AccountActivityMgr.FindByAccountYearPeriod(AccountID, year, period); if (_obj != null) { sum += _obj.Amount; } } return(sum); }