private void btnAlterar_Click(object sender, EventArgs e) { try { btnAlterar.Click -= new EventHandler(btnAlterar_Click); ContasPagarTipo contasPagarTipoSel = dgwColecao.GetlinhaSelecionado <ContasPagarTipo>(); if (contasPagarTipoSel == null) { return; } using (MOD001.FRM031 frm031 = new FRM031(contasPagarTipoSel, Acao.ALTERAR)) { if (frm031.ShowDialog() == DialogResult.OK) { AtualizarGrid(frm031.contasPagarTipo, false); } } } catch (Exception ex) { Exceptionerro(ex); } finally { btnAlterar.Click += new EventHandler(btnAlterar_Click); } }
private void btnInserir_Click(object sender, EventArgs e) { try { btnInserir.Click -= new EventHandler(btnInserir_Click); using (MOD001.FRM031 frm031 = new FRM031(new ContasPagarTipo(), Acao.INSERIR)) { if (frm031.ShowDialog() == DialogResult.OK) { AtualizarGrid(frm031.contasPagarTipo, false); } } } catch (Exception ex) { Exceptionerro(ex); } finally { btnInserir.Click += new EventHandler(btnInserir_Click); } }