Ejemplo n.º 1
0
        public virtual IActionResult ValueDelete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
                return AccessDeniedView();

            //try to get a vendor attribute value with the specified id
            var value = _vendorAttributeService.GetVendorAttributeValueById(id)
                ?? throw new ArgumentException("No vendor attribute value found with the specified id", nameof(id));

            _vendorAttributeService.DeleteVendorAttributeValue(value);

            //activity log
            _customerActivityService.InsertActivity("DeleteVendorAttributeValue",
                string.Format(_localizationService.GetResource("ActivityLog.DeleteVendorAttributeValue"), value.Id), value);

            return new NullJsonResult();
        }