public async Task <ActionResult> List(int page = 1) { var filter = new GroupFilterDto { PageSize = PageSize, RequestedPageNumber = page }; var result = await GroupFacade.GetGroupsByFilterAsync(filter); // Paging ViewBag.RequestedPageNumber = result.RequestedPageNumber; ViewBag.PageCount = (int)Math.Ceiling((double)result.TotalItemsCount / (double)PageSize); // Paging END return(View("List", result.Items)); }
public async Task <ActionResult> List(int page = 1) { Session[pageNumberSessionKey] = page; var filter = Session[filterSessionKey] as GroupFilterDto ?? new GroupFilterDto { PageSize = PageSize }; filter.RequestedPageNumber = page; var result = await GroupFacade.GetGroupsByFilterAsync(filter); var collection = result.Items; if (collection == null) { collection = new List <GroupDto>(); } ViewBag.GroupMember = false; if (User.Identity.IsAuthenticated) { var user = await CharacterFacade.GetCharacterById(Guid.Parse(User.Identity.Name)); if (user.GroupId.HasValue) { ViewBag.GroupMember = true; } } // Paging ViewBag.RequestedPageNumber = result.RequestedPageNumber; ViewBag.PageCount = (int)Math.Ceiling((double)result.TotalItemsCount / (double)PageSize); // Paging END return(View("List", collection)); }