Esempio n. 1
0
        public ActionResult List(int startRow = 1, int numberOfRows = 5)
        {
            int           numberOfAuthors = 0;
            List <Author> model           = _pubsService.ListAuthorsPaged(startRow, numberOfRows, "Name", "asc", out numberOfAuthors);

            if (startRow > 1)
            {
                ViewBag.PreviousClass = "previous";
                ViewBag.PreviousRow   = startRow - numberOfRows;
            }
            else
            {
                ViewBag.PreviousClass = "previous disabled";
                ViewBag.PreviousRow   = startRow;
            }
            if (startRow + numberOfRows > numberOfAuthors)
            {
                ViewBag.NextClass = "next disabled";
                ViewBag.NextRow   = numberOfAuthors;
            }
            else
            {
                ViewBag.NextClass = "next";
                ViewBag.NextRow   = startRow + numberOfRows;
            }
            ViewBag.TotalRows = numberOfAuthors;
            return(View("Index", model));
        }