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