예제 #1
0
 private void InitializeRouteValueDictionary(PaginationViewModel model)
 {
     model.PageRouteValuesDictionary = new Dictionary<int, RouteValueDictionary>();
     for (int i = 1; i <= model.TotalPages; i++)
     {
         InitializeDictionaryForPage(model, i);
     }
 }
예제 #2
0
 public void InitializePaginationModel(PaginationViewModel model, int currentPage, int count)
 {
     if (_route != null)
     {
         model.Route = _route;
     }
     else
     {
         model.Controller = _controller;
         model.Action = _action;
     }
     model.CurrentPage = currentPage;
     model.TotalPages = model.GetPageCount(count, _pageSize);
     if (model.CurrentPage > model.TotalPages)
     {
         model.CurrentPage = model.TotalPages;
     }
     model.UpdateTargetId = _updateTargetId;
     InitializeRouteValueDictionary(model);
 }
예제 #3
0
 private void InitializeDictionaryForPage(PaginationViewModel model, int page)
 {
     model.PageRouteValuesDictionary[page] = new RouteValueDictionary();
     model.PageRouteValuesDictionary[page][UserNameKey] = _userName;
     model.PageRouteValuesDictionary[page][PageKey] = page.ToString();
 }