예제 #1
0
        public JsonResult TryImportContent(ImportData data)
        {
            try
            {
                var results = ImportTools.AddContent(data);

                return new JsonResult
                {
                    Data = new
                    {
                        results,
                        Success = true
                    }
                };
            }
            catch (Exception ex)
            {
                return new JsonResult
                {
                    Data = new
                    {
                        Success = false,
                        Error = ex.Message
                    }
                };
            }
        }
예제 #2
0
        public ImportResults AddContent(ImportData data)
        {
            var results = new ImportResults();

            results.SchemaResults = AddSchemas(data.Schemas);
            results.ModuleResults = AddModules(data.Modules);

            return results;
        }
예제 #3
0
 public JsonResult Content(ImportData data)
 {
     return TryImportContent(data);
 }