public void Select_List_Item(string columnName) { Mapped_Fields mappedField = Bibliographic_Mapping.String_To_Mapped_Field(columnName); string listValue = Bibliographic_Mapping.Mapped_Field_To_String(mappedField); comboBox1.SelectedIndex = comboBox1.FindStringExact(listValue); }
private void write_mappings_and_constants(DataTable inputFile, List <Mapped_Fields> mapping, Constant_Fields constantCollection) { try { string mapping_name = filename + ".importdata"; StreamWriter mappingWriter = new StreamWriter(mapping_name, false); mappingWriter.WriteLine("MAPPING:"); int column = 0; foreach (Mapped_Fields mappedField in mapping) { mappingWriter.WriteLine("\t\"" + inputFile.Columns[column].ColumnName.Replace("\"", """) + "\" --> " + Bibliographic_Mapping.Mapped_Field_To_String(mappedField)); column++; } mappingWriter.WriteLine(); mappingWriter.WriteLine("CONSTANTS:"); foreach (Constant_Field_Data constantData in constantCollection.constantCollection) { if ((constantData.Data.Length > 0) && (constantData.Field != Mapped_Fields.None)) { mappingWriter.WriteLine("\t" + Bibliographic_Mapping.Mapped_Field_To_String(constantData.Field) + " <-- \"" + constantData.Data.Replace("\"", """)); } } mappingWriter.Flush(); mappingWriter.Close(); } catch (Exception ee) { MessageBox.Show("Unable to save the import data for this job. \n\n" + ee, "Error saving mapping", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
static Column_Assignment_Control() { Array enumValues = Enum.GetValues(typeof(Mapped_Fields)); mappable_fields = new string[enumValues.Length]; for (int i = 0; i < enumValues.Length; i++) { mappable_fields[i] = Bibliographic_Mapping.Mapped_Field_To_String((Mapped_Fields)enumValues.GetValue(i)); } }