public ActionResult DeleteProfessor(int idProfessor)
        {
            Professor p = professorModel.obterProfessor(idProfessor);

            professorModel.excluirProfessor(p);
            return(RedirectToAction("IndexProfessor", new { idPessoa = p.idPessoa }));
        }
Beispiel #2
0
 public ActionResult DeleteProfessor(int idProfessor)
 {
     if (Roles.IsUserInRole(User.Identity.Name, "Administrador"))
     {
         Professor p = professorModel.obterProfessor(idProfessor);
         professorModel.excluirProfessor(p);
         return(RedirectToAction("IndexProfessor", new { idPessoa = p.idPessoa }));
     }
     return(Redirect("/Shared/Restrito"));
 }