コード例 #1
0
 private void afterAltera()
 {
     if (bsLoteCustodia.Current != null)
     {
         using (TFLoteCustodia fLote = new TFLoteCustodia())
         {
             fLote.rLote = bsLoteCustodia.Current as CamadaDados.Financeiro.Titulo.TRegistro_LoteCustodia;
             if (fLote.ShowDialog() == DialogResult.OK)
             {
                 if (fLote.rLote != null)
                 {
                     try
                     {
                         CamadaNegocio.Financeiro.Titulo.TCN_LoteCustodia.Gravar(fLote.rLote, null);
                         MessageBox.Show("Lote alterado com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                         this.LimparFiltros();
                         id_lotebusca.Text = fLote.rLote.Id_lote.Value.ToString();
                         this.afterBusca();
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("Necessario selecionar lote para alterar.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #2
0
 private void afterNovo()
 {
     using (TFLoteCustodia fLote = new TFLoteCustodia())
     {
         if (fLote.ShowDialog() == DialogResult.OK)
         {
             if (fLote.rLote != null)
             {
                 try
                 {
                     CamadaNegocio.Financeiro.Titulo.TCN_LoteCustodia.Gravar(fLote.rLote, null);
                     MessageBox.Show("Lote Gravado com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     this.LimparFiltros();
                     id_lotebusca.Text = fLote.rLote.Id_lote.Value.ToString();
                     this.afterBusca();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
         }
     }
 }