Пример #1
0
        private void btnShowTables_Click(object sender, EventArgs e)
        {
            Label strTable = new Label();

            //StringBuilder sQuery;
            DataTable dados          = new DataTable();
            bool      isRelatedTable = this.relatedTables.Count > 0;
            string    filtro         = txtFilterTables.Text.Trim();

            filtro = (filtro == "filtro") ? "" : filtro;

            if (isRelatedTable)
            {
                dados = new SigaObjects.SXManager(sigaSession.EMPRESAS[0].CODIGO).getRelatedTables(this.RELATEDTABLES, "X2_NOME LIKE '%" + filtro + "%'");
            }
            else
            {
                dados = new SXManager(sigaSession.EMPRESAS[0].CODIGO).getTables("X2_NOME LIKE '%" + filtro + "%'");
            }

            Form frm = new Form();

            frm.Text = (this.relatedTables.Count > 0) ? "TABELAS RELACIONADAS" : "TODAS AS TABELAS";
            frm.Controls.Add(new gridWindow(dados, strTable, "X2_CHAVE"));
            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();

            strTable.TextChanged += new EventHandler(strTable_TextChanged);
        }
Пример #2
0
        //private void

        #region EVENTOS DE CONTROLES
        private void lblTABLE_TextChanged(object sender, EventArgs e)
        {
            string filtro;

            SigaObjects.SXManager manager = new SigaObjects.SXManager(sigaSession.EMPRESAS[0].CODIGO);

            /// POPULA COM DADOS DA TABELA SELECONADA
            filtro      = "X2_CHAVE = '@TABLE'";
            filtro      = filtro.Replace("@TABLE", TABLE);
            tpJoin.Text = (string)manager.getTables(filtro).DefaultView[0]["X2_NOME"];
            tpJoin.Controls.Clear();

            this.relatedTables.Clear();
            this.relatedTables.Add(this.TABLE);

            /// RECARREGANDO SUBCONTROLES
            //this.ORDERBY.MAIN = this;
            //this.FIELDS.MAIN  = this;
            //this.FILTERS.MAIN = this;
            //this.GROUPBY.MAIN = this;

            /*
             * this.ORDERBY.LOAD();
             * this.FIELDS.LOAD();
             * this.FILTERS.LOAD();
             * this.GROUPBY.LOAD();
             */
        }