Пример #1
0
        public ActionResult module(int moduleid, DynamicModuleViewModel _entryToCreate)
        {
            var doverApi = new ModuleApi(ModRepository);
            var module = ModRepository.GetModuleById(moduleid, m => m.Fields);
            var result = String.Empty;
            var filteredList = new DynamicModuleFieldList();

            filteredList.AddRange(_entryToCreate.Fields.Where(f => CheckFieldExistency(f)));
            _entryToCreate.Fields = filteredList;

            try {
                doverApi.CreateModule(module, _entryToCreate);
                result = "<result>Success</result>";
            }
            catch (CreateModuleFailedException) {
                result = "<result>Failure</result>";
            }

            return Content(result, "text/xml", Encoding.UTF8);
        }
Пример #2
0
        public ActionResult module(int moduleid, DynamicModuleViewModel _entryToCreate)
        {
            var doverApi     = new ModuleApi(ModRepository);
            var module       = ModRepository.GetModuleById(moduleid, m => m.Fields);
            var result       = String.Empty;
            var filteredList = new DynamicModuleFieldList();

            filteredList.AddRange(_entryToCreate.Fields.Where(f => CheckFieldExistency(f)));
            _entryToCreate.Fields = filteredList;

            try {
                doverApi.CreateModule(module, _entryToCreate);
                result = "<result>Success</result>";
            }
            catch (CreateModuleFailedException) {
                result = "<result>Failure</result>";
            }

            return(Content(result, "text/xml", Encoding.UTF8));
        }
Пример #3
0
        public ActionResult module(int moduleid, int?id, DynamicModuleViewModel _entryToEdit)
        {
            var result = String.Empty;

            try {
                var doverApi     = new ModuleApi(ModRepository);
                var module       = ModRepository.GetModuleById(moduleid, m => m.Rows.Include <Row, Cell>(r => r.Cells), m => m.Fields);
                var filteredList = new DynamicModuleFieldList();

                filteredList.AddRange(_entryToEdit.Fields.Where(f => CheckFieldExistency(f)));
                _entryToEdit.Fields = filteredList;

                doverApi.SetModuleData(module, id, _entryToEdit, true);
                result = "<result>Success</result>";
            }
            catch (Exception e) {
                result = "<result>Failure</result>";
            }

            return(Content(result, "text/xml", Encoding.UTF8));
        }
Пример #4
0
        public ActionResult module(int moduleid, int? id, DynamicModuleViewModel _entryToEdit)
        {
            var result = String.Empty;

            try {
                var doverApi = new ModuleApi(ModRepository);
                var module = ModRepository.GetModuleById(moduleid, m => m.Rows.Include<Row, Cell>(r => r.Cells), m => m.Fields);
                var filteredList = new DynamicModuleFieldList();

                filteredList.AddRange(_entryToEdit.Fields.Where(f => CheckFieldExistency(f)));
                _entryToEdit.Fields = filteredList;

                doverApi.SetModuleData(module, id, _entryToEdit, true);
                result = "<result>Success</result>";
            }
            catch (Exception e) {
                result = "<result>Failure</result>";
            }

            return Content(result, "text/xml", Encoding.UTF8);
        }