private void txtCode_Leave(object sender, EventArgs e)
        {
            BaseCompositionProductsTable CompositionProductsCode = new BaseCompositionProductsTable();

            CompositionProductsCode = bCompositionProducts.GetModel(txtCode.Text);
            if (CompositionProductsCode != null)
            {
                txtCode.Focus();
                txtCode.Text = "";
                MessageBox.Show("编号已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        /// <summary>
        /// 获得当前选中的数据
        /// </summary>
        private void GetCurrentSelectedTable()
        {
            try
            {
                string ordercode = dgvData.SelectedRows[0].Cells["CODE"].Value.ToString();
                if (ordercode != "")
                {
                    _currentCompositionProductsTable = bCompositionProducts.GetModel(ordercode);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("订单类型中获取当前数据失败!", ex);
            }

            if (_currentCompositionProductsTable == null || _currentCompositionProductsTable.CODE == null || "".Equals(_currentCompositionProductsTable.CODE))
            {
                _currentCompositionProductsTable = null;
            }
        }