public ActionResult ExportToExcel(int?reportMode, int?TopSellingFilterBy, int?SelectedProduct) { ReportViewModel result = ReportViewModel.ExecuteCreate(TopSellingFilterBy, SelectedProduct); if (result != null) { result.GenerateReport(reportMode, TopSellingFilterBy, HttpContext.ApplicationInstance); } else { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } return(View(result)); }
public ActionResult Index(int?TopSellingFilterBy, int?SelectedProduct) { if (Common.Session.IsAdmin) { ReportViewModel result = ReportViewModel.ExecuteCreate(TopSellingFilterBy, SelectedProduct); if (result != null) { return(View(result)); } else { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } } else { return(RedirectToAction(Constants.ACTION_INDEX, Constants.CONTROLLER_SHOP)); } }