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