Exemplo n.º 1
0
        public virtual async Task DeleteCustomerTag(CustomerTag customerTag)
        {
            //activity log
            await _customerActivityService.InsertActivity("DeleteCustomerTag", customerTag.Id, _localizationService.GetResource("ActivityLog.DeleteCustomerTag"), customerTag.Name);

            await _customerTagService.DeleteCustomerTag(customerTag);
        }
Exemplo n.º 2
0
        public IActionResult Delete(string id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers))
                return AccessDeniedView();

            var customerTag = _customerTagService.GetCustomerTagById(id);
            if (customerTag == null)
                //No customer role found with the specified id
                return RedirectToAction("List");

            try
            {
                //activity log
                _customerActivityService.InsertActivity("DeleteCustomerTag", customerTag.Id, _localizationService.GetResource("ActivityLog.DeleteCustomerTag"), customerTag.Name);

                _customerTagService.DeleteCustomerTag(customerTag);

                SuccessNotification(_localizationService.GetResource("Admin.Customers.CustomerTags.Deleted"));
                return RedirectToAction("List");
            }
            catch (Exception exc)
            {
                ErrorNotification(exc.Message);
                return RedirectToAction("Edit", new { id = customerTag.Id });
            }

        }