public ActionResult DeleteConfirmed(string id) { BookInformationModel bookInformationModel = db.BookInformation.Find(id); db.BookInformation.Remove(bookInformationModel); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }