public ActionResult DeleteConfirmed(string id) { SchoolTeacher schoolteacher = db.SchoolTeachers.Find(id); db.SchoolTeachers.Remove(schoolteacher); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SchoolDesc,FirstName,LastName,SchoolId,RoleId,UserEmail,UserId")] SchoolTeacher schoolteacher) { if (ModelState.IsValid) { db.Entry(schoolteacher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(schoolteacher)); }
public ActionResult Create([Bind(Include = "SchoolDesc,FirstName,LastName,SchoolId,RoleId,UserEmail,UserId")] SchoolTeacher schoolteacher) { if (ModelState.IsValid) { db.SchoolTeachers.Add(schoolteacher); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(schoolteacher)); }
// GET: /SchoolAdminView/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SchoolTeacher schoolteacher = db.SchoolTeachers.Find(id); if (schoolteacher == null) { return(HttpNotFound()); } return(View(schoolteacher)); }