Ejemplo n.º 1
0
        private List <AddmlForeignKey> GetForeignKeysForRecord(flatFileDefinition flatFileDefinition, recordDefinition recordDefinition)
        {
            List <AddmlForeignKey> foreignKeys = new List <AddmlForeignKey>();

            key[] keys = recordDefinition.keys;
            if (keys != null)
            {
                foreach (key key in keys)
                {
                    var foreignKey = key.Item as foreignKey;
                    if (foreignKey != null)
                    {
                        var addmlForeignKey = new AddmlForeignKey(key.name);
                        addmlForeignKey.ForeignKeyIndexes          = GetForeignKeyIndexes(flatFileDefinition, recordDefinition, key);
                        addmlForeignKey.ForeignKeyReferenceIndexes = GetForeignKeyReferenceIndexes(foreignKey);
                        foreignKeys.Add(addmlForeignKey);
                    }
                }
            }
            return(foreignKeys);
        }
Ejemplo n.º 2
0
        private List <AddmlFieldDefinition> ResolveFieldIndexesToDefinitions(List <FieldIndex> fieldIndexes, AddmlForeignKey foreignkey)
        {
            var definitions = new List <AddmlFieldDefinition>();

            foreach (var fieldIndex in fieldIndexes)
            {
                if (!_allFieldDefinitions.ContainsKey(fieldIndex))
                {
                    string errorMessage = "Missing ADDML definition object for field: " + fieldIndex;
                    Log.Debug(errorMessage + "\n" + foreignkey);
                    _statusEventHandler.RaiseEventOperationMessage(errorMessage, foreignkey.ToString(), OperationMessageStatus.Error);
                }
                else
                {
                    definitions.Add(_allFieldDefinitions[fieldIndex]);
                }
            }
            return(definitions);
        }