public ActionResult UpdateOrderShipFee(UpdateOrderShipFeeModel model, int oid = -1) { OrderInfo orderInfo = AdminOrders.GetOrderByOid(oid); if (orderInfo == null) return PromptView("订单不存在"); if (orderInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的订单"); if (!(orderInfo.OrderState == (int)OrderState.WaitPaying || (orderInfo.OrderState == (int)OrderState.Confirming && orderInfo.PayMode == 0))) return PromptView(Url.Action("orderinfo", new { oid = oid }), "不能修改订单配送费用"); if (ModelState.IsValid) { decimal change = model.ShipFee - orderInfo.ShipFee; Orders.UpdateOrderShipFee(orderInfo.Oid, model.ShipFee, orderInfo.OrderAmount + change, orderInfo.SurplusMoney + change); CreateOrderAction(oid, OrderActionType.UpdateShipFee, "您订单的配送费用已经修改"); AddStoreAdminLog("更新订单配送费用", "更新订单配送费用,订单ID为:" + oid); if ((orderInfo.SurplusMoney + change) <= 0) AdminOrders.UpdateOrderState(oid, OrderState.Confirming); return PromptView(Url.Action("orderinfo", new { oid = oid }), "更新订单配送费用成功"); } ViewData["orderInfo"] = orderInfo; return View(model); }
public ActionResult UpdateOrderShipFee(int oid = -1) { OrderInfo orderInfo = AdminOrders.GetOrderByOid(oid); if (orderInfo == null) return PromptView("订单不存在"); if (orderInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的订单"); if (!(orderInfo.OrderState == (int)OrderState.WaitPaying || (orderInfo.OrderState == (int)OrderState.Confirming && orderInfo.PayMode == 0))) return PromptView(Url.Action("orderinfo", new { oid = oid }), "不能修改订单配送费用"); UpdateOrderShipFeeModel model = new UpdateOrderShipFeeModel(); model.ShipFee = orderInfo.ShipFee; ViewData["orderInfo"] = orderInfo; return View(model); }