// GET: Update Book Details public ActionResult EditShelfDetails(int id) { var profileData = this.Session["UserProfile"] as UserSession; if (profileData == null) { return(RedirectToAction("Index", "Home")); } ShelfRepository ShelfRepo = new ShelfRepository(); return(View(ShelfRepo.GetAllShelf().Find(Shelf => Shelf.ShelfId == id))); }
//GET: All Book Details public ActionResult GetAllShelfDetails() { var profileData = Session["UserProfile"] as UserSession; if (profileData == null) { return(RedirectToAction("Index", "Home")); } ShelfRepository ShelfRepo = new ShelfRepository(); ModelState.Clear(); return(View(ShelfRepo.GetAllShelf())); }
public ActionResult AddCopies(int id) { var profileData = Session["UserProfile"] as UserSession; if (profileData == null) { return(RedirectToAction("Index", "Home")); } BookRepository bookRepository = new BookRepository(); ShelfRepository shelfRepository = new ShelfRepository(); BookCopies bookCopies = new BookCopies(); BookModel bookModel = bookRepository.SearchBookById(id); bookCopies.BookModel = bookModel; List <ShelfModel> shelfList = shelfRepository.GetAllShelf(); bookCopies.ShelfList = shelfList; return(View(bookCopies)); }