public ActionResult Delete(int id) { Tema t = temaModel.obterTema(id); temaModel.excluirTema(t); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { if ((Roles.IsUserInRole(User.Identity.Name, "Administrador")) || (Roles.IsUserInRole(User.Identity.Name, "Professor"))) { Tema t = temaModel.obterTema(id); temaModel.excluirTema(t); return(RedirectToAction("Index")); } return(Redirect("/Shared/Restrito")); }