Example #1
0
        /// <summary>
        /// 根据品种ID,字段范围ID,删除交易手续费_范围_值
        /// </summary>
        /// <param name="BreedClassID">品种ID</param>
        /// <param name="FieldRangeID">字段范围ID</param>
        /// <returns></returns>
        public bool DeleteSpotRangeCost(int BreedClassID, int FieldRangeID)
        {
            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
            {
                xHSpotRangeCostDAL.Delete(BreedClassID, FieldRangeID, Tran, db);
                cMFieldRangeDAL.Delete(FieldRangeID, 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>
        /// 根据品种ID,字段范围ID,删除最小变动价位_范围_值
        /// </summary>
        /// <param name="BreedClassID">品种ID</param>
        /// <param name="FieldRangeID">字段范围ID</param>
        /// <returns></returns>
        public bool DeleteMinChangePriceValue(int BreedClassID, int FieldRangeID)
        {
            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
            {
                xHMinChangePriceValueDAL.Delete(BreedClassID, FieldRangeID, Tran, db);
                cMFieldRangeDAL.Delete(FieldRangeID, Tran, db);
                Tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                string      errCode   = "GL-5321";
                string      errMsg    = "根据品种ID,字段范围ID,删除最小变动价位_范围_值失败!";
                VTException exception = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(exception.ToString(), exception.InnerException);
                return(false);
            }
            finally
            {
                if (Conn.State == ConnectionState.Open)
                {
                    Conn.Close();
                }
            }
        }