public ActionResult DeleteConfirmed(int id) { basAluno basaluno = db.Alunos.Find(id); db.Alunos.Remove(basaluno); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Aluno/Details/5 public ActionResult Details(int id = 0) { basAluno basaluno = db.Alunos.Find(id); if (basaluno == null) { return(HttpNotFound()); } return(View(basaluno)); }
public ActionResult Edit(basAluno basaluno) { if (ModelState.IsValid) { db.Entry(basaluno).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.matriculaInstituicaoID = new SelectList(db.Instituicoes, "matriculaInstituicaoID", "senha", basaluno.matriculaInstituicaoID); ViewBag.DisciplinaID = new SelectList(db.Disciplinas, "DisciplinaID", "nomeDisciplina", basaluno.DisciplinaID); return(View(basaluno)); }
// // GET: /Aluno/Edit/5 public ActionResult Edit(int id = 0) { basAluno basaluno = db.Alunos.Find(id); if (basaluno == null) { return(HttpNotFound()); } ViewBag.matriculaInstituicaoID = new SelectList(db.Instituicoes, "matriculaInstituicaoID", "senha", basaluno.matriculaInstituicaoID); ViewBag.DisciplinaID = new SelectList(db.Disciplinas, "DisciplinaID", "nomeDisciplina", basaluno.DisciplinaID); return(View(basaluno)); }