public PhanTrang <SanPham_OBJ> GetAlls(int trang, int SoBanGhi, int MaLoaiSanPham, int MaNhaSanXuat) { int DoDaiDanhSach = 0; SanPham_BUS bus = new SanPham_BUS(); var DanhSach = bus.TimKiemThongTinTheoNhaSanXuatVsLoaiSanPham(MaNhaSanXuat, MaLoaiSanPham); DoDaiDanhSach = DanhSach.Count(); var TrangSanPham = DanhSach.OrderByDescending(x => x.MaSanPham).Skip(trang * SoBanGhi).Take(SoBanGhi); var PhanTrang = new PhanTrang <SanPham_OBJ>() { DanhSach = TrangSanPham, Trang = trang, SoBanGhi = SoBanGhi, SoTrang = (int)Math.Ceiling((decimal)DoDaiDanhSach / SoBanGhi) }; return(PhanTrang); }