public IActionResult Delete(RegistroAcademico aluno) { RegistroAcademico alu = RegistroAcademicoRepo.GetRegistroAcademico(aluno.Codigo); if (alu != null) { RegistroAcademicoRepo.Delete(aluno.Codigo); TempData["Message"] = "RegistroAcademico " + alu.Numero_Matricula + " foi removido"; } return(RedirectToAction("Index")); }
public IActionResult Delete(int?id) { if (id == null) { return(BadRequest()); } RegistroAcademico aluno = RegistroAcademicoRepo.GetRegistroAcademico(id.Value); if (aluno == null) { return(NotFound()); } return(View(aluno)); }
public IActionResult Edit(int?id) { if (id == null) { return(BadRequest()); } RegistroAcademico aluno = RegistroAcademicoRepo.GetRegistroAcademico(id.Value); if (aluno == null) { return(NotFound()); } ViewBag.Disciplinas = DisciplinaRepo.ListarDisciplinas(); return(View(aluno)); }