Example #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            BookInformationModel bookInformationModel = db.BookInformation.Find(id);

            db.BookInformation.Remove(bookInformationModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "BookID,BookName,BookIntroduction,BookPrice,BookCoverImage,Bookauthor,BookPublisher,YearReleased,BookForm,BookLanguage,BookAddedDate,BookModifiedDate")] BookInformationModel bookInformationModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bookInformationModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bookInformationModel));
 }
Example #3
0
        // GET: BookInformationModels/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BookInformationModel bookInformationModel = db.BookInformation.Find(id);

            if (bookInformationModel == null)
            {
                return(HttpNotFound());
            }
            return(View(bookInformationModel));
        }