//================================  事件 ================================

        #region 交易商品品种管理窗体 BreedClassManagerUI_Load

        /// <summary>
        /// 交易商品品种管理窗体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BreedClassManagerUI_Load(object sender, EventArgs e)
        {
            try
            {
                //绑定交易所类型
                cmbBourseType.Properties.Items.Clear();
                GetBindBourseTypeName();
                cmbBourseType.SelectedIndex = 0;

                //绑定查询条件交易所类型
                //cmbBourseTypeIDQ.Text = "";
                cmbBourseTypeIDQ.Properties.Items.Clear();
                GetBindBourseTypeName();
                //cmbBourseTypeIDQ.SelectedIndex = 0;

                //绑定品种类型
                cmbBreedClassType.Properties.Items.Clear();
                cmbBreedClassType.Properties.Items.AddRange(BindData.GetBindListBreedClassType());
                cmbBreedClassType.SelectedIndex = 0;

                //绑定查询条件品种类型
                //cmbBreedClassTypeIDQ.Text = "";
                cmbBreedClassTypeIDQ.Properties.Items.Clear();
                cmbBreedClassTypeIDQ.Properties.Items.AddRange(BindData.GetBindListBreedClassType());
                //cmbBreedClassTypeIDQ.SelectedIndex = 0;

                //资金账号类型
                cmbAccountTypeIDFund.Properties.Items.Clear();
                cmbAccountTypeIDFund.Properties.Items.AddRange(ComboBoxDataSource.GetAccountTypeList(1));
                cmbAccountTypeIDFund.SelectedIndex = 0;

                //持仓账号类型
                cmbAccountTypeIDHold.Properties.Items.Clear();
                cmbAccountTypeIDHold.Properties.Items.AddRange(ComboBoxDataSource.GetAccountTypeList(2));
                cmbAccountTypeIDHold.SelectedIndex = 0;

                //绑定查询结果
                m_pageNo = 1;
                gdBreedClassResult.DataSource = QueryCMBreedClass();
                ShowDataPage();

                //设置文本框和按钮的状态
                this.txtBreedClassName.Enabled    = false;
                this.cmbAccountTypeIDFund.Enabled = false;
                this.cmbBreedClassType.Enabled    = false;
                this.cmbAccountTypeIDHold.Enabled = false;
                this.cmbBourseType.Enabled        = false;
                this.btnOK.Enabled = false;
            }
            catch (Exception ex)
            {
                string      errCode   = "GL-4000";
                string      errMsg    = "交易商品品种管理窗体加载失败!";
                VTException exception = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(exception.ToString(), exception.InnerException);
            }
        }
        /// <summary>
        /// 根据查询条件,获取交易商品品种
        /// </summary>
        /// <returns></returns>
        private bool QueryCMBreedClass()
        {
            try
            {
                int BourseTypeID     = AppGlobalVariable.INIT_INT;
                int BreedClassTypeID = AppGlobalVariable.INIT_INT;
                if (!string.IsNullOrEmpty(cmbBourseTypeIDQ.Text))
                {
                    BourseTypeID = ((UComboItem)cmbBourseTypeIDQ.SelectedItem).ValueIndex;
                }
                if (!string.IsNullOrEmpty(cmbBreedClassTypeIDQ.Text))
                {
                    BreedClassTypeID = ((UComboItem)cmbBreedClassTypeIDQ.SelectedItem).ValueIndex;
                }
                DataSet _dsCMBreedClass = CommonParameterSetCommon.GetAllCMBreedClass(BreedClassTypeID, BourseTypeID,
                                                                                      m_pageNo,
                                                                                      m_pageSize,
                                                                                      out m_rowCount);
                DataTable _dtCMBreedClass;
                if (_dsCMBreedClass == null || _dsCMBreedClass.Tables[0].Rows.Count == 0)
                {
                    _dtCMBreedClass = new DataTable();
                }
                else
                {
                    _dtCMBreedClass = _dsCMBreedClass.Tables[0];
                }

                //绑定交易商品品种的交易所类型ID对应的交易所名称
                ddlBourseTypeID.DataSource  = CommonParameterSetCommon.GetCMBreedClassBourseTypeName().Tables[0];
                ddlBourseTypeID.ValueMember =
                    CommonParameterSetCommon.GetCMBreedClassBourseTypeName().Tables[0].Columns["BourseTypeID"].
                    ToString();
                ddlBourseTypeID.DisplayMember =
                    CommonParameterSetCommon.GetCMBreedClassBourseTypeName().Tables[0].Columns["BourseTypeName"].
                    ToString();
                //绑定品种类型
                ddlBreedClassTypeID.DataSource    = BindData.GetBindListBreedClassType();
                ddlBreedClassTypeID.ValueMember   = "ValueIndex";
                ddlBreedClassTypeID.DisplayMember = "TextTitleValue";

                //资金账号类型
                ddlAccountTypeIDFund.DataSource    = ComboBoxDataSource.GetAccountTypeList(1);
                ddlAccountTypeIDFund.ValueMember   = "ValueIndex";
                ddlAccountTypeIDFund.DisplayMember = "TextTitleValue";
                //持仓账号类型
                ddlAccountTypeIDHold.DataSource    = ComboBoxDataSource.GetAccountTypeList(2);
                ddlAccountTypeIDHold.ValueMember   = "ValueIndex";
                ddlAccountTypeIDHold.DisplayMember = "TextTitleValue";


                gdBreedClassResult.DataSource = _dtCMBreedClass;
            }
            catch (Exception ex)
            {
                string      errCode   = "GL-4004";
                string      errMsg    = "数据不存在,获取交易商品品种失败!";
                VTException exception = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(exception.ToString(), exception.InnerException);
                //throw exception;
                return(false);
            }
            return(true);
        }