public ActionResult AddMappedField(string uuid, MappedFieldModel mappedField) { var importSettingsService = new ImportSettingsService(); var data = importSettingsService.AddMappedField(uuid, mappedField); ViewBag.UUID = uuid; return PartialView("_Connected", data); }
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; }
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; }