Exemplo n.º 1
0
        protected void GetManyToOne()
        {
            foreach (TableKeySchema tks in _sourceTable.ForeignKeys)
            {
                if (tks.ForeignKeyMemberColumns.Count > 1)
                {
                    GetMembers(_sourceTable.ForeignKeyColumns);
                }
                else
                {
                    ColumnSchema column = tks.ForeignKeyMemberColumns[0];

                    if (!column.IsPrimaryKeyMember && !_associationMap.ContainsKey(column) && !NHibernateHelper.IsExcludedColumn(column.Name))
                    {
                        if (!_excludedTables.Contains(tks.PrimaryKeyTable))
                        {
                            EntityAssociation association = new EntityAssociation(AssociationTypeEnum.ManyToOne, tks.PrimaryKeyTable, column);
                            _associationMap.Add(column, association);
                        }
                        else
                        {
                            GetMember(column);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void RefTableEdited(object sender, EditedArgs args)
        {
            TreeIter iter;

            if (store.GetIterFromString(out iter, args.Path))
            {
                if (tables.Contains(args.NewText))
                {
                    store.SetValue(iter, colReferenceTableIndex, args.NewText);
                    SetSelectionFromIter(iter);
                    EmitContentChanged();
                }
                else
                {
                    string oldText = store.GetValue(iter, colReferenceTableIndex) as string;
                    (sender as CellRendererText).Text = oldText;
                }
            }
        }
 private void FillReferenceColumnSelector(TreeIter iter, string table)
 {
     if (tables.Contains(table))
     {
         refTable = tables.Search(table);
         if (refTable != null)
         {
             referenceColumnSelecter.Initialize(refTable.Columns);
             referenceColumnSelecter.Sensitive = true;
             store.SetValue(iter, colReferenceTableIndex, table);
             SetSelectionFromIter(iter);
         }
         else
         {
             referenceColumnSelecter.Sensitive = false;
             referenceColumnSelecter.Clear();
         }
         EmitContentChanged();
     }
 }