Exemplo n.º 1
0
        /// <summary>
        /// Returns Code Table names for the project
        /// </summary>
        /// <param name="project">Project</param>
        /// <returns>DataTable</returns>
        public override DataTable GetCodeTableNamesForProject(Project project)
        {
            List <string> tables = project.GetDataTableList();

            DataSets.TableSchema.TablesDataTable codeTables = project.GetCodeTableList();

            foreach (DataSets.TableSchema.TablesRow row in codeTables)
            {
                tables.Add(row.TABLE_NAME);
            }
            DataTable bindingTable = new DataTable();

            bindingTable.Columns.Add(ColumnNames.NAME);
            foreach (string table in tables)
            {
                if (!string.IsNullOrEmpty(table))
                {
                    if (project.CollectedData.TableExists(table))
                    {
                        bindingTable.Rows.Add(new string[] { table });
                    }
                }
            }

            return(bindingTable);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the code table names for the project.
        /// </summary>
        /// <param name="project"><see cref="Epi.Project"/></param>
        /// <returns><see cref="System.Data.DataTable"/></returns>
        public override DataTable GetCodeTableNamesForProject(Project project)
        {
            List <string> tables = project.GetDataTableList();

            DataSets.TableSchema.TablesDataTable codeTables = project.GetCodeTableList();
            foreach (DataSets.TableSchema.TablesRow row in codeTables)
            {
                tables.Add(row.TABLE_NAME);
            }

            DataView dataView = codeTables.DefaultView;

            return(codeTables);
        }
Exemplo n.º 3
0
        private void Construct()
        {
            InitializeComponent();
            DockManager.FastMoveDraw = false;
            DockManager.Style        = DockVisualStyle.VS2005;

            Project project = view.GetProject();

            Epi.Collections.ViewCollection views = project.Views;
            viewSelect.Items.AddRange(views.Names.ToArray());
            DataSets.TableSchema.TablesDataTable tables = project.Metadata.GetCodeTableList();

            foreach (DataRow row in tables)
            {
                viewSelect.Items.Add((string)row[ColumnNames.TABLE_NAME]);
            }

            viewSelect.SelectedItem = view.Name;
            viewSelect_SelectedIndexChanged(viewSelect, new EventArgs());
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns code table list
        /// </summary>
        /// <param name="db">IDbDriver</param>
        /// <returns>Epi.DataSets.TableSchema.TablesDataTable</returns>
        public override Epi.DataSets.TableSchema.TablesDataTable GetCodeTableList(IDbDriver db)
        {
            DataSets.TableSchema.TablesDataTable tables = db.GetTableSchema();

            //remove tables without prefix "code"
            DataRow[] rowsFiltered = tables.Select("TABLE_NAME not like 'code%'");
            foreach (DataRow rowFiltered in rowsFiltered)
            {
                tables.Rows.Remove(rowFiltered);
            }
            foreach (DataRow row in tables)
            {
                if (String.IsNullOrEmpty(row.ItemArray[2].ToString()))
                {
                    //remove a row with an empty string
                    tables.Rows.Remove(row);
                }
            }
            DataRow[] rowsCode = tables.Select("TABLE_NAME like 'code%'");

            return(tables);
        }