Ejemplo n.º 1
0
 internal void populateTreeNodesFor(TreeNode parentNode, BaseIndexConstraint index)
 {
     if(index is Index)
         populateTreeNodesFor(parentNode, index as Index);
     else
         populateTreeNodesFor(parentNode, index as Constraint);
 }
Ejemplo n.º 2
0
        public void SetKey(BaseIndexConstraint index)
        {
            txtKeyName.Text = index.Name;
            rbUnique.Checked = index is UniqueConstraint;
            rbPrimaryKey.Checked = index is PrimaryKeyConstraint;
            rbIndex.Checked = index is Index;
            List<KeyColumn> columns = new List<KeyColumn>();
            foreach (Column f in table.Columns)
            {
                columns.Add(new KeyColumn()
                {
                    Selected = index.ColumnNames.Contains(f.Name),
                    ColumnType = string.IsNullOrEmpty(f.ColumnTypeOriginal) ? Provider.Database.DbTypeToString(f.ColumnType) : f.ColumnTypeOriginal,
                    Length = (int)f.Length,
                    Name = f.Name
                });
            }
            keyColumnBindingSource.DataSource = columns;

            if (index is ForeignKeyConstraint)
            {
                comboForeignTableKeys.SelectedItem = index.Table.Database.GetConstraint((index as ForeignKeyConstraint).RefConstraintName);
                tabControl.SelectedTab = tabPageFK;
            }
            else
                tabControl.SelectedTab = tabPageLocal;
        }