//// GET: Delete Book Details public ActionResult DeleteShelf(int id) { var profileData = this.Session["UserProfile"] as UserSession; if (profileData == null) { return(RedirectToAction("Index", "Home")); } try { ShelfRepository ShelfRepo = new ShelfRepository(); if (ShelfRepo.DeleteShelf(id)) { ViewBag.AlertMsg = "Shelf details deleted successfully"; } LogModel logModel = new LogModel() { UserId = profileData.UserID, TableName = "Shelf", Activity = "Deleted Shelf", LogDate = DateTime.Now }; logRepository logRepository = new logRepository(); logRepository.AddLog(logModel); return(RedirectToAction("GetAllShelfDetails")); } catch { return(RedirectToAction("GetAllShelfDetails")); } }