Exemplo n.º 1
0
        public ActionResult List(DataSourceRequest command, StoreMappingModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageStores))
            {
                return(AccessDeniedKendoGridJson());
            }

            var storeModels = _storeMappingService.GetAllPagedStoreMapping(
                model.StoreName,
                "Store",
                command.Page,
                command.PageSize,
                model.RemoveCustomerProfile
                );

            var gridModel = new DataSourceResult
            {
                Data = storeModels.Select(x => new StoreMappingModel()
                {
                    Id         = x.Id,
                    UserName   = _customerService.GetCustomerById(x.EntityId).Email,
                    EntityId   = x.EntityId,
                    EntityName = x.EntityName,
                    StoreName  = x.Store.Name,
                    StoreUrl   = x.Store.Url
                }),
                Total = storeModels.TotalCount
            };

            return(Json(gridModel));
        }