// GET: /ProposalInfo/View/1 public ActionResult View(int?id, int?errorcode) { if (!id.HasValue) { return(RedirectToAction("Index")); } if (errorcode.HasValue) { if (errorcode.Value == -2) { ViewData["Error"] = "You must Insert Report Periods First!"; } } int BudgetID = id.Value; // Project _project = projservice.GetProposalInfo(id.Value); //This will happen In MenuITEM Controller orgservice.GetOrganizationGeneralOfCurrentProposal(id.Value); // Budget _budget = projservice.GetBudgetBYID(id.Value); //LINQ ONE. IEnumerable <ReportPeriodListR> _repperR = budservice.GetFinPeriods(BudgetID); IEnumerable <FinArticleCategoryR> _finartcats = budservice.GetFinArticleCategory(BudgetID); BudgetAggregateService budaggs = new BudgetAggregateService(_finartcats.ToList(), _repperR.ToList()); CatRepView catrepview = budaggs.AccumulateCatRep(); ViewData["RepView"] = catrepview; // IEnumerable<FinArticleCategoryR> catr = budservice.GetFinArticleCategory(id.Value);// projservice.GetBudgetTransactionByID(id.Value); ViewData["ArtCat"] = _finartcats; Budget b = budservice.GetBudget(id.Value); ViewData["InfoBox"] = b.InfoBox; ViewData["Cancellation"] = b.Cancellation; ViewData["Returned"] = b.Returned; // ViewData["BudgetCatList"] = new SelectList(projservice.GetCatList(), "FinArticleCatID", "FinArticleCatName"); // ViewData["ProgramAreaList"] = new SelectList(projservice.GetProgramAreaList(), "ProgramAreaCodeID", "ProgramAreaText"); ViewData["BudgetCatList"] = new SelectList(budservice.GetCatList(), "FinArticleCatListID", "FinArticleCatName"); ViewData["BudgetID"] = id.Value; ViewData["PeriodList"] = new SelectList(budservice.GetFinPeriods(id.Value), "ReportPeriodID", "PeriodTitle"); ViewData["RepPeriodList"] = budservice.GetFinPeriods(id.Value); return(View()); }
public List <BudgetPaymentReport> report(int id) { int BudgetID = id; IEnumerable <ReportPeriodListR> _repperR = budservice.GetFinPeriods(BudgetID); IEnumerable <FinArticleCategoryR> _finartcats = budservice.GetFinArticleCategory(BudgetID); BudgetAggregateService budaggs = new BudgetAggregateService(_finartcats.ToList(), _repperR.ToList()); CatRepView catrepview = budaggs.AccumulateCatRep(); BudgetPaymentReportService budpayreportservice = new BudgetPaymentReportService(_repperR, catrepview); int bdinitamt = budservice.GetBudgetInitialAmount(id); List <BudgetPaymentReport> bpayrep = budpayreportservice.GenerateReports2(bdinitamt); return(bpayrep); // public BudgetAggregateService(List<FinArticleCategoryR> _finartcats, List<ReportPeriodListR> _repperR) // { // Budget bd = budservice.GetBudget(BudgetID); }