public async Task <IActionResult> Delete(string id)
        {
            var customerAction = await _customerActionService.GetCustomerActionById(id);

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

            try
            {
                //activity log
                await _customerActivityService.InsertActivity("DeleteCustomerAction", customerAction.Id, _localizationService.GetResource("ActivityLog.DeleteCustomerAction"), customerAction.Name);

                await _customerActionService.DeleteCustomerAction(customerAction);

                SuccessNotification(_localizationService.GetResource("Admin.Customers.CustomerAction.Deleted"));
                return(RedirectToAction("List"));
            }
            catch (Exception exc)
            {
                ErrorNotification(exc.Message);
                return(RedirectToAction("Edit", new { id = customerAction.Id }));
            }
        }
        public async Task DeleteCustomerActionTest()
        {
            var action = await _customerActionService.GetCustomerActionById(_Id_CustomerAction);

            await _customerActionService.DeleteCustomerAction(action);
        }
Exemple #3
0
        public void DeleteCustomerActionTest()
        {
            var action = _customerActionService.GetCustomerActionById(_Id_CustomerAction);

            _customerActionService.DeleteCustomerAction(action);
        }