public ActionResult EditStoreShipFee(StoreShipFeeModel model, int recordId = -1) { StoreShipFeeInfo storeShipFeeInfo = AdminStores.GetStoreShipFeeById(recordId); if (storeShipFeeInfo == null) return PromptView("店铺配送费用不存在"); StoreShipTemplateInfo storeShipTemplateInfo = AdminStores.GetStoreShipTemplateById(storeShipFeeInfo.StoreSTid); if (storeShipTemplateInfo == null) return PromptView("店铺配送模板不存在"); if (storeShipTemplateInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的配送模板"); if (ModelState.IsValid) { storeShipFeeInfo.RegionId = model.RegionId; storeShipFeeInfo.StartValue = model.StartValue; storeShipFeeInfo.StartFee = model.StartFee; storeShipFeeInfo.AddValue = model.AddValue; storeShipFeeInfo.AddFee = model.AddFee; AdminStores.UpdateStoreShipFee(storeShipFeeInfo); AddStoreAdminLog("修改店铺配送费用", "修改店铺配送费用,店铺配送费用ID为:" + recordId); return PromptView("店铺配送费用修改成功"); } LoadStoreShipFee(model.RegionId); return View(model); }
public ActionResult AddStoreShipFee(StoreShipFeeModel model, int storeSTid = -1) { StoreShipTemplateInfo storeShipTemplateInfo = AdminStores.GetStoreShipTemplateById(storeSTid); if (storeShipTemplateInfo == null) return PromptView("店铺配送模板不存在"); if (storeShipTemplateInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的配送模板"); if (ModelState.IsValid) { StoreShipFeeInfo storeShipFeeInfo = new StoreShipFeeInfo() { StoreSTid = storeSTid, RegionId = model.RegionId, StartValue = model.StartValue, StartFee = model.StartFee, AddValue = model.AddValue, AddFee = model.AddFee }; AdminStores.CreateStoreShipFee(storeShipFeeInfo); AddStoreAdminLog("添加店铺配送费用", "添加店铺配送费用"); return PromptView("店铺配送费用添加成功"); } LoadStoreShipFee(model.RegionId); return View(model); }
public ActionResult EditStoreShipFee(int recordId = -1) { StoreShipFeeInfo storeShipFeeInfo = AdminStores.GetStoreShipFeeById(recordId); if (storeShipFeeInfo == null) return PromptView("店铺配送费用不存在"); StoreShipTemplateInfo storeShipTemplateInfo = AdminStores.GetStoreShipTemplateById(storeShipFeeInfo.StoreSTid); if (storeShipTemplateInfo == null) return PromptView("店铺配送模板不存在"); if (storeShipTemplateInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的配送模板"); StoreShipFeeModel model = new StoreShipFeeModel(); model.RegionId = storeShipFeeInfo.RegionId; model.StartValue = storeShipFeeInfo.StartValue; model.StartFee = storeShipFeeInfo.StartFee; model.AddValue = storeShipFeeInfo.AddValue; model.AddFee = storeShipFeeInfo.AddFee; LoadStoreShipFee(model.RegionId); return View(model); }
public ActionResult AddStoreShipFee(int storeSTid = -1) { StoreShipTemplateInfo storeShipTemplateInfo = AdminStores.GetStoreShipTemplateById(storeSTid); if (storeShipTemplateInfo == null) return PromptView("店铺配送模板不存在"); if (storeShipTemplateInfo.StoreId != WorkContext.StoreId) return PromptView("不能操作其它店铺的配送模板"); StoreShipFeeModel model = new StoreShipFeeModel(); LoadStoreShipFee(0); return View(model); }