public ActionResult DeleteConfirmed(int id) { Collegian collegian = db.Collegians.Find(id); db.Collegians.Remove(collegian); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "CollegianId,UniversityId,FirstName,LastName,StudentId,Phone,CellPhone,Address,LoginId,EMail")] Collegian collegian) { if (ModelState.IsValid) { db.Entry(collegian).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Home")); } return(View(collegian)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Collegian collegian = db.Collegians.Find(id); if (collegian == null) { return(HttpNotFound()); } return(View(collegian)); }