/// <summary> /// 删除自动调价设置 /// </summary> /// <param name="searchDto"></param> /// <returns></returns> public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO DeleteExt(System.Guid id) { if (id == Guid.Empty) { return(new Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO { isSuccess = false, Message = "参数错误" }); } ContextSession contextSession = ContextFactory.CurrentThreadContext; var supplierMain = CommodityPriceFloat.FindByID(id); if (supplierMain != null) { supplierMain.IsDel = true; contextSession.SaveObject(supplierMain); } try { contextSession.SaveChanges(); } catch (Exception ex) { LogHelper.Error("CommodityPriceFloatBP.DeleteExt 异常", ex); return(new Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO { isSuccess = false, Message = ex.Message }); } return(new Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO { isSuccess = true }); }
/// <summary> /// 修改自动调价设置 /// </summary> /// <param name="searchDto"></param> /// <returns></returns> public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateExt(Jinher.AMP.BTP.Deploy.CommodityPriceFloatDTO dto) { ContextSession contextSession = ContextFactory.CurrentThreadContext; try { var entity = CommodityPriceFloat.FindByID(dto.Id); entity.EsAppId = dto.EsAppId; entity.AppIds = dto.AppIds; entity.FloatPrice = dto.FloatPrice; contextSession.SaveObject(entity); contextSession.SaveChanges(); } catch (Exception ex) { LogHelper.Error("CommodityPriceFloatBP.UpdateExt 异常", ex); return(new Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO { isSuccess = false, Message = ex.Message }); } return(new Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO { isSuccess = true }); }