Пример #1
0
        public virtual ActionResult Delete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageDestinations))
            {
                return(AccessDeniedView());
            }

            var destination = _destinationService.GetDestinationById(id);

            if (destination == null)
            {
                //No destination found with the specified id
                return(RedirectToAction("List"));
            }

            _destinationService.DeleteDestination(destination);

            //activity log
            _customerActivityService.InsertActivity("DeleteDestination", _localizationService.GetResource("ActivityLog.DeleteDestination"), destination.Name);

            SuccessNotification(_localizationService.GetResource("Admin.Catalog.Destinations.Deleted"));
            return(RedirectToAction("List"));
        }
 public IActionResult DeleteDestination(int id)
 {
     _destService.DeleteDestination(id);
     _logger.LogInformation("Destination " + id + " has been deleted");
     return(RedirectToAction("Index"));
 }