/// <summary> /// 更新交易费用交易手续费_范围_值 /// </summary> /// <param name="xH_SpotRangeCost">交易手续费_范围_值实体类</param> /// <param name="cMFieldRange">字段范围值实体</param> /// <returns></returns> public bool UpdateSpotRangeCost(CM_FieldRange cMFieldRange, XH_SpotRangeCost xH_SpotRangeCost) { CM_FieldRangeDAL cMFieldRangeDAL = new CM_FieldRangeDAL(); XH_SpotRangeCostDAL xHSpotRangeCostDAL = new XH_SpotRangeCostDAL(); DbConnection Conn = null; Database db = DatabaseFactory.CreateDatabase(); Conn = db.CreateConnection(); if (Conn.State != ConnectionState.Open) { Conn.Open(); } DbTransaction Tran = Conn.BeginTransaction(); try { cMFieldRangeDAL.Update(cMFieldRange, Tran, db); xHSpotRangeCostDAL.Update(xH_SpotRangeCost, Tran, db); Tran.Commit(); return(true); } catch (Exception ex) { Tran.Rollback(); GTA.VTS.Common.CommonUtility.LogHelper.WriteError(ex.Message, ex); return(false); } finally { if (Conn != null && Conn.State == ConnectionState.Open) { Conn.Close(); } } }
/// <summary> /// 更新交易规则_最小变动价位_范围_值 /// </summary> /// <param name="xHMinChangePriceValue">交易规则_最小变动价位_范围_值实体</param> /// <param name="cMFieldRange">字段范围值实体</param> /// <returns></returns> public bool UpdateMinChangePriceValue(CM_FieldRange cMFieldRange, XH_MinChangePriceValue xHMinChangePriceValue) { CM_FieldRangeDAL cMFieldRangeDAL = new CM_FieldRangeDAL(); XH_MinChangePriceValueDAL xHMinChangePriceValueDAL = new XH_MinChangePriceValueDAL(); DbConnection Conn = null; Database db = DatabaseFactory.CreateDatabase(); Conn = db.CreateConnection(); if (Conn.State != ConnectionState.Open) { Conn.Open(); } DbTransaction Tran = Conn.BeginTransaction(); try { cMFieldRangeDAL.Update(cMFieldRange, Tran, db); xHMinChangePriceValueDAL.Update(xHMinChangePriceValue, Tran, db); Tran.Commit(); return(true); } catch (Exception ex) { Tran.Rollback(); string errCode = "GL-5322"; string errMsg = "更新交易规则_最小变动价位_范围_值失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); return(false); } finally { if (Conn.State == ConnectionState.Open) { Conn.Close(); } } }