public ActionResult Input(string id = "") { if (string.IsNullOrEmpty(id)) { ViewBag.Title = "Add New Order"; ViewBag.ConfirmButton = "Add"; Order newOrder = new Order(); newOrder.OrderID = 0; return(View(newOrder)); } else { ViewBag.Title = "Edit Order"; ViewBag.ConfirmButton = "Save"; ViewBag.ShippedDate = ""; try { Order editOrder = SaleManagementBLL.Order_Get(id); if (editOrder == null) { return(RedirectToAction("Index")); } return(View(editOrder)); } catch (Exception e) { Console.WriteLine(e.Message); return(RedirectToAction("Index")); } } }
public ActionResult Detail(string id = "") { ViewBag.Title = "Detail Order"; Order order = SaleManagementBLL.Order_Get(Convert.ToInt32(id)); ViewData["orderdetail"] = SaleManagementBLL.OrderDetail_Get(Convert.ToInt32(id)); ViewData["product"] = CatalogBLL.Product_ListAll(); ViewData["shipper"] = CatalogBLL.Shipper_ListAll(); ViewData["customer"] = CatalogBLL.Customer_ListAll(); ViewData["employee"] = HumanResourceBLL.Employee_ListAll(); return(View(order)); }
public ActionResult Input(string id = "") { if (string.IsNullOrEmpty(id)) { ViewBag.Title = "add new Order"; Order newOrder = new Order(); newOrder.OrderID = 0; return(View(newOrder)); } else { ViewBag.Title = "edit Order"; Order editOrder = SaleManagementBLL.Order_Get(Convert.ToInt32(id)); return(View(editOrder)); } }
public ActionResult Detail(string id = "") { ViewBag.Title = "Order Detail"; if (string.IsNullOrEmpty(id)) { RedirectToAction("Index"); } try { Order order = SaleManagementBLL.Order_Get(id); return(View(order)); } catch { return(RedirectToAction("Index")); } }
public ActionResult ajaxOrderHehe(string id = "") { try { Order checkOrder = SaleManagementBLL.Order_Get(id); if (checkOrder == null) { return(RedirectToAction("Index")); } var model = new Models.OrderDetailsResult { Data = SaleManagementBLL.Order_GetDetailsList(id), }; return(Json(new { model.Data }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(RedirectToAction("Index")); } }
public ActionResult OrderDetail(string id = "") { try { Order checkOrder = SaleManagementBLL.Order_Get(id); if (checkOrder == null) { return(RedirectToAction("Index")); } var model = new Models.OrderDetailsResult { Data = SaleManagementBLL.Order_GetDetailsList(id), OrderID = Convert.ToInt32(id), }; return(View(model)); } catch { return(RedirectToAction("Index")); } }