Пример #1
0
        public void Deletar(int id)
        {
            try
            {
                var alunoBD = new AlunoDAO();
                alunoBD.DeletarAlunoDB(id);
            }
            catch (Exception ex)
            {
                throw new Exception($"Erro ao deletar aluno: Erro => {ex.Message}");
            }



            //var listaAlunos = ListarAluno();

            //var itemIndex = listaAlunos.FindIndex(p => p.id == id);

            //if(itemIndex >= 0)
            //{
            //    listaAlunos.RemoveAt(itemIndex);
            //}
            //else
            //{
            //    return false;
            //}

            //ReescreverArquivo(listaAlunos);
            //return true;
        }
Пример #2
0
 public void Deletar(int id)
 {
     try
     {
         _alunoDB.DeletarAlunoDB(id);
     }
     catch (Exception e)
     {
         throw new Exception($"Erro: {e.Message}");
     }
 }
 public void DeletarDB(int id)
 {
     try
     {
         var alunoDB = new AlunoDAO();
         alunoDB.DeletarAlunoDB(id);
     }
     catch (Exception ex)
     {
         throw new Exception($"Erro ao deletar aluno: Erro = {ex.Message}");
     }
 }
Пример #4
0
 public void Deletar(int id)
 {
     try
     {
         var alunoBD = new AlunoDAO();
         alunoBD.DeletarAlunoDB(id);
     }
     catch (Exception ex)
     {
         throw new Exception($"Erro ao listar Alunos: Erro => {ex.Message}");
     }
 }