private void dgrdSupport_CurrentCellChanged(object sender, EventArgs e) { int index; if (dgrdSupport.CurrentCell != null) { index = dgrdSupport.CurrentCell.RowIndex; } else { index = 0; } _currentSupport = DrugBaseDataBll.GetSupportFormDt(_supportInfo.DefaultView.ToTable(), index); ShowCurrentSupport(); }
private void tsrbtnAdd_Click(object sender, EventArgs e) { try { if (_currentState == NORMAL) { EnableTextBox(true); ClearTextBox(); _currentState = ADD; EnableButton(); _currentSupport = new YP_SupportDic(); this.txtSupportName.Focus(); } } catch (Exception error) { MessageBox.Show(error.Message); } }