public ActionResult OrderStatusUpdate(int?orderID) { var order = UnitOfWork.OrderRepository.Get(orderID); var model = new OrderStatusUpdateViewModel { Statuses = UnitOfWork.DictionaryRepository.GetAll(1, 1).Select(s => new SimpleKeyValue <int?, string> { Key = s.ID, Value = s.Caption, IsSelected = order.StatusID == s.ID }).ToList(), StatusSaveUrl = Url.RouteUrl("OrderStatusUpdate", new { orderID = orderID }) }; return(View(model)); }
public ActionResult OrderStatusUpdate(int?orderID, OrderStatusUpdateViewModel model) { var ajaxResponse = new AjaxResponse(); var order = UnitOfWork.OrderRepository.Get(orderID); order.StatusID = model.StatusID; UnitOfWork.Complate(); if (UnitOfWork.IsError) { ajaxResponse.Data = new { Message = Resources.Abort }; } else { ajaxResponse.IsSuccess = true; } return(Json(ajaxResponse)); }