public ActionResult ThemesBook(int id) { var tenloai = new AdminProcess().GetIdCategory(id); ViewBag.TenLoai = tenloai.TenLoai; var result = new BookProcess().ThemeBook(id); return(View(result)); }
//GET : /Book/All : hiển thị tất cả sách trong db public ActionResult ShowAllBook(int?page) { //tạo biến số sản phẩm trên trang int pageSize = 10; //tạo biến số trang int pageNumber = (page ?? 1); var result = new BookProcess().ShowAllBook().ToPagedList(pageNumber, pageSize); return(View(result)); }
public async Task AddProcess(Book book, string userId, int count) { var user = await _applicationContext.Users.FindAsync(userId); var process = new BookProcess { Id = Guid.NewGuid().ToString(), User = user, UserId = user.Id, Book = book, BookId = book.Id, Process = count }; await _applicationContext.BookProcesses.AddAsync(process); await _applicationContext.SaveChangesAsync(); }
//GET : /Book/DidYouSee : hiển thị ra 3 cuốn sách giảm dần theo ngày //Parital View : DidYouSee public ActionResult DidYouSee() { var result = new BookProcess().TakeBook(3); return(PartialView(result)); }
//GET : /Book/Favorite : hiển thị ra 3 cuốn sách bán chạy theo ngày cập nhật (silde trên cùng) //Parital View : FavoriteBook public ActionResult FavoriteBook() { var result = new BookProcess().NewDateBook(3); return(PartialView(result)); }