public async Task <IActionResult> GetAsync(
            [FromQuery] int?p         = 1,
            [FromQuery] string filter = "")
        {
            if (p == null || p <= 0)
            {
                p = 1;
            }
            ViewBag.p = p.Value;

            var serchInp = new GetIdentityRolesInput
            {
                Filter         = filter ?? "",
                MaxResultCount = AppTheme.Limit,
                SkipCount      = (p.Value - 1) * AppTheme.Limit
            };
            var res = await _IdentityRoleAppService.GetListAsync(serchInp);

            string listRes = string.Format("Showing {0} to {1} of {2} entries",
                                           res.TotalCount > 0 ? serchInp.SkipCount + 1 : 0, serchInp.SkipCount + res.Items.Count, res.TotalCount);

            if (!filter.IsNullOrEmpty())
            {
                listRes += string.Format(" for \"{0}\"", serchInp.Filter);
            }
            ViewBag.ListState = listRes;

            ViewBag.Filter     = filter;
            ViewBag.Pagination = PaginateHelper.Generate(
                "javascript:syncVt('{0}', '" + filter + "');",
                p.Value, res.TotalCount, AppTheme.Limit);
            return(PartialView(TableView, res));
        }
Пример #2
0
        public async Task <PagedResultDto <IdentityRoleDto> > ListAsync(GetRoleListInput input)
        {
            var request = new GetIdentityRolesInput();

            request.Filter         = input.filter?.Trim();
            request.MaxResultCount = input.PageSize;
            request.SkipCount      = (input.PageIndex - 1) * input.PageSize;
            return(await _identityRoleAppService.GetListAsync(request));
        }
        public async Task GetListAsync()
        {
            //Act

            var result = await _roleAppService.GetListAsync();

            //Assert

            result.Items.Count.ShouldBeGreaterThan(0);
        }
Пример #4
0
        public async Task GetListAsync()
        {
            //Act

            var result = await _roleAppService.GetListAsync(new PagedAndSortedResultRequestDto());

            //Assert

            result.Items.Count.ShouldBeGreaterThan(0);
        }
Пример #6
0
        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <returns>Task&lt;PagedResult&lt;IdentityRoleDto&gt;&gt;.</returns>
        public virtual async Task <PagedResult <IdentityRoleDto> > GetList(GetIdentityRolesInput input)
        {
            var result = await _appService.GetListAsync(input);

            return(new PagedResult <IdentityRoleDto>(result.TotalCount, result.Items));
        }
Пример #7
0
 public virtual Task <PagedResultDto <IdentityRoleDto> > GetListAsync(GetIdentityRolesInput input)
 {
     return(_roleAppService.GetListAsync(input));
 }
 public virtual Task <ListResultDto <IdentityRoleDto> > GetListAsync()
 {
     return(_roleAppService.GetListAsync());
 }
Пример #9
0
 public virtual Task <PagedResultDto <IdentityRoleDto> > GetListAsync(PagedAndSortedResultRequestDto input)
 {
     return(_roleAppService.GetListAsync(input));
 }