Пример #1
0
 private void afterAltera()
 {
     if (bsFolhaPgto.Current != null)
     {
         if ((bsFolhaPgto.Current as CamadaDados.Financeiro.Folha_Pagamento.TRegistro_FolhaPagamento).St_registro.Trim().ToUpper().Equals("P"))
         {
             MessageBox.Show("Não é permitido alterar lote PROCESSADO.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         using (TFFolhaPgto fFolha = new TFFolhaPgto())
         {
             fFolha.rFolha = bsFolhaPgto.Current as CamadaDados.Financeiro.Folha_Pagamento.TRegistro_FolhaPagamento;
             if (fFolha.ShowDialog() == DialogResult.OK)
             {
                 if (fFolha.rFolha != null)
                 {
                     try
                     {
                         CamadaNegocio.Financeiro.Folha_Pagamento.TCN_FolhaPagamento.Gravar(fFolha.rFolha, null);
                         MessageBox.Show("Folha alterada com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
             }
             this.LimparFiltros();
             id_folha.Text = fFolha.rFolha.Id_folha.Value.ToString();
             this.afterBusca();
         }
     }
 }
Пример #2
0
 private void afterNovo()
 {
     using (TFFolhaPgto fFolha = new TFFolhaPgto())
     {
         if (fFolha.ShowDialog() == DialogResult.OK)
         {
             if (fFolha.rFolha != null)
             {
                 try
                 {
                     CamadaNegocio.Financeiro.Folha_Pagamento.TCN_FolhaPagamento.Gravar(fFolha.rFolha, null);
                     MessageBox.Show("Folha gravada com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     this.LimparFiltros();
                     id_folha.Text = fFolha.rFolha.Id_folha.Value.ToString();
                     this.afterBusca();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
         }
     }
 }