Esempio n. 1
0
        public ActionResult report(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction("Index"));
            }


            int BudgetID = id.Value;

            IEnumerable <ReportPeriodList> reppers = projservice.GetFinPeriods(BudgetID);

            Budget _bud2 = projservice.GetBudgetTransactionByID(id.Value);

            if (_bud2.ContractInitialAmt.HasValue)
            {
                //We aggregate the budget/transactions.
                FinanceAggregateService aggrv2 = new FinanceAggregateService(_bud2);
                //AggregateViewHelper aggrv = new AggregateViewHelper(_bud2);
                List <CatRepViewHelper> catrep = aggrv2.GetView(reppers.Count());

                CatRepViewHelper footeracum = aggrv2.GetAcumulatedFooter(catrep, reppers.Count());

                //We generate payment reports from aggregated data.
                PaymentReportService paymentreport = new PaymentReportService(catrep, reppers, footeracum);
                // PaymentReportHelper  paymentrephelper = new PaymentReportHelper(catrep, reppers);
                List <PaymentReport> paymentreports = paymentreport.GenerateReports(_bud2.ContractInitialAmt.Value);

                ViewData["PaymentReports"] = paymentreports;
                ViewData["ProposalID"]     = id.Value;
            }


            return(View());
        }
        public ActionResult aggregated(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction("Index"));
            }

            int BudgetID = id.Value;
            IEnumerable <ReportPeriodList> reppers = projservice.GetFinPeriods(BudgetID);


            SelectList selList = null;

            if (reppers.Count() > 0)
            {
                selList = new SelectList(reppers, "ReportPeriodID", "PeriodTitle", reppers.First());
            }



            ViewData["PeriodList"] = selList;
            ViewData["ProposalID"] = id.Value;

            Budget _bud2 = projservice.GetBudgetTransactionByID(id.Value);
            //
            //AggregateViewHelper aggrv = new AggregateViewHelper(_bud2);
            FinanceAggregateService aggrv2 = new FinanceAggregateService(_bud2);

            List <CatRepViewHelper> catrep = aggrv2.GetView(reppers.Count());

            ViewData["CatRepView"] = catrep;
            CatRepViewHelper footeracum = aggrv2.GetAcumulatedFooter(catrep, reppers.Count());

            ViewData["FooterCum"] = footeracum;

            //  Project _project = projservice.GetProposalInfo(id.Value);   //This will happen In MenuITEM Controller orgservice.GetOrganizationGeneralOfCurrentProposal(id.Value);

            return(View(_bud2));
        }