Ejemplo n.º 1
0
 private void btnAlterar_Click(object sender, EventArgs e)
 {
     try
     {
         btnAlterar.Click -= new EventHandler(btnAlterar_Click);
         TipoPagamento tipoPagamentoSelecionado = dgwColecao.GetlinhaSelecionado <TipoPagamento>();
         if (tipoPagamentoSelecionado == null)
         {
             ExibirMensagem("Nenhum pagamento foi selecionado!");
             return;
         }
         using (MOD001.FRM029 frm029 = new FRM029(tipoPagamentoSelecionado, Acao.ALTERAR))
         {
             if (frm029.ShowDialog() == DialogResult.OK)
             {
                 this.tipoPagamento = frm029.tipoPagamento;
                 AtualizarGrid(this.tipoPagamento, false);
             }
         }
     }
     catch (Exception ex)
     {
         Exceptionerro(ex);
     }
     finally
     {
         btnAlterar.Click += new EventHandler(btnAlterar_Click);
     }
 }
Ejemplo n.º 2
0
 private void btnInserir_Click(object sender, EventArgs e)
 {
     try
     {
         btnInserir.Click -= new EventHandler(btnInserir_Click);
         using (MOD001.FRM029 frm029 = new FRM029(null, Acao.INSERIR))
         {
             if (frm029.ShowDialog() == DialogResult.OK)
             {
                 this.tipoPagamento = frm029.tipoPagamento;
                 AtualizarGrid(this.tipoPagamento, false);
             }
         }
     }
     catch (Exception ex)
     {
         Exceptionerro(ex);
     }
     finally
     {
         btnInserir.Click += new EventHandler(btnInserir_Click);
     }
 }