Beispiel #1
0
        private void AppendTableByTableName(string TableName, bool IsReferencedTable)
        {
            if (!HaveTableDiagram(TableName))
            {
                TableDefineInfo TableDefineInfo = DepositoryTableDefineInfo.GetTableDefineInfo(TableName);

                int TableHeight = tableFlow1.FieldHeight;
                foreach (FieldDefineInfo fieldInfo in TableDefineInfo.FieldInfos)
                {
                    if (!ColumnRegular.JudgeColumnName(fieldInfo.Description))
                    {
                        TableHeight = TableHeight + tableFlow1.FieldHeight;
                    }
                }

                Node tableNode = tableFlow1.AddTable(TableDefineInfo.Description, TableLeft, TableTop, TableWidth, TableHeight);
                tableNode.Properties["Name"].Value = TableDefineInfo.Name;
                tableNode.Properties["Text"].Value = TableDefineInfo.Description;

                foreach (FieldDefineInfo fieldInfo in TableDefineInfo.FieldInfos)
                {
                    if (!ColumnRegular.JudgeColumnName(fieldInfo.Description))
                    {
                        Node FieldNode = tableFlow1.AddField(tableNode, fieldInfo.Description + "(" + fieldInfo.FieldType.DisplayType + ")", !IsReferencedTable, IsReferencedTable, Color.Transparent);
                        FieldNode.Properties["Name"].Value     = fieldInfo.FieldName;
                        FieldNode.Properties["Text"].Value     = fieldInfo.Description;
                        FieldNode.Properties["DispType"].Value = fieldInfo.FieldType.DisplayType;
                    }
                }
            }
        }
        private void ReferenceFilterDialog_Load(object sender, EventArgs e)
        {
            SheetfilterControl.InitializeControls();

            ComboBox        ComboBoxColumns = SheetfilterControl.ComboBoxColumns;
            TableDefineInfo TableInfo       = DepositoryTableDefineInfo.GetTableDefineInfo(TableName);

            if (TableInfo != null)
            {
                foreach (FieldDefineInfo Field in TableInfo.FieldInfos)
                {
                    if (!ColumnRegular.JudgeColumnName(Field.Description))
                    {
                        ComboBoxColumns.Items.Add(Field);
                    }
                }
            }

            TreeView filterView = SheetfilterControl.tViewFilters;

            filterView.Nodes.Clear();
            foreach (DataFilterItem Item in dataFilterCondition.Items)
            {
                TreeNode Node = new TreeNode();
                Node.Text = string.Format("{0} {1}", Item.ConditionalOperator, Item.ToString());
                Node.Tag  = Item;
                filterView.Nodes.Add(Node);

                if (Node.Index == 0)
                {
                    Node.Text = Item.ToString();
                }
            }

            SheetfilterControl.Button_Add.Click    += new EventHandler(Button_Add_Click);
            SheetfilterControl.Button_Delete.Click += new EventHandler(Button_Delete_Click);
        }