Exemple #1
0
        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));
        }
Exemple #2
0
 // 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);
 }
Exemple #3
0
        // 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);
        }
Exemple #4
0
 // 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);
 }