public ActionResult Index(ReportMenuViewModel vmodel) { if (ModelState.IsValid) { int language = LanguageBL.CheckLanguageSession(); switch (vmodel.TypeReportId) { case "1": vmodel.ReportTotalSales = ReportBL.FindReportTotalSales(vmodel, language); ViewBag.report = true; ViewBag.TypeReportId = vmodel.TypeReportId; return(PartialView("_PartialReportTotalSales", vmodel.ReportTotalSales)); case "2": vmodel.ReportTotalSalesByProduct = ReportBL.FindReportTotalSalesByProduct(vmodel, language); ViewBag.report = true; ViewBag.TypeReportId = vmodel.TypeReportId; return(PartialView("_PartialReportTotalSalesByProduct", vmodel.ReportTotalSalesByProduct)); default: break; } } vmodel.TypesReport = ReportBL.FindAllTypesReport(); return(View(vmodel)); }
// GET: Reports //[Authorize(Roles = "admin")] //[Authorize(Roles = "manager")] //[Authorize(Roles = "vendor")] public ActionResult Index() { ReportMenuViewModel vm = new ReportMenuViewModel(); vm.TypesReport = ReportBL.FindAllTypesReport(); ViewBag.report = false; return(View(vm)); }