Exemple #1
0
        public async Task <IActionResult> List(DataSourceRequest command)
        {
            var customertags = await _customerTagService.GetAllCustomerTags();

            var items = new List <(string Id, string Name, int Count)>();

            foreach (var item in customertags)
            {
                items.Add((Id: item.Id, Name: item.Name, Count: await _customerTagService.GetCustomerCount(item.Id)));
            }
            var gridModel = new DataSourceResult
            {
                Data  = items.Select(x => new { Id = x.Id, Name = x.Name, Count = x.Count }),
                Total = customertags.Count()
            };

            return(Json(gridModel));
        }
        public IActionResult List(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers))
                return AccessDeniedView();

            var customertags = _customerTagService.GetAllCustomerTags();
            var gridModel = new DataSourceResult
            {
                Data = customertags.Select(x => new { Id = x.Id, Name = x.Name, Count = _customerTagService.GetCustomerCount(x.Id) }),
                Total = customertags.Count()
            };
            return Json(gridModel);
        }
Exemple #3
0
        public IActionResult List(DataSourceRequest command)
        {
            var customertags = _customerTagService.GetAllCustomerTags();
            var gridModel    = new DataSourceResult
            {
                Data  = customertags.Select(x => new { Id = x.Id, Name = x.Name, Count = _customerTagService.GetCustomerCount(x.Id) }),
                Total = customertags.Count()
            };

            return(Json(gridModel));
        }