Ejemplo n.º 1
0
 public ActionResult Edit(int id)
 {
     Order order = _orderRepository.FindById(id);
     if (order == null)
     {
         return HttpNotFound();
     }
     EditOrderViewModel model = new EditOrderViewModel();
     model.Order = order;
     model.OrderStatus = _statusRepository.GetAll().ToList();
     model.PayOutOptions = _payOptionsRepository.GetAll().ToList();
     ViewBag.AdminHeader = "Информация о заказе номер: " + order.OrderId;
     ViewBag.Title = ViewBag.AdminHeader;
     return View(model);
 }
Ejemplo n.º 2
0
 public ActionResult Edit(EditOrderViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     _orderRepository.Update(model.Order);
     _orderRepository.Save();
     model.OrderStatus = _statusRepository.GetAll().ToList();
     model.PayOutOptions = _payOptionsRepository.GetAll().ToList();
     ViewBag.AdminHeader = "Информация о заказе номер: " + model.Order.OrderId;
     ViewBag.Title = ViewBag.AdminHeader;
     return RedirectToAction("Index");
 }