コード例 #1
0
        public IActionResult BrandAndSort(string mahang, string sortorder, int?pagenumber)
        {
            pageNumber = pagenumber ?? 1;
            SanPhamBUS     sanphambus = new SanPhamBUS();
            List <SanPham> list       = sanphambus.BrandAndSort(mahang, sortorder, pageSize, pageNumber);
            List <SanPham> tong       = sanphambus.BrandAndSort(mahang, sortorder, pageSize);

            ViewBag.TrangHienTai = pageNumber;
            ViewBag.TongTrang    = TongTrang(tong);
            ViewBag.TrangThai    = "brandandsort";
            ViewBag.ThuongHieu   = mahang;
            ViewBag.Sort         = sortorder;
            List <HangSanPham> hang = ctx.HangSanPham.ToList();

            ViewBag.Hang = hang;
            return(View("List", list));
        }