public void Initialize(int ProjID) { try { budservice = new BudgetService(); reppers = budservice.GetFinPeriods(ProjID); _finartcats = budservice.GetFinArticleCategory(ProjID); //We aggregate the budget/transactions. aggrv2 = new BudgetAggregateService(_finartcats.ToList(), reppers.ToList()); catrepview = aggrv2.AccumulateCatRep(); budpayreportservice = new BudgetPaymentReportService(reppers.ToList(), catrepview); bpayrep = budpayreportservice.GenerateReports2(0); } catch { } }
//This method returns Aggregated Report View Data. public CatRepView AccumulateCatRep() { CatRepView catrepview = new CatRepView(); decimal CatRepTotalCounter = 0; decimal transferAmt = 0; decimal PriceValue = 0; foreach (FinArticleCategoryR finartcat in FinArticleCategoryRs) { if (finartcat.TransferAmt == null) { transferAmt = 0; } else { transferAmt = finartcat.TransferAmt.Value; } if (finartcat.Price.HasValue) //just checking for null. { PriceValue = finartcat.Price.Value; } CatRepTotalCounter = CatRepTotalCounter + (PriceValue - transferAmt); } catrepview.CatRepSum = CatRepTotalCounter; List <RepperView> repperList = AccumulateReppers(); catrepview.repper = repperList; return(catrepview); }
public BudgetPaymentReportService(/*List<CatRepView> _catrep, */ IEnumerable <ReportPeriodListR> _reppers, CatRepView _acumcat) { // catrep = _catrep; reppers = _reppers.ToList(); acumcat = _acumcat; }