コード例 #1
0
ファイル: SampleReportController.cs プロジェクト: joyoon/mb
 //
 // GET: /SampleReport/
 public ActionResult Index()
 {
     ART.Reporting.Criteria2 rpt = new Criteria2();
     rpt.DataSource = new ReportSource().Criteria1(1)[0]; //Need to bind ReportId
     rpt.Run();
     ViewBag.Report = rpt;
     return View();
 }
コード例 #2
0
ファイル: ReviewController.cs プロジェクト: joyoon/mb
        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");
        }