Ejemplo n.º 1
0
        public ActionResult Index(int?page)
        {
            int pageNumber = page ?? 1;

            int begin = pageNumber * QTD;

            IEnumerable <PointModel> AllPoints = service.GetPoints(begin, QTD);
            var onePage = AllPoints.ToPagedList(1, QTD);

            int totalPoints = service.GetTotalPoints();
            IEnumerable <string> totalPages = Enumerable.Repeat(string.Empty, totalPoints);

            ViewBag.TotalPages = totalPages.ToPagedList(pageNumber, QTD);
            ViewBag.OnePage    = onePage;

            return(View());
        }