Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Abwaab abwaab = db.Abwaabs.Find(id);

            db.Abwaabs.Remove(abwaab);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 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));
 }
Пример #3
0
        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));
        }
Пример #4
0
        // 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));
        }
Пример #5
0
        // 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));
        }