public ActionResult DeleteConfirmed(int id) { basProfessor basprofessor = db.Professores.Find(id); db.Professores.Remove(basprofessor); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Professor/Details/5 public ActionResult Details(int id = 0) { basProfessor basprofessor = db.Professores.Find(id); if (basprofessor == null) { return(HttpNotFound()); } return(View(basprofessor)); }
// // GET: /RelForum/Edit/5 public ActionResult Edit(int id = 0) { basProfessor basprofessor = db.Professores.Find(id); if (basprofessor == null) { return(HttpNotFound()); } ViewBag.DisciplinaID = new SelectList(db.Disciplinas, "DisciplinaID", "nomeDisciplina", basprofessor.DisciplinaID); return(View(basprofessor)); }
public ActionResult Edit(basProfessor basprofessor) { if (ModelState.IsValid) { db.Entry(basprofessor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DisciplinaID = new SelectList(db.Disciplinas, "DisciplinaID", "nomeDisciplina", basprofessor.DisciplinaID); return(View(basprofessor)); }
public ActionResult Create(basProfessor basprofessor) { if (ModelState.IsValid) { db.Professores.Add(basprofessor); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DisciplinaID = new SelectList(db.Disciplinas, "DisciplinaID", "nomeDisciplina", basprofessor.DisciplinaID); return(View(basprofessor)); }