public ActionResult Statistics(int?page) { int pageNumber = page ?? 1; int pageSize = 10; try { _filterView = new FilterViewModel(_service.GetSaleInfo(((pageNumber - 1) * pageSize), pageSize)); int count = _service.GetSaleInfo().Count(); List <int> pagingList = new List <int>(); for (int i = 1; i < count; i++) { pagingList.Add(i); } _filterView.ListPager = pagingList.ToPagedList(pageNumber, pageSize); SelectLists distinctItems = _service.DistinctItems(); _filterView.Managers = new SelectList(distinctItems.Managers); _filterView.DatesOfSale = new SelectList(distinctItems.DateOfSales); _filterView.Products = new SelectList(distinctItems.Products); } catch (Exception) { return(View("Error")); } return(View(_filterView)); }