public JsonResult GetOrders() { var listPending = _orderTourRepository.GetOrderTourByStatus("Pending"); var listConfirmed = _orderTourRepository.GetOrderTourByStatus("Confirmed").OrderByDescending(x => x.OrderDate); return(Json(new { ListPending = JsonConvert.SerializeObject(listPending), ListConfirmed = JsonConvert.SerializeObject(listConfirmed), }, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { if (Session["username"] == null) { return(RedirectToAction("Login", "Users", new { area = "" })); } else { ViewBag.orderPending = _orderTourRepository.GetOrderTourByStatus("Pending").ToList().Count; ViewBag.orderCancel = _orderTourRepository.GetOrderTourByStatus("Cancel").ToList().Count; ViewBag.orderConfirmed = _orderTourRepository.GetOrderTourByStatus("Confirmed").ToList().Count; ViewBag.total = _orderTourRepository.GetAll().ToList().Count; return(View()); } }