Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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)));
        }
Ejemplo n.º 3
0
 // GET: SanPham
 public ActionResult Index(int id)
 {
     return(View(spRepo.GetAll().Where(x => x.DanhMucID == id).ToList()));
 }