public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = new EditOrderModel { Order = OrderService.GetOrderDetails(id), OrderStatus = OrderHistoryEnu.GetAllOrderStatus(), Riders = UserService.GetUsersByype("0") }; return(View(model)); }
//[ValidateAntiForgeryToken] public ActionResult Edit([Bind(Include = "Id,Status,Address,Instructions,PickedBy,DeliveryCost,Comments")] OrderLocal order) { var response = OrderService.EditOrder_Admin(order); if (response.Status) { return(RedirectToAction("Index")); } ModelState.AddModelError(string.Empty, response.Error); var refMOdel = new EditOrderModel { Order = OrderService.GetOrderDetails(order.Id.ToString()), OrderStatus = OrderHistoryEnu.GetAllOrderStatus(), Riders = UserService.GetUsersByype("0") }; return(View(refMOdel)); }
public JsonResult GetAllOrderStatuses() { var retModel = new AllOrderStatuses { Success = false }; try { retModel.ListStatuses = OrderHistoryEnu.GetAllOrderStatus(); retModel.Success = true; } catch (Exception e) { retModel.Message = "could not get order statuses."; throw; } return(Json(retModel, JsonRequestBehavior.AllowGet)); }