public ActionResult DeleteConfirmed(int id) { Book book = bookClient.FindBook(id); bookClient.DeleteBook(id); return(RedirectToAction("Index")); }
public ActionResult DeleteBook(int?id, Book b) { try { Book book = new Book(); if (ModelState.IsValid) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } book = db.Find(id); if (book == null) { return(HttpNotFound()); } db.DeleteBook(book.BookId); return(RedirectToAction("Index")); } return(View(book)); } catch { return(View()); } }
public ActionResult Delete(int id, Book book) { try { // TODO: Add delete logic here bookClient.DeleteBook(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id) { bsc.DeleteBook(id); return(RedirectToAction("Index", "Book")); }
public string DeleteBookClient(int id) { return(client.DeleteBook(Convert.ToString(id))); }