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)); }
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)); }