internal decimal SumBillsForBalance() { decimal result = 0m; foreach (var eachBill in _bills.GetValues()) { PLBill plBill = eachBill as PLBill; if (plBill != null && !plBill.IsValued) { continue; } result += eachBill.Value; } return(result); }
internal decimal CalculateValuedBillCommon(BillType billType, bool isValued) { decimal result = 0m; foreach (var eachBill in _bills.GetValues()) { if (eachBill.Type != billType) { continue; } if (eachBill is PLBill) { PLBill plBill = (PLBill)eachBill; if (plBill.IsValued == isValued) { result += eachBill.Value; } } } return(result); }