Example #1
0
        /// <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();
                }
            }
        }
Example #2
0
        /// <summary>
        /// 添加现货交易费用交易手续费
        /// </summary>
        /// <param name="xH_SpotRangeCost">现货交易手续费实体</param>
        /// <param name="cM_FieldRange">字段范围实体</param>
        /// <returns></returns>
        public bool AddXHSpotRangeCost(XH_SpotRangeCost xH_SpotRangeCost, CM_FieldRange cM_FieldRange)
        {
            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();

            int fieldRangeID = AppGlobalVariable.INIT_INT;

            try
            {
                fieldRangeID = cMFieldRangeDAL.Add(cM_FieldRange, Tran, db);

                if (fieldRangeID != AppGlobalVariable.INIT_INT)
                {
                    //xH_SpotRangeCost.FieldRangeID = fieldRangeID;

                    xHSpotRangeCostDAL.Add(xH_SpotRangeCost, Tran, db);

                    Tran.Commit();
                }

                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                LogHelper.WriteError(ex.Message, ex);
                return(false);
            }
            finally
            {
                if (Conn != null && Conn.State == ConnectionState.Open)
                {
                    Conn.Close();
                }
            }
        }