public ActionResult DeleteProfessor(int idProfessor) { Professor p = professorModel.obterProfessor(idProfessor); professorModel.excluirProfessor(p); return(RedirectToAction("IndexProfessor", new { idPessoa = p.idPessoa })); }
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")); }