예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Book book = bookClient.FindBook(id);

            bookClient.DeleteBook(id);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        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());
            }
        }
예제 #3
0
 public ActionResult Delete(int id, Book book)
 {
     try
     {
         // TODO: Add delete logic here
         bookClient.DeleteBook(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #4
0
 public ActionResult Delete(int id)
 {
     bsc.DeleteBook(id);
     return(RedirectToAction("Index", "Book"));
 }
 public string DeleteBookClient(int id)
 {
     return(client.DeleteBook(Convert.ToString(id)));
 }