Beispiel #1
0
        public ActionResult EditOrderDetail(int id) // "id" is "id order number".
        {
            OrderRepo orderRepo = new OrderRepo();
            OrderDetails orderDetails = new OrderDetails();


            orderDetails = orderRepo.GetOrderDetail(id);
            return View(orderDetails);
        }
Beispiel #2
0
        public ActionResult EditOrderDetail(OrderDetails orderDetails)
        {
            OrderRepo orderRepo = new OrderRepo();
            OrderDetails editedOrderDetails = new OrderDetails();

            if (ModelState.IsValid)
            {
                editedOrderDetails = orderRepo.UpdateOrder(orderDetails);
                return RedirectToAction("AdminOnly");
            }
            else
            {
                ViewBag.ErrorMessage = "This entry is invalid.";
                return View(orderDetails);
            }
        }
Beispiel #3
0
 public ActionResult AdminOrderDetails()
 {
     OrderRepo orderRepo = new OrderRepo();
     OrderDetail orderDetail = orderRepo.GetOrderDetail();
     return View("AdminOrderDetails", orderDetail);
 }