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