private IReport GetReportByType(ReportType.Type reportType) { switch (reportType) { case ReportType.Type.STANDARD: return(new StandardReports()); case ReportType.Type.CATEGORY: return(new CategoryReport()); case ReportType.Type.CATEGORY_AND_ACCOUNT: return(new CategoryAccountReport()); case ReportType.Type.INVOICE_LIST: return(new InvoiceReport()); default: throw new Exception("Incorrect report value: " + reportType); } }
// GET: Report public ActionResult Reports(ReportType.Type type, string message = "", bool isSucceed = false) { List <string> articleReportHeaders = new List <string> { "Report ID", "Article ID", "Report Type", "Action" }; ViewData["Headers"] = articleReportHeaders; if (message.Equals("")) { ViewData["MessageReturned"] = false; } else { ViewData["MessageReturned"] = true; } ViewData["Message"] = message; ViewData["IsSucceed"] = isSucceed; SiteContext db = new SiteContext(); return(View("~/Views/Admin/Reports.cshtml", db.Reports.ToList())); }
private void PrepareReportDetails(ReportType.Type reportType) { Dictionary <int, Tuple <string, string> > reportSettings = PrepareReportSettings(); dg_reports.ItemsSource = reportService.PrepareReport(reportType, reportSettings); }
public DataView PrepareReport(ReportType.Type reportType, Dictionary <int, Tuple <string, string> > reportSettings) { var report = GetReportByType(reportType); return(sqlEngine.PrepareReport(report, reportSettings).DefaultView); }