public ActionResult SalesOfEachProduct() { Session["Start"] = ""; Session["End"] = ""; var model = new ListReports().SalesOfEachProduct(); return(View(model.OrderBy(p => p.Quantity))); }
public ActionResult SalesOfEachProduct(DateTime?daterangepicker_start, DateTime?daterangepicker_end) { if (daterangepicker_start == null || daterangepicker_end == null) { ViewBag.Error = "You must input date !!!"; } else { Session["Start"] = daterangepicker_start; Session["End"] = daterangepicker_end; var model = new ListReports().SalesOfEachProduct(daterangepicker_start, daterangepicker_end); ViewBag.Date = daterangepicker_start + " - " + daterangepicker_end; return(View(model.OrderBy(p => p.Quantity))); } return(RedirectToAction("SalesOfEachProduct")); }