public ViewResult Criteria4(int id) { //get the criteria 4 grid report Criteria4Grid grid = new Criteria4Grid(); grid.DataSource = Service.Criteria1ReportData(id); grid.Criteria4Synthesis = Service.SynthesisGet(id, 4); ViewBag.GridReport = grid; //justification reports IList<FactorReportViewModel> justificationReports = new List<FactorReportViewModel>(); IList<DataTable> results = new ReportSource().Criteria4(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"]) }; justificationReports.Add(model); } } TempData["Context"] = "Review"; ViewBag.JustificationReports = justificationReports; return View("Criteria4"); }
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"); }