Beispiel #1
0
        public IActionResult Index(int page = 1)
        {
            var model = _accountGameRepository.GetAllConfirmed(page, 12);

            var countAll = _accountGameRepository.CountConfirmed();

            ViewBag.CurrentPage = page;

            var totalPages = countAll / 12;

            if (countAll % 12 != 0)
            {
                totalPages++;
            }

            if (page <= 0 || page > totalPages)
            {
                ViewBag.CurrentPage = 1;
            }

            ViewBag.TotalPages = totalPages;

            return(View(model));
        }