Ejemplo n.º 1
0
        public ActionResult DeleteResource(string themeName, string resource)
        {
            if (string.IsNullOrWhiteSpace(themeName) || string.IsNullOrWhiteSpace(resource))
            {
                return this.AjaxFail("Access is denied", HttpStatusCode.BadRequest);
            }

            try
            {
                var remover = new ResourceRemover(themeName, resource);
                remover.Delete();
            }
            catch (ResourceRemoveException ex)
            {
                return this.AjaxFail(ex.Message, HttpStatusCode.InternalServerError);
            }

            return Json(new {success = true}, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 2
0
        public ActionResult DeleteResource(string themeName, string resource)
        {
            if(string.IsNullOrWhiteSpace(themeName) ||
               string.IsNullOrWhiteSpace(resource))
            {
                return this.AccessDenied();
            }

            try
            {
                var remover = new ResourceRemover(themeName, resource);
                remover.Delete(this.Tenant);
            }
            catch(ResourceRemoveException ex)
            {
                return this.Failed(ex.Message, HttpStatusCode.InternalServerError);
            }

            return this.Ok();
        }