コード例 #1
0
        // GET: /ProposalInfo/View/1
        //Social Service, Replication ...
        public ActionResult ReportByGrantType(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction("Index"));
            }

            //Reports Generated Here...
            //report(id.Value);
            //---------------------

            //LEFT COLUMN. REPPERs
            IEnumerable <ReportPeriodListR> reps = budservice.GetFinPeriods(id.Value);

            //RIGHT COLUMN PAYMENTS.
            List <BudgetPaymentReport> _bpayrep = report(id.Value);
            ProposalInfo propInfo = projservice.GetProposalInfoOnly(id.Value);
            ProjectInfo  projinfo = projservice.GetProjInfoOnly(id.Value);

            //(List<BudgetPaymentReport> _bpayrep, ProposalInfo _propInfo, ProjectInfo _projInfo)
            FinReportsByGrantTypeView finrepbygranttype = new FinReportsByGrantTypeView(_bpayrep, propInfo, projinfo);

            finrepbygranttype.InflateReport();

            ViewData["finrepbygranttype"] = finrepbygranttype;

            //   ViewData["PaymentReports"] = report(id.Value);



            return(View());
        }
コード例 #2
0
        public ActionResult ReportByGrantTypeList(int?all)
        {
            //Reports Generated Here...
            //report(id.Value);
            //---------------------

            List <FinReportsByGrantTypeView> FinRepList = new List <FinReportsByGrantTypeView>();
            //getAllProject IDs where isDeleted not "true"
            IEnumerable <Project> ProjectIDs = null;

            // <%=ViewData["DisplayLabel"]%>   <%=ViewData["DisplayLink"]%>
            if (all == 1)
            {
                ProjectIDs = projservice.GetAllProjectIDs();
                ViewData["DisplayLabel"] = "Grants Only";
                ViewData["DisplayLink"]  = "?all=0";
            }
            else
            {
                ProjectIDs = projservice.GetAllProjectIDs(true);
                ViewData["DisplayLabel"] = "All";
                ViewData["DisplayLink"]  = "?all=1";
            }

            //Sorting:  ViewData["Results"] = propInfo.OrderByDescending(x =>
            //Convert.ToInt32(x.Project.Label.ToString().Split('-').ElementAt(2))).ToList();

            IEnumerable <Project> SortedProjectIDs = null;

            SortedProjectIDs = ProjectIDs.OrderByDescending(x => Convert.ToInt32(x.Label.ToString().Split('-').ElementAt(2))).ToList();

            foreach (Project id in SortedProjectIDs)
            {
                try
                {
                    ProposalInfo propInfo = projservice.GetProposalInfoOnly(id.ProjectID);
                    ProjectInfo  projinfo = projservice.GetProjInfoOnly(id.ProjectID);
                    FinReportsByGrantTypeView finrepbygranttype = null;

                    if (projinfo != null && propInfo != null)
                    {
                        //(List<BudgetPaymentReport> _bpayrep, ProposalInfo _propInfo, ProjectInfo _projInfo)
                        //LEFT COLUMN. REPPERs
                        IEnumerable <ReportPeriodListR> reps = budservice.GetFinPeriods(id.ProjectID);
                        //RIGHT COLUMN PAYMENTS.
                        List <BudgetPaymentReport> _bpayrep = report(id.ProjectID);
                        finrepbygranttype = new FinReportsByGrantTypeView(_bpayrep, propInfo, projinfo);
                        finrepbygranttype.InflateReport();
                    }

                    if (projinfo != null && propInfo != null && finrepbygranttype != null)
                    {
                        FinRepList.Add(finrepbygranttype);
                    }
                }
                catch (Exception ex)
                {
                    ; //no adding.
                      //Log4Net uses its dll, bin/Log4Net.config -> has C:/Logs/errors2.txt
                      //  Log.EnsureInitialized();
                      //   Log.Error(typeof(ProjectRepository), "-------------------------------------------", ex);
                      //   return null;
                }
            }

            ViewData["FinRepList"] = FinRepList;

            //   ViewData["PaymentReports"] = report(id.Value);



            return(View());
        }