public ActionResult Edit(ShipTypeAreaPriceInfo shipTypeAreaPriceInfo) { shipTypeAreaPriceInfo.MerchantSysNo = UserAuthHelper.GetCurrentUser().SellerSysNo; var success = ShipTypeAreaPriceService.Edit(shipTypeAreaPriceInfo); return(Json(new { Success = success, Msg = success ? LanguageHelper.GetText("操作成功") : LanguageHelper.GetText("操作失败,请稍候再试") })); }
/// <summary> /// 更新配送方式-地区-价格 /// </summary> /// <param name="entity"></param> /// <returns></returns> public static bool Edit(ShipTypeAreaPriceInfo entity) { //if (!PreCheckShipType(entity)) //{ // return false; //} entity.StoreCompanyCode = entity.CompanyCode; return(ShipTypeAreaPriceDA.Edit(entity)); }
/// <summary> /// 更新配送方式-地区-价格 /// </summary> /// <param name="entity"></param> /// <returns></returns> public static bool Edit(ShipTypeAreaPriceInfo entity) { if (entity != null) { DataCommand cmd = DataCommandManager.GetDataCommand("ShipTypeAreaPrice_Update"); cmd.SetParameterValue(entity); return(cmd.ExecuteNonQuery() > 0); } return(false); }
/// <summary> /// 新增配送方式-地区-价格(非) /// </summary> /// <param name="_viewInfo"></param> /// <param name="callback"></param> public void CreateShipTypeAreaPrice(ShipTypeAreaPriceInfoVM _viewInfo, EventHandler <RestClientEventArgs <dynamic> > callback) { string relativeUrl = "/CommonService/ShipTypeAreaPriceInfo/Create"; ShipTypeAreaPriceInfo entity = new ShipTypeAreaPriceInfo(); //entity.AreaSysNoList = _viewInfo.AreaSysNoList; entity = _viewInfo.ConvertVM <ShipTypeAreaPriceInfoVM, ShipTypeAreaPriceInfo>(); restClient.Create(relativeUrl, entity, callback); }
/// <summary> /// 创建配送方式-地区-价格 /// </summary> /// <param name="entity"></param> /// <returns></returns> public static ShipTypeAreaPriceInfo Create(ShipTypeAreaPriceInfo entity) { if (entity != null) { DataCommand cmd = DataCommandManager.GetDataCommand("ShipTypeAreaPrice_Create"); cmd.SetParameterValue(entity); cmd.ExecuteNonQuery(); entity.SysNo = (int?)cmd.GetParameterValue("@SysNO"); return(entity); } return(null); }
public ActionResult Create(ShipTypeAreaPriceInfo shipTypeAreaPriceInfo) { shipTypeAreaPriceInfo.MerchantSysNo = UserAuthHelper.GetCurrentUser().SellerSysNo; var sysNos = this.Request.Form["AreaSysNoList"]; if (!string.IsNullOrEmpty(sysNos)) { shipTypeAreaPriceInfo.AreaSysNoList = sysNos.Split(',').Select(t => int.Parse(t)).ToList(); } var success = ShipTypeAreaPriceService.Create(shipTypeAreaPriceInfo); return(Json(new { Success = success, Msg = success ? LanguageHelper.GetText("操作成功") : LanguageHelper.GetText("操作失败,请稍候再试") })); }
public virtual ShipTypeAreaPriceInfo CreatShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { if (entity.AreaSysNoList != null && entity.AreaSysNoList.Count > 0 && !entity.AreaSysNo.HasValue) { foreach (int i in entity.AreaSysNoList) { entity.AreaSysNo = i; IShipTypeAreaPrice.CreateShipTypeAreaPrice(entity); } ShipTypeAreaPriceInfo returnEntity = new ShipTypeAreaPriceInfo(); return(returnEntity); } return(IShipTypeAreaPrice.CreateShipTypeAreaPrice(entity)); }
/// <summary> /// 更新配送方式-地区-价格(非) /// </summary> /// <param name="entity"></param> /// <returns></returns> public void UpdateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { if (entity != null) { DataCommand cmd = DataCommandManager.GetDataCommand("ShipTypeAreaPrice_Update"); cmd.SetParameterValue("@SysNo", entity.SysNo); cmd.SetParameterValue("@AreaSysNo", entity.AreaSysNo); cmd.SetParameterValue("@ShipTypeSysNo", entity.ShipTypeSysNo); cmd.SetParameterValue("@BaseWeight", entity.BaseWeight); cmd.SetParameterValue("@TopWeight", entity.TopWeight); cmd.SetParameterValue("@UnitWeight", entity.UnitWeight); cmd.SetParameterValue("@UnitPrice", entity.UnitPrice); cmd.SetParameterValue("@MaxPrice", entity.MaxPrice); cmd.SetParameterValue("@MerchantSysNo", entity.VendorSysNo); cmd.ExecuteNonQuery(); } }
/// <summary> /// 删除配送方式-地区-价格(非) /// </summary> /// <param name="entity"></param> /// <returns></returns> public ShipTypeAreaPriceInfo CreateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { if (entity != null) { DataCommand cmd = DataCommandManager.GetDataCommand("ShipTypeAreaPrice_Create"); cmd.SetParameterValue("@AreaSysNo", entity.AreaSysNo); cmd.SetParameterValue("@ShipTypeSysNo", entity.ShipTypeSysNo); cmd.SetParameterValue("@BaseWeight", entity.BaseWeight); cmd.SetParameterValue("@TopWeight", entity.TopWeight); cmd.SetParameterValue("@UnitWeight", entity.UnitWeight); cmd.SetParameterValue("@UnitPrice", entity.UnitPrice); cmd.SetParameterValue("@MaxPrice", entity.MaxPrice); cmd.SetParameterValue("@CompanyCode", "8601"); cmd.SetParameterValue("@MerchantSysNo", entity.VendorSysNo); cmd.ExecuteNonQuery(); entity.SysNo = (int?)cmd.GetParameterValue("@SysNO"); return(entity); } return(null); }
/// <summary> /// 创建配送方式-地区-价格 /// </summary> /// <param name="entity"></param> /// <returns></returns> public static bool Create(ShipTypeAreaPriceInfo entity) { if (!PreCheckShipTypeAreaPrice(entity)) { return(false); } entity.StoreCompanyCode = entity.CompanyCode; using (var trans = TransactionManager.Create()) { //batch create foreach (int i in entity.AreaSysNoList) { if (i < 1) { continue; } entity.AreaSysNo = i; ShipTypeAreaPriceDA.Create(entity); } trans.Complete(); } return(true); }
public virtual void UpdateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { ShipTypeAreaPriceProcessor.UpdateShipTypeAreaPrice(entity); }
public virtual ShipTypeAreaPriceInfo CreateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { return(ShipTypeAreaPriceProcessor.CreatShipTypeAreaPrice(entity)); }
public virtual void UpdateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { IShipTypeAreaPrice.UpdateShipTypeAreaPrice(entity); }
public void UpdateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { ObjectFactory <ShipTypeAreaPriceAppService> .Instance.UpdateShipTypeAreaPrice(entity); }
public virtual ShipTypeAreaPriceInfo CreateShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { return(ObjectFactory <ShipTypeAreaPriceAppService> .Instance.CreateShipTypeAreaPrice(entity)); }
/// <summary> /// 数据检查 /// </summary> /// <param name="entity"></param> /// <returns></returns> public static bool PreCheckShipTypeAreaPrice(ShipTypeAreaPriceInfo entity) { if (!entity.ShipTypeSysNo.HasValue || entity.ShipTypeSysNo.Value <= 0) { string msg = "配送方式不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } if (!entity.AreaSysNo.HasValue || entity.AreaSysNo.Value <= 0) { if (entity.AreaSysNoList == null || entity.AreaSysNoList.Count <= 0) { string msg = "送货区域不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } else if (entity.AreaSysNoList.Count == 1 && entity.AreaSysNoList[0] == 0) { string msg = "送货区域不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } else { } } else { entity.AreaSysNoList = new List <int>() { entity.AreaSysNo.Value }; } if (!entity.BaseWeight.HasValue) { string msg = "本段起始重量不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } if (!entity.TopWeight.HasValue) { string msg = "本段截至重量不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } if (entity.TopWeight.Value < entity.BaseWeight.Value) { string msg = "本段截至重量不能小于本段起始重量"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } if (!entity.UnitWeight.HasValue) { string msg = "重量基本单位不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } if (!entity.UnitPrice.HasValue) { string msg = "价格基本单位不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } if (!entity.MaxPrice.HasValue) { string msg = "本段最高价格不能为空"; msg = LanguageHelper.GetText(msg); throw new BusinessException(msg); } return(true); }