コード例 #1
0
 public ActionResult AddMappedField(string uuid, MappedFieldModel mappedField)
 {
     var importSettingsService = new ImportSettingsService();
     var data = importSettingsService.AddMappedField(uuid, mappedField);
     ViewBag.UUID = uuid;
     return PartialView("_Connected", data);
 }
コード例 #2
0
 public List<MappedFieldModel> AddMappedField(string uuid, MappedFieldModel data)
 {
     var service = new XmlService();
     var mappedFields = GetMappedFields(uuid);
     mappedFields.Add(data);
     var dataAsString = service.Serialize<List<MappedFieldModel>>(mappedFields);
     this.UpdateImportSettings(uuid, new NameValueCollection { { "MappedFields", dataAsString } });
     return mappedFields;
 }
コード例 #3
0
 public List<MappedFieldModel> RemoveMappedField(string uuid, MappedFieldModel data)
 {
     var service = new XmlService();
     var mappedFields = GetMappedFields(uuid);
     var elementToRemove = mappedFields.FirstOrDefault(a => a.KoobooField == data.KoobooField);
     if (elementToRemove != null)
     {
         mappedFields.Remove(elementToRemove);
         var dataAsString = service.Serialize<List<MappedFieldModel>>(mappedFields);
         UpdateImportSettings(uuid, new NameValueCollection {{"MappedFields", dataAsString}});
     }
     return mappedFields;
 }