コード例 #1
0
        /// <summary>
        /// 修改股指期货持仓限制和品种_股指期货_保证金数据
        /// </summary>
        /// <param name="qHSIFPosition">股指期货持仓限制实体</param>
        /// <param name="qHSIFBail">品种_股指期货_保证金实体</param>
        /// <returns></returns>
        public static bool UpdateQHSIFPositionAndQHSIFBail(ManagementCenter.Model.QH_SIFPosition qHSIFPosition,
                                                           ManagementCenter.Model.QH_SIFBail qHSIFBail)
        {
            QH_SIFPositionBLL qH_SIFPositionBLL = new QH_SIFPositionBLL();

            return(qH_SIFPositionBLL.UpdateQHSIFPositionAndQHSIFBail(qHSIFPosition, qHSIFBail));
        }
コード例 #2
0
 /// <summary>
 /// 根据品种标识返回品种_股指期货_保证金
 /// </summary>
 /// <param name="breedClassID">品种标识</param>
 /// <returns></returns>
 public Entity.QH_SIFBail GetSIFBailByBreedClassID(int breedClassID)
 {
     try
     {
         LogHelper.WriteDebug("Debug-8516根据品种标识返回品种_股指期货_保证金方法名称:GetSIFBailByBreedClassID(int breedClassID)参数是:" + breedClassID + "时间是:" + DateTime.Now);
         QH_SIFBailBLL            qH_SIFBailBLL  = new QH_SIFBailBLL();
         List <Entity.QH_SIFBail> qH_SIFBailList =
             qH_SIFBailBLL.GetListArray(string.Format("BreedClassID={0}", breedClassID));
         if (qH_SIFBailList.Count > 0)
         {
             Entity.QH_SIFBail qH_SIFBail = qH_SIFBailList[0];
             if (qH_SIFBail != null)
             {
                 return(qH_SIFBail);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         string      errCode = "GL-8516";
         string      errMsg  = "根据品种标识返回品种_股指期货_保证金失败";
         VTException vte     = new VTException(errCode, errMsg, ex);
         LogHelper.WriteError(vte.ToString(), vte.InnerException);
         return(null);
     }
 }
コード例 #3
0
 /// <summary>
 /// 更新品种_股指期货_保证金
 /// </summary>
 /// <param name="model">品种_股指期货_保证金实体</param>
 public void Update(ManagementCenter.Model.QH_SIFBail model)
 {
     try
     {
         qH_SIFBailDAL.Update(model);
     }
     catch (Exception ex)
     {
         string      errCode   = "GL-6641";
         string      errMsg    = "更新品种_股指期货_保证金失败!";
         VTException exception = new VTException(errCode, errMsg, ex);
         LogHelper.WriteError(exception.ToString(), exception.InnerException);
         return;
     }
 }
コード例 #4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        //public void Add(ManagementCenter.Model.QH_SIFPosition model)
        //{
        //    qH_SIFPositionDAL.Add(model);
        //}

        #region 添加股指期货持仓限制和品种_股指期货_保证金数据

        /// <summary>
        /// 添加股指期货持仓限制和品种_股指期货_保证金数据
        /// </summary>
        /// <param name="qHSIFPosition">股指期货持仓限制实体</param>
        /// <param name="qHSIFBail">品种_股指期货_保证金实体</param>
        /// <returns></returns>
        public bool AddQHSIFPositionAndQHSIFBail(ManagementCenter.Model.QH_SIFPosition qHSIFPosition,
                                                 ManagementCenter.Model.QH_SIFBail qHSIFBail)
        {
            QH_SIFBailDAL     qHSIFBailDAL     = new QH_SIFBailDAL();
            QH_SIFPositionDAL qHSIFPositionDAL = new QH_SIFPositionDAL();
            DbConnection      Conn             = null;
            Database          db = DatabaseFactory.CreateDatabase();

            Conn = db.CreateConnection();
            if (Conn.State != ConnectionState.Open)
            {
                Conn.Open();
            }
            DbTransaction Tran = Conn.BeginTransaction();

            try
            {
                qHSIFPositionDAL.Add(qHSIFPosition, Tran, db);
                qHSIFBailDAL.Add(qHSIFBail, Tran, db);
                Tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                string      errCode   = "GL-6660";
                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();
                }
            }
        }