Esempio n. 1
0
        public ActionResult EditLayerDeletePOST(int id)
        {
            if (!Services.Authorizer.Authorize(Permissions.ManageWidgets, T(NotAuthorizedManageWidgetsLabel)))
            {
                return(new HttpUnauthorizedResult());
            }

            try {
                _widgetsService.DeleteLayer(id);
                Services.Notifier.Information(T("Layer was successfully deleted"));
            } catch (Exception exception) {
                this.Error(exception, T("Removing Layer failed: {0}", exception.Message), Logger, Services.Notifier);
            }

            return(RedirectToAction("Index", "Admin"));
        }
Esempio n. 2
0
        public ActionResult EditLayerDeletePOST(int id)
        {
            if (!IsAuthorizedToManageWidgets())
            {
                return(new HttpUnauthorizedResult());
            }

            try {
                _widgetsService.DeleteLayer(id);
                Services.Notifier.Information(T("Layer was successfully deleted"));
            } catch (Exception exception) {
                Logger.Error(T("Removing Layer failed: {0}", exception.Message).Text);
                Services.Notifier.Error(T("Removing Layer failed: {0}", exception.Message));
            }

            return(RedirectToAction("Index", "Admin"));
        }