public ViewLibraryViewModel ChangeActiveBookPage(ViewLibraryViewModel model, int newPage, string libraryId) { var allAddedBooksModel = model.AllAddedBooks; allAddedBooksModel.CurrentPage = newPage; model.AllAddedBooks = allAddedBooksModel; return(this.GetLibraryData(model, libraryId)); }
public IActionResult SearchBookAtLibrary(ViewLibraryViewModel model) { this.StartUp(); var libraryId = this.TempData["viewLibraryId"].ToString(); var returnModel = this.viewLibraryService.GetLibraryData(model, libraryId); this.TempData["viewLibraryId"] = libraryId; return(this.View("Index", returnModel)); }
public IActionResult ChangeActiveBookPage(ViewLibraryViewModel model, int id) { this.StartUp(); var libraryId = this.TempData["viewLibraryId"].ToString(); var returnModel = this.viewLibraryService.ChangeActiveBookPage(model, id, libraryId); this.TempData["viewLibraryId"] = libraryId; return(this.View("Index", returnModel)); }
public ViewLibraryViewModel GetLibraryData(ViewLibraryViewModel model, string libraryId) { var library = this.context.Users.FirstOrDefault(u => u.Id == libraryId); var allAddedBooksModel = model.AllAddedBooks; var allAddedBooks = this.allAddedBooksService.GetBooks(allAddedBooksModel, libraryId); var returnModel = new ViewLibraryViewModel() { Avatar = library.Avatar, Email = library.Email, Location = library.LastName, Name = library.FirstName, AllAddedBooks = allAddedBooks, }; return(returnModel); }
public ViewLibraryViewModel PreparedPage(string libraryId) { ViewLibraryViewModel model = new ViewLibraryViewModel(); return(this.GetLibraryData(model, libraryId)); }