public ActionResult Index() { ViewBag.listSPMoi = spRepo.GetAll().OrderByDescending(x => x.NgayCapNhat).Take(8).ToList(); ViewBag.listSPBanChay = spRepo.GetAll().OrderByDescending(x => x.SoLuongBan).Take(8).ToList(); return(View()); }
public ActionResult GetPaging(int?page) { int pageSize = 10; // Số sản phẩm của 1 trang int pageNum = (page ?? 1); // If(page==null)->set page==1 return(PartialView("_GetPaging", spRepo.GetAll().ToPagedList(pageNum, pageSize))); }
// GET: SanPham public ActionResult Index(int id) { return(View(spRepo.GetAll().Where(x => x.DanhMucID == id).ToList())); }