@@ -48,24 +48,6 @@ public class AttributeMappingJson
4848 public string transformationRule { get ; set ; }
4949 }
5050
51- public static string CreateMd5 ( string input )
52- {
53- // Use input string to calculate MD5 hash
54- using ( System . Security . Cryptography . MD5 md5 = System . Security . Cryptography . MD5 . Create ( ) )
55- {
56- byte [ ] inputBytes = Encoding . ASCII . GetBytes ( input ) ;
57- byte [ ] hashBytes = md5 . ComputeHash ( inputBytes ) ;
58-
59- // Convert the byte array to hexadecimal string
60- StringBuilder sb = new StringBuilder ( ) ;
61- for ( int i = 0 ; i < hashBytes . Length ; i ++ )
62- {
63- sb . Append ( hashBytes [ i ] . ToString ( "X2" ) ) ;
64- }
65- return sb . ToString ( ) ;
66- }
67- }
68-
6951 public FormManageMetadata ( FormMain parent ) : base ( parent )
7052 {
7153 InitializeComponent ( ) ;
@@ -108,21 +90,21 @@ public FormManageMetadata(FormMain parent) : base(parent)
10890
10991
11092
111- public DataTable ConvertToDataTable < T > ( IList < T > data )
112- {
113- PropertyDescriptorCollection properties = TypeDescriptor . GetProperties ( typeof ( T ) ) ;
114- DataTable table = new DataTable ( ) ;
115- foreach ( PropertyDescriptor prop in properties )
116- table . Columns . Add ( prop . Name , Nullable . GetUnderlyingType ( prop . PropertyType ) ?? prop . PropertyType ) ;
117- foreach ( T item in data )
118- {
119- DataRow row = table . NewRow ( ) ;
120- foreach ( PropertyDescriptor prop in properties )
121- row [ prop . Name ] = prop . GetValue ( item ) ?? DBNull . Value ;
122- table . Rows . Add ( row ) ;
123- }
124- return table ;
125- }
93+ // public DataTable ConvertToDataTable<T>(IList<T> data)
94+ // {
95+ // PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T));
96+ // DataTable table = new DataTable();
97+ // foreach (PropertyDescriptor prop in properties)
98+ // table.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);
99+ // foreach (T item in data)
100+ // {
101+ // DataRow row = table.NewRow();
102+ // foreach (PropertyDescriptor prop in properties)
103+ // row[prop.Name] = prop.GetValue(item) ?? DBNull.Value;
104+ // table.Rows.Add(row);
105+ // }
106+ // return table;
107+ // }
126108
127109 private void PopulateTableMappingGridWithVersion ( int versionId )
128110 {
@@ -177,6 +159,7 @@ private void PopulateTableMappingGridWithVersion(int versionId)
177159 dataGridViewTableMetadata . Columns [ 6 ] . HeaderText = "Filter Criteria" ;
178160 dataGridViewTableMetadata . Columns [ 7 ] . HeaderText = "Generation Indicator" ;
179161 }
162+
180163 }
181164 else if ( repositoryTarget == "JSON" ) //Update the JSON
182165 {
@@ -239,6 +222,7 @@ private void PopulateTableMappingGridWithVersion(int versionId)
239222
240223 richTextBoxInformation . AppendText ( "The file " + configurationSettings . ConfigurationPath + GlobalParameters . jsonTableMappingFileName + " was loaded." ) ;
241224 }
225+ GridAutoLayout ( ) ;
242226 }
243227
244228 private void PopulateAttributeGridWithVersion ( int versionId )
@@ -293,8 +277,6 @@ private void PopulateAttributeGridWithVersion(int versionId)
293277 dataGridViewAttributeMetadata . Columns [ 4 ] . HeaderText = "Integration Area Table" ;
294278 dataGridViewAttributeMetadata . Columns [ 5 ] . HeaderText = "Integration Area Column" ;
295279 dataGridViewAttributeMetadata . Columns [ 6 ] . HeaderText = "Transformation Rule" ;
296-
297- GridAutoLayout ( ) ;
298280 }
299281 }
300282 else if ( repositoryTarget == "JSON" ) //Update the JSON
@@ -357,7 +339,7 @@ private void PopulateAttributeGridWithVersion(int versionId)
357339
358340 richTextBoxInformation . AppendText ( "The file " + configurationSettings . ConfigurationPath + GlobalParameters . jsonAttributeMappingFileName + " was loaded." ) ;
359341 }
360-
342+ GridAutoLayout ( ) ;
361343 }
362344
363345 private DialogResult STAShowDialog ( FileDialog dialog )
@@ -544,8 +526,8 @@ private void ManageModelMetadataVersion()
544526 //Create insert statement
545527 var insertQueryTables = new StringBuilder ( ) ;
546528
547- insertQueryTables . AppendLine ( "INSERT INTO MD_VERSION_ATTRIBUTE" ) ;
548- insertQueryTables . AppendLine ( "([VERSION_ID], [TABLE_NAME],[COLUMN_NAME],[DATA_TYPE],[CHARACTER_MAXIMUM_LENGTH],[NUMERIC_PRECISION], [ORDINAL_POSITION], [PRIMARY_KEY_INDICATOR], [DRIVING_KEY_INDICATOR], [ MULTI_ACTIVE_INDICATOR])" ) ;
529+ insertQueryTables . AppendLine ( "INSERT INTO [ MD_VERSION_ATTRIBUTE] " ) ;
530+ insertQueryTables . AppendLine ( "([VERSION_ID], [TABLE_NAME],[COLUMN_NAME],[DATA_TYPE],[CHARACTER_MAXIMUM_LENGTH],[NUMERIC_PRECISION], [ORDINAL_POSITION], [PRIMARY_KEY_INDICATOR], [MULTI_ACTIVE_INDICATOR])" ) ;
549531 insertQueryTables . AppendLine ( "SELECT " ) ;
550532 insertQueryTables . AppendLine ( " " + versionId + "," ) ;
551533 insertQueryTables . AppendLine ( " [TABLE_NAME], " ) ;
@@ -555,10 +537,9 @@ private void ManageModelMetadataVersion()
555537 insertQueryTables . AppendLine ( " [NUMERIC_PRECISION], " ) ;
556538 insertQueryTables . AppendLine ( " [ORDINAL_POSITION], " ) ;
557539 insertQueryTables . AppendLine ( " [PRIMARY_KEY_INDICATOR], " ) ;
558- insertQueryTables . AppendLine ( " [DRIVING_KEY_INDICATOR], " ) ;
559540 insertQueryTables . AppendLine ( " [MULTI_ACTIVE_INDICATOR] " ) ;
560- insertQueryTables . AppendLine ( "FROM MD_VERSION_ATTRIBUTE" ) ;
561- insertQueryTables . AppendLine ( "WHERE VERSION_ID = " + previousVersionId + "" ) ;
541+ insertQueryTables . AppendLine ( "FROM [ MD_VERSION_ATTRIBUTE] " ) ;
542+ insertQueryTables . AppendLine ( "WHERE [ VERSION_ID] = " + previousVersionId + "" ) ;
562543
563544 //Execute the insert statement
564545 using ( var connection = new SqlConnection ( configurationSettings . ConnectionStringOmd ) )
0 commit comments