Пример #1
0
        protected virtual void CollapseClassificationTypes()
        {
            Classification c = new Classification(dataSet, visibleTables);
            c.CalculateHierarquies();
            List<List<string>> maximal = c.MaximalStringHierarchies;

            foreach (List<string> hierarchy in maximal)
            {
                foreach (string table in hierarchy)
                {
                    string newTable = table;

                    if (table.IndexOf("(") != -1)
                        newTable = table.Substring(0, table.IndexOf("("));

                    if (entityTypes[newTable] > EntityTypes.ClassificationEntity)
                        continue;

                    if (dataSet.Tables.Contains(newTable))
                    {
                        Collapse cp = new Collapse(dataSet, newTable, new List<string>(), VisibleTables);
                        dataSet = cp.GetResult();
                    }
                }
            }
        }
Пример #2
0
        public override DataSet DeriveModel()
        {
            Classification c = new Classification(dataSet, visibleTables);
            c.CalculateHierarquies();
            List<List<string>> maximal = c.MaximalStringHierarchies;

            foreach (List<string> hierarchy in maximal)
            {
                foreach (string table in hierarchy)
                {
                    string newTable = table;

                    if (table.IndexOf("(") != -1)
                        newTable = table.Substring(0, table.IndexOf("("));

                    if (entityTypes[newTable] == EntityTypes.TransactionEntity)
                        continue;

                    if (dataSet.Tables.Contains(newTable))
                    {
                        Collapse cp = new Collapse(dataSet, newTable, new List<string>(), visibleTables);
                        dataSet = cp.GetResult();
                        visibleTables = cp.VisibleTables;
                    }
                }
            }

            return dataSet;
        }
Пример #3
0
        public void RefreshHierarquies(string dataset, Classification c)
        {
            c.CalculateHierarquies();
            treeView1.Nodes[0].Nodes[0].Nodes.Clear();

            TreeNode minimal = treeView1.Nodes[0].Nodes[0].Nodes.Add("Minimal Entities");
            foreach (string str in c.MinimalStringEntities)
                minimal.Nodes.Add(str);

            TreeNode maximal = treeView1.Nodes[0].Nodes[0].Nodes.Add("Maximal Entities");
            foreach (string str in c.MaximalStringEntities)
                maximal.Nodes.Add(str);

            List<List<string>> maximalHierarchies = c.MaximalStringHierarchies;

            int count = 1;
            TreeNode maxNode = treeView1.Nodes[0].Nodes[0].Nodes.Add("Maximal Hierarchies");
            foreach (List<string> hierarchy in maximalHierarchies)
            {
                TreeNode node = maxNode.Nodes.Add("Maximal Hierarchy #" + count++);

                foreach (string table in hierarchy)
                    node.Nodes.Add(table);
            }

            treeView1.ExpandAll();
            maxNode.Collapse();
        }
Пример #4
0
        public override DataSet DeriveModel()
        {
            Classification c = new Classification(dataSet, visibleTables);
            c.CalculateHierarquies();
            List<string> minimal = c.MinimalStringEntities;

            foreach (string table in minimal)
            {
                Collapse cp = new Collapse(dataSet, table, new List<string>(), VisibleTables);
                dataSet = cp.GetResult();
                visibleTables = cp.VisibleTables;
            }

            return dataSet;
        }
        protected override void CollapseClassificationTypes()
        {
            Classification c = new Classification(dataSet, visibleTables);
            c.CalculateHierarquies();
            List<List<string>> maximal = c.MaximalStringHierarchies;

            foreach (List<string> hierarchy in maximal)
            {
                foreach (string table in hierarchy)
                {
                    string newTable = table;

                    if (table.IndexOf("(") != -1)
                        newTable = table.Substring(0, table.IndexOf("("));

                    bool doNotCollapse = false;
                    if (entityTypes[newTable].Equals(EntityTypes.ClassificationEntity))
                    {
                        List<DataRelation> relations = DataHelper.GetRelations(dataSet, newTable);

                        if (relations.Count > 1)
                        {
                            foreach (DataRelation dr in relations)
                            {
                                if (entityTypes[dr.ChildTable.TableName].Equals(EntityTypes.ComponentEntity))
                                    doNotCollapse = true;
                            }
                        }
                    }

                    if (doNotCollapse)
                        continue;

                    if (entityTypes[newTable] > EntityTypes.ClassificationEntity)
                        continue;

                    if (dataSet.Tables.Contains(newTable))
                    {
                        Collapse cp = new Collapse(dataSet, newTable, new List<string>(), VisibleTables);
                        dataSet = cp.GetResult();
                    }
                }
            }
        }