public ActionResult Delete(int id) { BTGPModel del = db.Cyrsach.Find(id); if (del == null) { return(HttpNotFound()); } return(View(del)); }
public ActionResult DeleteS(int id) { BTGPModel s = new BTGPModel { Id = id }; db.Entry(s).State = EntityState.Deleted; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { BTGPModel b = db.Cyrsach.Find(id); if (b == null) { return(HttpNotFound()); } db.Cyrsach.Remove(b); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int?id) { if (id == null) { return(HttpNotFound()); } BTGPModel student = db.Cyrsach.Find(id); if (student != null) { return(View(student)); } return(RedirectToAction("Index")); }
public ActionResult Add(BTGPModel student) { db.Entry(student).State = EntityState.Added; db.SaveChanges(); return(RedirectToAction("Index")); }