/// <summary>
        /// 获取需要更新的商品期货_保证金比例的实体
        /// </summary>
        /// <param name="handle">行号</param>
        private void UpdateQHCFBailScaleValue(int handle)
        {
            try
            {
                if (handle < 0)
                {
                    return;
                }
                //显示添加 商品期货_保证金比例窗体
                AddCFBailScaleValueUI addCFBailScaleValueUI = new AddCFBailScaleValueUI();
                addCFBailScaleValueUI.EditType = (int)UITypes.EditTypeEnum.UpdateUI;
                DataRow             _dr = this.gdCFBailScaleValueSelect.GetDataRow(handle);
                int                 cFBailScaleValueID  = Convert.ToInt32(_dr["CFBailScaleValueID"]);
                QH_CFBailScaleValue qH_CFBailScaleValue = FuturesManageCommon.GetQHCFBailScaleValueModel(cFBailScaleValueID);
                addCFBailScaleValueUI.QHCFBailScaleValue = qH_CFBailScaleValue;

                if (addCFBailScaleValueUI.ShowDialog(this) == DialogResult.OK)
                {
                    this.QueryQHCFBailScaleValue();
                    this.gdCFBailScaleValueSelect.FocusedRowHandle = handle;
                }
            }
            catch (Exception ex)
            {
                string      errCode   = "GL-6443";
                string      errMsg    = "获取需要更新的商品期货_保证金比例的实体失败!";
                VTException exception = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(exception.ToString(), exception.InnerException);
                return;
            }
        }
        /// <summary>
        /// 删除商品期货_保证金比例
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (ShowMessageBox.ShowQuestion("确认删除吗?") == DialogResult.No)
                {
                    return;
                }

                DataRow _dr = this.gdCFBailScaleValueSelect.GetDataRow(this.gdCFBailScaleValueSelect.FocusedRowHandle);
                if (_dr == null)
                {
                    ShowMessageBox.ShowInformation("请选择数据!");
                    return;
                }

                if (!string.IsNullOrEmpty(Convert.ToString(_dr["CFBailScaleValueID"])))
                {
                    m_CFBailScaleValueID = Convert.ToInt32(_dr["CFBailScaleValueID"]);
                }
                else
                {
                    m_CFBailScaleValueID = AppGlobalVariable.INIT_INT;
                }

                if (m_CFBailScaleValueID != AppGlobalVariable.INIT_INT)
                {
                    QH_CFBailScaleValue qH_CFBailScaleVal = FuturesManageCommon.GetQHCFBailScaleValueModel(m_CFBailScaleValueID);
                    //当子ID的数据存在时,则删除子数据,无论子数据是否删除成功,都继续执行删除当前的记录
                    if (qH_CFBailScaleVal.RelationScaleID != AppGlobalVariable.INIT_INT ||
                        string.IsNullOrEmpty(qH_CFBailScaleVal.RelationScaleID.Value.ToString()))
                    {
                        FuturesManageCommon.DeleteQHCFBailScaleValue(Convert.ToInt32(qH_CFBailScaleVal.RelationScaleID));
                    }
                    m_Result = FuturesManageCommon.DeleteQHCFBailScaleValue(m_CFBailScaleValueID);
                }

                if (m_Result)
                {
                    ShowMessageBox.ShowInformation("删除成功!");
                    m_CFBailScaleValueID = AppGlobalVariable.INIT_INT;
                }
                else
                {
                    ShowMessageBox.ShowInformation("删除失败!");
                }
                this.QueryQHCFBailScaleValue();
            }
            catch (Exception ex)
            {
                string      errCode   = "GL-6446";
                string      errMsg    = "删除商品期货_保证金比例失败!";
                VTException exception = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(exception.ToString(), exception.InnerException);
                return;
            }
        }
        /// <summary>
        /// 绑定保证金关系表数据
        /// </summary>
        /// <param name="id"></param>
        private void BindRelationValues(int id)
        {
            QH_CFBailScaleValue model = FuturesManageCommon.GetQHCFBailScaleValueModel(id);

            if (model != null)
            {
                chkLastTrDay.Checked = true;
                //if (model.LowerLimitIfEquation.Value == (int)GTA.VTS.Common.CommonObject.Types.IsYesOrNo.Yes)
                //{
                //    //checkBox4.Checked = true;
                //}
                //else
                //{
                //    //checkBox4.Checked = false;
                //}
                if (model.UpperLimitIfEquation.Value == (int)GTA.VTS.Common.CommonObject.Types.IsYesOrNo.Yes)
                {
                    checkBox5.Checked = true;
                }
                else
                {
                    checkBox5.Checked = false;
                }
                //if (model.Start != null)
                //{
                //    //txtStart2.Text = model.Start.Value.ToString();
                //}
                if (model.Ends != null)
                {
                    txtEnds2.Text = model.Ends.Value.ToString();
                }
                if (model.BailScale != null)
                {
                    txtBailScale2.Text = model.BailScale.Value.ToString();
                }
                m_CFBailScaleValueID2 = Convert.ToInt32(model.CFBailScaleValueID);
            }
        }