public ActionResult DeleteConfirmed(int id) { Lecturers lecturers = db.Lecturers.Find(id); db.Lecturers.Remove(lecturers); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,First_Name,Last_Name")] Lecturers lecturers) { if (ModelState.IsValid) { db.Entry(lecturers).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lecturers)); }
public ActionResult Create([Bind(Include = "Id,First_Name,Last_Name")] Lecturers lecturers) { if (ModelState.IsValid) { db.Lecturers.Add(lecturers); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lecturers)); }
// GET: Lecturers/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Lecturers lecturers = db.Lecturers.Find(id); if (lecturers == null) { return(HttpNotFound()); } return(View(lecturers)); }