Пример #1
0
            public string GetKey <T>(T obj)
            {
                if (ColumnMappings.ContainsKey(KeyColumn))
                {
                    object keyValue = ColumnMappings[KeyColumn].GetValue(obj, null);
                    if (keyValue != null)
                    {
                        return(keyValue.ToString());
                    }
                }

                return(null);
            }
Пример #2
0
 internal void InitializeColumnMappings(Dictionary <string, ForeignKeyColumnInfo> fks)
 {
     foreach (KeyValuePair <string, ForeignKeyColumnInfo> kvp in fks)
     {
         string fkTableName = kvp.Value.ReferencedTableName;
         if (string.IsNullOrEmpty(fkTableName))
         {
             continue;
         }
         if (ColumnMappings.ContainsKey(fkTableName))
         {
             continue;
         }
         Dictionary <string, Column> dicCols          = GetColumnsFromTable(fkTableName, WizardForm.Connection);
         List <ColumnValidation>     myColValidations = ValidationsGrid.GetColumnValidationList(fkTableName, dicCols, null);
         ColumnMappings.Add(fkTableName, myColValidations.ToDictionary(p => { return(p.Name); }));
     }
 }