public ActionResult Edit([Bind(Prefix = "Order")] Order order_Form) { if (!ModelState.IsValid) { Order_EditVD vd = new Order_EditVD() { Order = order_Form, IsEdit = true, }; return(View(vd)); } Order order = null; order = _orderService.GetObject(order_Form.Id); if (order == null) { return(RenderError("订单不存在!")); } //后台订单添加物流单号,订单状态改成待收货 TryUpdateModel(order, "Order", null, new[] { "Id" }); _orderService.SaveObject(order); SetMessager(MessageType.success, "订单修改成功!"); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { var order = _orderService.GetObject(id); if (order == null) { return(RenderError("订单不存在!")); } var vd = new Order_EditVD() { Order = order, IsEdit = true }; return(View(vd)); }