public ActionResult DeleteConfirmed(int id) { Abwaab abwaab = db.Abwaabs.Find(id); db.Abwaabs.Remove(abwaab); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BaabId,BaabName,BaabNumber,BookId,BaabPage")] Abwaab abwaab) { if (ModelState.IsValid) { db.Entry(abwaab).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BookId = new SelectList(db.Books, "BookId", "BookName", abwaab.BookId); return(View(abwaab)); }
public ActionResult Create([Bind(Include = "BaabId,BaabName,BaabNumber,BookId,BaabPage")] Abwaab abwaab) { if (ModelState.IsValid) { db.Abwaabs.Add(abwaab); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BookId = new SelectList(db.Books, "BookId", "BookName", abwaab.BookId); return(View(abwaab)); }
// GET: Abwaabs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Abwaab abwaab = db.Abwaabs.Find(id); if (abwaab == null) { return(HttpNotFound()); } return(View(abwaab)); }
// GET: Abwaabs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Abwaab abwaab = db.Abwaabs.Find(id); if (abwaab == null) { return(HttpNotFound()); } ViewBag.BookId = new SelectList(db.Books, "BookId", "BookName", abwaab.BookId); return(View(abwaab)); }