Beispiel #1
0
        public virtual IActionResult List(SpecificationAttributeSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAttributes))
            {
                return(AccessDeniedKendoGridJson());
            }

            //prepare model
            var model = _specificationAttributeModelFactory.PrepareSpecificationAttributeListModel(searchModel);

            return(Json(model));
        }
        public virtual IActionResult SpecificationAttributeList(SpecificationAttributeSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAttributes))
            {
                return(AccessDeniedDataTablesJson());
            }

            SpecificationAttributeGroup group = null;

            if (searchModel.SpecificationAttributeGroupId > 0)
            {
                group = _specificationAttributeService.GetSpecificationAttributeGroupById(searchModel.SpecificationAttributeGroupId)
                        ?? throw new ArgumentException("No specification attribute group found with the specified id");
            }

            var model = _specificationAttributeModelFactory.PrepareSpecificationAttributeListModel(searchModel, group);

            return(Json(model));
        }