Exemplo n.º 1
0
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     if (dxValidacao.Validate())
     {
         var treinador = (tb_Palestrante)bscTreinador.Current;
         if (Validar(treinador))
         {
             DelegateCRUD.ExecuteAdd(() =>
             {
                 _repositoriotreinador.Adicionar(treinador);
                 XtraMessageBox.Show(Mensagens.SalvoComSucesso);
             });
         }
     }
     else
     {
         XtraMessageBox.Show("Houve erros de validação");
     }
 }
Exemplo n.º 2
0
 //Botão Salvar
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     if (dxValidacao.Validate())
     {
         var empresa = (tb_Empresa)bscEmpresa.Current;
         if (Validar(empresa))
         {
             DelegateCRUD.ExecuteAdd(() =>
             {
                 _repositorioEmpresa.Adicionar(empresa);
                 XtraMessageBox.Show(Mensagens.SalvoComSucesso);
             });
         }
     }
     else
     {
         XtraMessageBox.Show("Houve erros de validação");
     }
 }
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     if (dxValidacao.Validate())
     {
         var funcionario = (tb_Colaborador)bscFuncionario.Current;
         if (Validar(funcionario))
         {
             DelegateCRUD.ExecuteAdd(() =>
             {
                 _repositorioFuncionario.Adicionar(funcionario);
                 XtraMessageBox.Show(Mensagens.SalvoComSucesso);
             });
         }
     }
     else
     {
         XtraMessageBox.Show("Houve erros de validação");
     }
 }