Exemplo n.º 1
0
        public virtual IActionResult DeleteSelected(ICollection <int> selectedIds)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAttributes))
            {
                return(AccessDeniedView());
            }

            if (selectedIds != null)
            {
                var productAttributes = _productAttributeService.GetProductAttributeByIds(selectedIds.ToArray());
                _productAttributeService.DeleteProductAttributes(productAttributes);

                foreach (var productAttribute in productAttributes)
                {
                    _customerActivityService.InsertActivity("DeleteProductAttribute",
                                                            string.Format(_localizationService.GetResource("ActivityLog.DeleteProductAttribute"), productAttribute.Name), productAttribute);
                }
            }

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