Exemple #1
0
        public ActionResult Excluir(string alunoId)
        {
            var aluno = AlunoDao.BuscaPorId(Convert.ToInt32(alunoId));

            try
            {
                var alunoDao = new AlunoDao();
                alunoDao.ExcluirId(Int32.Parse(alunoId));
                return(RedirectToAction("Form", "Aluno", new { @professorId = aluno.ProfessorId.ToString() }));
            }
            catch (Exception e)
            {
                TempData["mensagem"] = e.Message;
                return(RedirectToAction("Form", "Aluno", new { @professorId = aluno.ProfessorId.ToString() }));
            }
        }