public Decimal GetRegisteredBillAmountByPeriod(Int32 companyId, DateTime? beginDate, DateTime? endDate, Int32? accountId) { var parcelsManager = new ParcelsManager(this); IQueryable<Parcel> billParcels = parcelsManager.GetBillParcelsByPeriodInAccount(companyId, beginDate, endDate, accountId); billParcels = billParcels.Where(bill => bill.OperationDate.HasValue); if (billParcels.Any()) return billParcels.Sum(parcel => parcel.Amount); return Decimal.Zero; }
/// <summary> /// this method returns the total amount of bills /// </summary> /// <param name="companyId"></param> /// <param name="beginDate"></param> /// <param name="endDate"></param> /// <param name="accountId"></param> /// <returns></returns> public Decimal GetBillAmountByPeriodInAccount(Int32 companyId, DateTime? beginDate, DateTime? endDate, Int32? accountId) { var parcelsManager = new ParcelsManager(this); Decimal billAmountValue = Decimal.Zero; IQueryable<Parcel> billParcels = parcelsManager.GetBillParcelsByPeriodInAccount(companyId, beginDate, endDate, accountId); if (billParcels.Any()) billAmountValue = billParcels.Sum(parcel => parcel.Amount); return billAmountValue; }