Ejemplo n.º 1
0
        /// <summary>
        /// Cunstructs list of database's tables for view in the TreeView.
        /// </summary>
        /// <param name="database">Database</param>
        /// <param name="tables">Tables</param>
        /// <returns>An ArrayList of tables for representation.</returns>
        private ArrayList ConstructTablesRepresentation(TreeNode database, DataTable tables)
        {
            ArrayList ret = new ArrayList();

            foreach (DataRow table in tables.Rows)
            {
                string TableName = table[0].ToString();
                if (!dbTree.TreeNodeContains(database, TableName))
                {
                    if (DBViewerConstants.AdminMode)
                    {
                        foreach (DBViewerConstants.TableRule TableRule in DBViewerConstants.AdminTables)
                        {
                            if (TableRule.TableName == TableName)
                            {
                                ret.Add(table[0]);
                            }
                        }
                    }
                    else
                    {
                        foreach (DBViewerConstants.TableRule TableRule in DBViewerConstants.UserTables)
                        {
                            if (TableRule.TableName == TableName)
                            {
                                ret.Add(table[0]);
                            }
                        }
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Cunstructs list of database's tables for view in the TreeView.
        /// </summary>
        /// <param name="database">Database</param>
        /// <param name="tables">Tables</param>
        /// <returns>An ArrayList of tables for representation.</returns>
        private ArrayList ConstructTablesRepresentation(TreeNode database, DataTable tables)
        {
            ArrayList ret = new ArrayList();

            foreach (DataRow table in tables.Rows)
            {
                if (!dbTree.TreeNodeContains(database, table[0].ToString()))
                {
                    ret.Add(table[0]);
                }
            }
            return(ret);
        }