public ActionResult Video(PagingModel pager) { pager.PageSize = 1; var pageargs = new PageArgs(pager); var list = VideoRepository.FindAll(); return View(new PagedList<Video>(list, pageargs.Index, pageargs.Count)); }
// GET: Contacter public ActionResult Index(PagingModel pager) { var pageargs = new PageArgs(pager); var list = ContacterReponsitory.FindAll().Skip(pageargs.From - 1).Take(pageargs.To - pageargs.From).ToList(); var viewModel = new ContacterViewModel() { ContactsList = new PagedList<Contacter>(list, pageargs.Index, pageargs.Count) }; return View(viewModel); }
// GET: Portal public ActionResult ProductList(int? cateId, PagingModel pager) { if (!cateId.HasValue || cateId < 0) cateId = 0; var pageargs = new PageArgs(pager); List<News> list = null; if (cateId != 0) { list = NewsRepository.FindAll().Where(n => n.CategoryId == cateId).ToList(); } else { list = NewsRepository.FindAll().ToList(); } var viewModel = new ProductViewModel() { cateId = cateId.Value, CateList = CategoryRepository.FindAll().Where(c => c.State == State.Nomal).ToList(), NewsList = new PagedList<News>(list, pageargs.Index, pageargs.Count) }; return View(viewModel); }
// GET: Product public ActionResult Index(PagingModel pager) { var pageargs = new PageArgs(pager); var list = NewsRepository.FindAll().Skip(pageargs.From - 1).Take(pageargs.To - pageargs.From).ToList(); var viewModel = new ProductViewModel() { NewsList = new PagedList<News>(list, pageargs.Index, pageargs.Count) }; return View(viewModel); }