public ActionResult DeleteAuthorConfirmed(int id) { AuthorsTBL selectedAuthor = _context.AuthorsTBLs.Find(id); _context.AuthorsTBLs.Remove(selectedAuthor); _context.SaveChanges(); return(RedirectToAction("AuthorList")); }
//-----------------------------New Quote Add Alert Page---------------------------- public ActionResult NewAuthorSuccess(AuthorsTBL newAuthorObj) { ViewBag.AlertAuthorName = newAuthorObj.AuthorName; ViewBag.AlertImagePath = newAuthorObj.AuthorImage; return(View()); }
//-----------------------------------------------------Delete Author-------------------------------- // GET: Author/Delete public ActionResult DeleteAuthor(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AuthorsTBL selectedAuthor = _context.AuthorsTBLs.Find(id); if (selectedAuthor == null) { return(HttpNotFound()); } return(View(selectedAuthor)); }