Ejemplo n.º 1
0
        public ViewResult Criteria2(int id)
        {
            //get the criteria 2 grid report
            Criteria2Grid grid = new Criteria2Grid();
            grid.DataSource = Service.Criteria1ReportData(id);
            grid.Criteria2Synthesis = Service.SynthesisGet(id, 2);
            ViewBag.GridReport = grid;

            //justification reports
            IList<FactorReportViewModel> justificationReports = new List<FactorReportViewModel>();
            IList<DataTable> results = new ReportSource().Criteria2(id);
            for (var x = 0; x < results.Count(); x++)
            {
                Criteria2 rpt = new Criteria2();
                rpt.DataSource = results[x];
                rpt.Run();
                if (results[x].Rows.Count != 0)
                {
                    FactorReportViewModel model = new FactorReportViewModel()
                                                      {
                                                          Report = rpt,
                                                          AnswerId =
                                                              Convert.ToInt32(
                                                                  results[x].Rows[0]["factorId"])
                                                      };
                    justificationReports.Add(model);
                }
            }
            TempData["Context"] = "Review";
            ViewBag.JustificationReports = justificationReports;
            return View("Criteria2");
        }
Ejemplo n.º 2
0
        public ViewResult Criteria3(int id)
        {
            //get the criteria 3 grid report
            Criteria3Grid grid = new Criteria3Grid();
            grid.DataSource = Service.Criteria1ReportData(id);
            grid.DataSource31Grid = Service.Criteria31ReportData(id);
            grid.DataSource32Grid = Service.Criteria32ReportData(id);
            //Next 3 lines added by Bryan Banks
            ReportSource rs = new ReportSource();
            grid.DataSource31 = rs.Criteria31All(id);
            grid.DataSource32 = rs.Criteria32All(id);

            grid.Criteria3Synthesis = Service.SynthesisGet(id, 3);
            grid.Criteria31Synthesis = Service.SynthesisGet(id, 5);
            grid.Criteria32Synthesis = Service.SynthesisGet(id, 6);
            ViewBag.GridReport = grid;

            //justification reports for 3.1
            IList<FactorReportViewModel> justificationReports31 = new List<FactorReportViewModel>();
            IList<DataTable> results = new ReportSource().Criteria31(id);
            for (var x = 0; x < results.Count(); x++)
            {
                Criteria34 rpt = new Criteria34();
                rpt.DataSource = results[x];
                rpt.Run();
                if (results[x].Rows.Count != 0)
                {
                    FactorReportViewModel model = new FactorReportViewModel()
                                                      {
                                                          Report = rpt,
                                                          AnswerId =
                                                              Convert.ToInt32(
                                                                  results[x].Rows[0]["factorId"])
                                                      };

                    justificationReports31.Add(model);
                }
            }

            ViewBag.JustificationReports31 = justificationReports31;

            //justification reports for 3.2
            IList<FactorReportViewModel> justificationReports32 = new List<FactorReportViewModel>();
            results = new ReportSource().Criteria32(id);
            for (var x = 0; x < results.Count(); x++)
            {
                Criteria34 rpt = new Criteria34();
                rpt.DataSource = results[x];
                rpt.Run();
                if (results[x].Rows.Count != 0)
                {
                    FactorReportViewModel model = new FactorReportViewModel()
                                                      {
                                                          Report = rpt,
                                                          AnswerId =
                                                              Convert.ToInt32(
                                                                  results[x].Rows[0]["factorId"])
                                                      };
                    justificationReports32.Add(model);
                }
            }
            ViewBag.JustificationReports32 = justificationReports32;
            TempData["Context"] = "Review";
            return View("Criteria3");
        }