/// <summary>
        /// 添加或修改(商品)期货持仓限制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                QH_PositionLimitValue qH_PositionLimitValue = new QH_PositionLimitValue();

                if (!string.IsNullOrEmpty(this.cmbBreedClassID.Text))
                {
                    qH_PositionLimitValue.BreedClassID = ((UComboItem)this.cmbBreedClassID.SelectedItem).ValueIndex;
                }
                else
                {
                    ShowMessageBox.ShowInformation("请选择品种!");
                    this.cmbBreedClassID.Focus();
                    return;
                }
                if (!string.IsNullOrEmpty(this.txtStart.Text) && !string.IsNullOrEmpty(this.txtEnds.Text))
                {
                    if (InputTest.zeroStartIntTest(this.txtStart.Text) && InputTest.intTest(this.txtEnds.Text))
                    {
                        if (Convert.ToInt32(this.txtStart.Text) < Convert.ToInt32(this.txtEnds.Text))
                        {
                            qH_PositionLimitValue.Start = Convert.ToInt32(this.txtStart.Text);
                        }
                        else
                        {
                            ShowMessageBox.ShowInformation("起始值不能大于或等于结束值!");
                            this.txtStart.Focus();
                            return;
                        }
                        if (Convert.ToInt32(this.txtEnds.Text) > Convert.ToInt32(this.txtStart.Text))
                        {
                            qH_PositionLimitValue.Ends = Convert.ToInt32(this.txtEnds.Text);
                        }
                        else
                        {
                            ShowMessageBox.ShowInformation("结束值不能小于或等于起始值!");
                            this.txtEnds.Focus();
                            return;
                        }
                    }
                    else
                    {
                        ShowMessageBox.ShowInformation("请输入数字!");
                        this.txtStart.Focus();
                        this.txtEnds.Focus();
                        return;
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(this.txtStart.Text) && string.IsNullOrEmpty(this.txtEnds.Text))
                    {
                        ShowMessageBox.ShowInformation("范围值不能为空!");
                        this.txtStart.Focus();
                        return;
                    }
                    if (!string.IsNullOrEmpty(this.txtStart.Text))
                    {
                        if (InputTest.zeroStartIntTest(this.txtStart.Text))
                        {
                            qH_PositionLimitValue.Start = Convert.ToInt32(this.txtStart.Text);
                        }
                        else
                        {
                            ShowMessageBox.ShowInformation("请输入数字!");
                            this.txtStart.Focus();
                            return;
                        }
                    }
                    if (!string.IsNullOrEmpty(this.txtEnds.Text))
                    {
                        if (InputTest.intTest(this.txtEnds.Text))
                        {
                            qH_PositionLimitValue.Ends = Convert.ToInt32(this.txtEnds.Text);
                        }
                        else
                        {
                            ShowMessageBox.ShowInformation("请输入数字!");
                            this.txtEnds.Focus();
                            return;
                        }
                    }
                }
                if (!string.IsNullOrEmpty(this.txtPositionValue.Text))
                {
                    if (InputTest.DecimalTest(this.txtPositionValue.Text))
                    {
                        qH_PositionLimitValue.PositionValue = Convert.ToDecimal(this.txtPositionValue.Text);
                    }
                    else
                    {
                        ShowMessageBox.ShowInformation("请输入数字!");
                        this.txtPositionValue.Focus();
                        return;
                    }
                }
                else
                {
                    ShowMessageBox.ShowInformation("请输入持仓!");
                    this.txtPositionValue.Focus();
                    return;
                }

                if (!string.IsNullOrEmpty(this.cmbDeliveryMonthTypeID.Text))
                {
                    qH_PositionLimitValue.DeliveryMonthType = ((UComboItem)this.cmbDeliveryMonthTypeID.SelectedItem).ValueIndex;
                }
                else
                {
                    qH_PositionLimitValue.DeliveryMonthType = AppGlobalVariable.INIT_INT;
                }
                if (checkBox2.Checked)
                {
                    qH_PositionLimitValue.LowerLimitIfEquation = (int)GTA.VTS.Common.CommonObject.Types.IsYesOrNo.Yes;
                }
                else
                {
                    qH_PositionLimitValue.LowerLimitIfEquation = (int)GTA.VTS.Common.CommonObject.Types.IsYesOrNo.No;
                }
                if (checkBox3.Checked)
                {
                    qH_PositionLimitValue.UpperLimitIfEquation = (int)GTA.VTS.Common.CommonObject.Types.IsYesOrNo.Yes;
                }
                else
                {
                    qH_PositionLimitValue.UpperLimitIfEquation = (int)GTA.VTS.Common.CommonObject.Types.IsYesOrNo.No;
                }

                if (!string.IsNullOrEmpty(this.cmbPositionBailTypeID.Text))
                {
                    qH_PositionLimitValue.PositionBailTypeID = ((UComboItem)this.cmbPositionBailTypeID.SelectedItem).ValueIndex;
                }
                if (radioButton1.Checked)
                {
                    qH_PositionLimitValue.PositionValueTypeID = (int)GTA.VTS.Common.CommonObject.Types.QHPositionValueType.Positions;
                }
                if (radioButton2.Checked)
                {
                    qH_PositionLimitValue.PositionValueTypeID = (int)GTA.VTS.Common.CommonObject.Types.QHPositionValueType.Scales;
                }
                //if (!string.IsNullOrEmpty(this.cmbPositionValueTypeID.Text))
                //{
                //    qH_PositionLimitValue.PositionValueTypeID = ((UComboItem)this.cmbPositionValueTypeID.SelectedItem).ValueIndex;
                //}
                //else
                //{
                //    qH_PositionLimitValue.PositionValueTypeID = AppGlobalVariable.INIT_INT;
                //}
                //if (!string.IsNullOrEmpty(this.cmbPositionLimitType.Text))
                //{
                //    qH_PositionLimitValue.PositionLimitType = ((UComboItem)this.cmbPositionLimitType.SelectedItem).ValueIndex;
                //}
                if (checkBox1.Checked)
                {
                    int minUnit;
                    int.TryParse(txtMinUnit.Text, out minUnit);
                    if (string.IsNullOrEmpty(txtMinUnit.Text) || minUnit == 0)
                    {
                        ShowMessageBox.ShowInformation("请输入最小交割单位!");
                        this.txtMinUnit.Focus();
                        return;
                    }
                    qH_PositionLimitValue.MinUnitLimit = Convert.ToInt32(txtMinUnit.Text);
                }
                else
                {
                    qH_PositionLimitValue.MinUnitLimit = null;
                }

                if (EditType == (int)UITypes.EditTypeEnum.AddUI)
                {
                    int result = FuturesManageCommon.AddQHPositionLimitValue(qH_PositionLimitValue);
                    if (result != AppGlobalVariable.INIT_INT)
                    {
                        FireSaved(this, new EventArgs());
                        ShowMessageBox.ShowInformation("添加成功!");
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        ShowMessageBox.ShowInformation("添加失败!");
                    }
                }
                else if (EditType == (int)UITypes.EditTypeEnum.UpdateUI)
                {
                    if (m_PositionLimitValueID != AppGlobalVariable.INIT_INT)
                    {
                        qH_PositionLimitValue.PositionLimitValueID = m_PositionLimitValueID;
                    }
                    m_Result = FuturesManageCommon.UpdateQHPositionLimitValue(qH_PositionLimitValue);
                    if (m_Result)
                    {
                        ShowMessageBox.ShowInformation("修改成功!");
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        ShowMessageBox.ShowInformation("修改失败!");
                    }
                }
            }
            catch (Exception ex)
            {
                string      errCode   = "GL-6422";
                string      errMsg    = "添加或修改(商品)期货持仓限制失败!";
                VTException exception = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(exception.ToString(), exception.InnerException);
                return;
            }
        }