private void btnNovo_Click(object sender, EventArgs e) { this.comando = "inserir"; frmExamesAreasManter frmAreas = new frmExamesAreasManter(this.comando, 0); frmAreas.ShowDialog(); AtualizarTabela(); }
private void btnEditar_Click(object sender, EventArgs e) { int idArea; this.comando = "editar"; try { idArea = Convert.ToInt32(dgvExamesAreas.CurrentRow.Cells[0].Value); frmExamesAreasManter frmAreas = new frmExamesAreasManter(this.comando, idArea); frmAreas.ShowDialog(); AtualizarTabela(); } catch (Exception) { MessageBox.Show("Selecione um item da tabela"); } }