Esempio n. 1
0
        public ActionResult ViewNews(int id = 0)
        {
            if (!_pagination.IsCorrectRequest(id))
            {
                return(HttpNotFound());
            }

            ViewBag.pageNumber = id;
            ViewBag.pagesCount = _pagination.GetPagesCount();

            IEnumerable <News> news = _pagination.GetNewsBlock(id);

            return(View(news));
        }
Esempio n. 2
0
        public ActionResult Index(int id = 0)
        {
            if (!_pagination.IsCorrectRequest(id))
            {
                return(HttpNotFound());
            }

            ViewBag.pageNumber = id;
            ViewBag.pagesCount = _pagination.GetPagesCount();
            ViewBag.randomNews = _randomNews.GetRandomNews();

            List <News> news = _pagination.GetNewsBlock(id);

            return(View(news));
        }