Пример #1
0
        public ActionResult Create(ThemeInfo model)
        {
            if (!ModelState.IsValid)
            {
                return this.AjaxFail("Invalid or incomplete theme information provided.", HttpStatusCode.BadRequest);
            }

            try
            {
                var creator = new ThemeCreator(model);
                creator.Create();
            }
            catch (ThemeCreateException ex)
            {
                return this.AjaxFail(ex.Message, HttpStatusCode.InternalServerError);
            }

            return Json(new { success = true }, JsonRequestBehavior.AllowGet);
        }
Пример #2
0
        public ActionResult Create(ThemeInfo model)
        {
            if(!ModelState.IsValid)
            {
                return this.InvalidModelState(this.ModelState);
            }

            try
            {
                var creator = new ThemeCreator(model);
                creator.Create(this.Tenant);
            }
            catch(ThemeCreateException ex)
            {
                return this.Failed(ex.Message, HttpStatusCode.InternalServerError);
            }

            return this.Ok();
        }