public ActionResult Create(OrderFormViewModel model) { var newOrder = Mapper.Map <OrderFormViewModel, Order>(model); _ordersService.AcceptOrder(newOrder); return(RedirectToAction("Index")); }
public ActionResult Edit(OrderFormViewModel model) { var order = Mapper.Map <OrderFormViewModel, Order>(model); var result = _ordersService.UpdateOrder(order); if (result == ChangeOrderStatusResult.InvalidStatus) { return(View("InvalidStatus")); } if (result == ChangeOrderStatusResult.NotFound) { return(HttpNotFound()); } return(RedirectToAction("Details", new { id = order.Id })); }