Esempio n. 1
0
        public ActionResult Players(int sortBy, int pageNumber)
        {
            int count   = 0;
            var db      = new PlayerRepository();
            var players = db.SortPlayerBy(sortBy, pageNumber, 10, out count);

            ViewBag.PageCount       = PagingExtensions.PageCount(count, 10);
            ViewBag.PageNumber      = pageNumber;
            ViewBag.SortBySelection = sortBy;
            return(View(players));
        }
Esempio n. 2
0
        public ActionResult Players()
        {
            var pageStart      = 1;
            var sortStartValue = 1;
            int count          = 0;
            var db             = new PlayerRepository();
            var players        = db.GetAllPlayers(pageStart, 10, out count);
            var pageCount      = PagingExtensions.PageCount(count, 10);

            ViewBag.PageCount       = pageCount;
            ViewBag.PageNumber      = pageStart;
            ViewBag.SortBySelection = sortStartValue;
            return(View(players));
        }