Esempio n. 1
0
        public virtual IActionResult Delete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
            {
                return(AccessDeniedView());
            }

            //try to get a vendor attribute with the specified id
            var vendorAttribute = _vendorAttributeService.GetVendorAttributeById(id);

            if (vendorAttribute == null)
            {
                return(RedirectToAction("List"));
            }

            _vendorAttributeService.DeleteVendorAttribute(vendorAttribute);

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

            SuccessNotification(_localizationService.GetResource("Admin.Vendors.VendorAttributes.Deleted"));

            return(RedirectToAction("List"));
        }