Esempio n. 1
0
 private void txtCode_Leave(object sender, EventArgs e)
 {
     //判断编号是否已存在
     if (!string.IsNullOrEmpty(txtCode.Text.Trim()))
     {
         BaseCustomerTable CustomerCode = new BaseCustomerTable();
         CustomerCode = bmaterial.GetModel(txtCode.Text);
         if (CustomerCode != null)
         {
             txtCode.Focus();
             txtCode.Text = "";
             MessageBox.Show("编号已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 获得当前选中的数据
        /// </summary>
        private void GetCurrentSelectedTable()
        {
            try
            {
                string code = dgvData.SelectedRows[0].Cells[0].Value.ToString();
                if (code != "")
                {
                    _currentCustomerTable = bMaterial.GetModel(code);
                }
            }
            catch (Exception ex) { }

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