public ActionResult PayOrder(PayOrderModel model, int oid = -1) { OrderInfo orderInfo = AdminOrders.GetOrderByOid(oid); if (orderInfo == null) return PromptView("订单不存在"); if (orderInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的订单"); if (orderInfo.PayMode != 2) return PromptView(Url.Action("orderinfo", new { oid = oid }), "付款操作只适用于线下付款"); if (orderInfo.OrderState != (int)OrderState.WaitPaying) return PromptView(Url.Action("orderinfo", new { oid = oid }), "当前不能支付订单"); if (ModelState.IsValid) { AdminOrders.PayOrder(oid, OrderState.Confirming, model.PaySN, DateTime.Now); CreateOrderAction(oid, OrderActionType.Pay, "您的订单成功支付,请等待确认"); AddStoreAdminLog("支付订单", "支付订单,订单ID为:" + oid); return PromptView(Url.Action("orderinfo", new { oid = oid }), "订单支付成功"); } ViewData["orderInfo"] = orderInfo; return View(model); }
public ActionResult PayOrder(int oid = -1) { OrderInfo orderInfo = AdminOrders.GetOrderByOid(oid); if (orderInfo == null) return PromptView("订单不存在"); if (orderInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的订单"); if (orderInfo.PayMode != 2) return PromptView(Url.Action("orderinfo", new { oid = oid }), "付款操作只适用于线下付款"); if (orderInfo.OrderState != (int)OrderState.WaitPaying) return PromptView(Url.Action("orderinfo", new { oid = oid }), "当前不能支付订单"); PayOrderModel model = new PayOrderModel(); ViewData["orderInfo"] = orderInfo; return View(model); }