コード例 #1
0
        public ViewLibraryViewModel ChangeActiveBookPage(ViewLibraryViewModel model, int newPage, string libraryId)
        {
            var allAddedBooksModel = model.AllAddedBooks;

            allAddedBooksModel.CurrentPage = newPage;
            model.AllAddedBooks            = allAddedBooksModel;
            return(this.GetLibraryData(model, libraryId));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public ViewLibraryViewModel PreparedPage(string libraryId)
        {
            ViewLibraryViewModel model = new ViewLibraryViewModel();

            return(this.GetLibraryData(model, libraryId));
        }