private void dgrdProduct_CurrentCellChanged(object sender, EventArgs e) { int index; if (dgrdProduct.CurrentCell != null) { index = dgrdProduct.CurrentCell.RowIndex; } else { index = 0; } if (index >= 0) { _currentProduct = DrugBaseDataBll.GetProductFormDt(_productInfo.DefaultView.ToTable(), index); ShowCurrentProduct(); } }
private void tsrbtnAdd_Click(object sender, EventArgs e) { try { if (_currentState == NORMAL) { EnableTextBox(true); ClearTextBox(); _currentState = ADD; EnableButton(); _currentProduct = new YP_ProductDic(); this.txtProductName.Focus(); } } catch (Exception error) { MessageBox.Show(error.Message); } }