public ActionResult SendOrderProduct(SendOrderProductModel 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.PreProducting) return PromptView(Url.Action("orderinfo", new { oid = oid }), "订单还未完成备货,不能发货"); ShipCompanyInfo shipCompanyInfo = ShipCompanies.GetShipCompanyById(model.ShipCoId); if (shipCompanyInfo == null) ModelState.AddModelError("ShipCoId", "请选择配送公司"); if (ModelState.IsValid) { AdminOrders.SendOrder(oid, OrderState.Sended, model.ShipSN, model.ShipCoId, shipCompanyInfo.Name, DateTime.Now); CreateOrderAction(oid, OrderActionType.Send, "您订单的已经发货,发货方式为:" + shipCompanyInfo.Name); AddStoreAdminLog("发货", "发货,订单ID为:" + oid); return PromptView(Url.Action("orderinfo", new { oid = oid }), "发货成功"); } ViewData["orderInfo"] = orderInfo; return View(model); }
public ActionResult SendOrderProduct(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.PreProducting) return PromptView(Url.Action("orderinfo", new { oid = oid }), "订单还未完成备货,不能发货"); SendOrderProductModel model = new SendOrderProductModel(); ViewData["orderInfo"] = orderInfo; return View(model); }