Пример #1
0
        public virtual async Task <IActionResult> DeleteSelectedSpecificationAttributes(ICollection <int> selectedIds)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageAttributes))
            {
                return(AccessDeniedView());
            }

            if (selectedIds != null)
            {
                var specificationAttributes = await _specificationAttributeService.GetSpecificationAttributeByIdsAsync(selectedIds.ToArray());

                await _specificationAttributeService.DeleteSpecificationAttributesAsync(specificationAttributes);

                foreach (var specificationAttribute in specificationAttributes)
                {
                    await _customerActivityService.InsertActivityAsync("DeleteSpecAttribute",
                                                                       string.Format(await _localizationService.GetResourceAsync("ActivityLog.DeleteSpecAttribute"), specificationAttribute.Name), specificationAttribute);
                }
            }

            return(Json(new { Result = true }));
        }