Пример #1
0
        public ActionResult Index(int page = 1)
        {
            ViewBag.listLoaiSanPham = _lspService.LayTatCa();
            int pageSize      = 10;
            int totalRow      = 0;
            var list          = _spService.LayTatCaPhanTrang(page, pageSize, out totalRow);
            int totalPage     = (int)Math.Ceiling((double)totalRow / pageSize);
            var paginationSet = new PaginationSet <SanPham>()
            {
                Items      = list,
                MaxPage    = 5,
                PageIndex  = page,
                TotalCount = totalRow,
                TotalPages = totalPage,
                Count      = list.Count()
            };

            return(View("Index", paginationSet));
        }
Пример #2
0
        // GET: Admin/LoaiSanPham
        public ActionResult Index()
        {
            IEnumerable <LoaiSanPham> DanhSachLoaiSanPham = _lspService.LayTatCa();

            return(View(DanhSachLoaiSanPham));
        }