public ActionResult DeleteConfirmed(int id) { ClassFourStudent classFourStudent = db.ClassFourStudents.Find(id); db.ClassFourStudents.Remove(classFourStudent); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Roll,Name,Email,Cell")] ClassFourStudent classFourStudent) { if (ModelState.IsValid) { db.Entry(classFourStudent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(classFourStudent)); }
public ActionResult Create([Bind(Include = "ID,Roll,Name,Email,Cell")] ClassFourStudent classFourStudent) { if (ModelState.IsValid) { db.ClassFourStudents.Add(classFourStudent); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(classFourStudent)); }
// GET: ClassFourStudent/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassFourStudent classFourStudent = db.ClassFourStudents.Find(id); if (classFourStudent == null) { return(HttpNotFound()); } return(View(classFourStudent)); }