Exemplo n.º 1
0
        private ActionResult CreateResource(string themeName, string container, string file, bool isDirectory,
            string contents, bool rewriteFile = false)
        {
            try
            {
                var resource = new ResourceCreator
                {
                    ThemeName = themeName,
                    Container = container,
                    File = file,
                    IsDirectory = isDirectory,
                    Contents = contents,
                    Rewrite = rewriteFile
                };

                resource.Create();
            }
            catch (ResourceCreateException ex)
            {
                return this.AjaxFail(ex.Message, HttpStatusCode.InternalServerError);
            }

            return Json(new {success = true}, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 2
0
        private ActionResult CreateResource(string themeName, string container, string file, bool isDirectory, string contents, bool rewriteFile = false)
        {
            try
            {
                var resource = new ResourceCreator
                               {
                                   ThemeName = themeName,
                                   Container = container,
                                   File = file,
                                   IsDirectory = isDirectory,
                                   Contents = contents,
                                   Rewrite = rewriteFile
                               };

                resource.Create(this.Tenant);
            }
            catch(ResourceCreateException ex)
            {
                return this.Failed(ex.Message, HttpStatusCode.InternalServerError);
            }

            return this.Ok();
        }