Пример #1
0
        public void AddChildTable(REPORT.Table.TableVo childvo)
        {
            Table child = new Table(this.MAINREPORT, this);

            child.LOAD(childvo);
            this.AddChildTable(child);
        }
Пример #2
0
        /// <summary>
        /// NEW LOAD METHOD
        /// </summary>
        /// <param name="tablevo"></param>
        public void LOAD(REPORT.Table.TableVo tablevo)
        {
            //if(this.MAIN!=null)
            //    this.MAIN.CHILDREN.Add(tablevo);

            this.THISTABLE = tablevo;
            this.TABLE     = tablevo.TABELA;

            //*
            new REPORT.Fields.FieldsDao().load(this.THISTABLE.FIELDS, this.ID);
            //new REPORT.GroupBy.GroupByDao().load(this.THISTABLE.GROUPBY, this.ID);
            //new REPORT.Filters.FiltersDao().Load(this.THISTABLE.FILTERS, this.ID);
            //new REPORT.OrderBy.OrderByDao().load(this.THISTABLE.ORDERBY, this.ID);
            //new REPORT.Params.ParamsDao().Load(  this.THISTABLE.PARAMS , this.ID);
            //*/

            //*
            this.FIELDS.LOAD(this.THISTABLE.FIELDS);
            //this.GROUPBY.LOAD();
            //this.FILTERS.LOAD();
            //this.ORDERBY.LOAD();
            //this.PARAMS.LOAD( );
            //*/
            if (this.ID != 0)
            {
                this.TABLE = this.THISTABLE.TABELA;
                //this.RELATEDTABLES.Clear();
                //this.RELATEDTABLES.Add(this.TABLE);

                #region TABELAS FILHO
                //*
                //List<REPORT.Table.TableVo> childrenTable = new List<REPORT.Table.TableVo>();
                new REPORT.Table.TableDao().load(this.THISTABLE.CHILDREN, this.REPORTID, this.ID);
                //*/
                this.AddChildrenTable(this.THISTABLE.CHILDREN);
                #endregion
            }

            this.TOTALIZAR.Visible = this.MAIN != null;
            //this.ReloadRelatedTables();

            if (this.CHILDREN != null &&
                this.THISTABLE != null &&
                this.THISTABLE.CHILDREN != null)
            {
                for (int idx = 0; idx < this.THISTABLE.CHILDREN.Count; idx++)
                {
                    this.CHILDREN[idx].LOAD(this.THISTABLE.CHILDREN[idx]);
                }
            }
            //this.RELOAD();
        }
Пример #3
0
        private void popScreenFromRecursiveTables()
        {
            panelParams.Controls.Clear();

            REPORT.Table.TableVo tabela = new REPORT.Table.TableVo();
            new REPORT.Table.TableDao().load(tabela, this.RELATORIO.ID, 0);

            DataTable tabelas = new REPORT.Params.ParamsDao().getRecursiveTables(tabela, "userParms_" + sigaSession.LoggedUser.ID, tabela.ID);

            if (tabelas.DefaultView.Count == 0)
            {
                btnExec_Click(null, null); destroy = true;
            }

            foreach (DataRow row in tabelas.Rows)
            {
                string tagFormat    = "@$TAB$@.$CAMPO$ ?? '@?@'";
                string controle     = (string)row["formato"];
                string strNomeCampo = new SigaObjects
                                      .SXManager(sigaSession.EMPRESAS[0].CODIGO)
                                      .getFields((string)row["tabela"], SigaObjects.SXManager.FieldValueMember
                                                 + " = '"
                                                 + (string)row["campo"]
                                                 + "'"
                                                 , null)
                                      .Rows[0][SigaObjects.SXManager.FieldDisplayMember].ToString();
                //
                // CONTROLE DE
                Control cDE   = FormatScreen.getObjectFromSigaType(controle);
                string  lblDE = strNomeCampo + "\t\t Entre  \t\t";
                cDE.Tag = tagFormat
                          .Replace("$TAB$", (string)row["tabela"])
                          .Replace("$CAMPO$", (string)row["campo"])
                          .Replace("??", ">=");

                FormatScreen.AddControl(panelParams, new Label(lblDE), true, 3, false, false);
                FormatScreen.AddControl(panelParams, cDE, true, 3, false, false);

                //
                // CONTROLE ATE
                Control cATE   = FormatScreen.getObjectFromSigaType(controle);
                string  lblATE = string.Format("{0,50}", "e");
                cATE.Tag = tagFormat
                           .Replace("$TAB$", (string)row["tabela"])
                           .Replace("$CAMPO$", (string)row["campo"])
                           .Replace("??", "<=");

                //FormatScreen.AddControl(panelParams, new Label(lblATE),true, 4, false, false);
                FormatScreen.AddControl(panelParams, cATE, true, 3, false, false);
            }
        }
Пример #4
0
        protected void strTable_TextChanged(object sender, EventArgs e)
        {
            //Table child = new Table(this.THISTABLE);
            //child.REPORTID = this.REPORTID;
            REPORT.Table.TableVo cTable = new REPORT.Table.TableVo();
            new REPORT.Table.TableDao().load(cTable, this.REPORTID, this.ID);
            cTable.MAINID   = this.THISTABLE.ID;
            cTable.IDREPORT = this.REPORTID;
            cTable.TABELA   = (sender as Control).Text;

            // child.LOAD(cTable);

            this.AddChildTable(cTable);
        }
Пример #5
0
        private void menu_Click(object objSource, ToolBarItemEventArgs objArgs)
        {
            Control        inControl = this.Parent;
            SxMakeRelatory rel;

            REPORT.ReportVo report;
            string          relname = "";

            switch (objArgs.ToolBarButton.Name.ToLower())
            {
            case "tbbadd":
                #region ADD
                this.Parent.Controls.Clear();
                rel      = new SxMakeRelatory();
                rel.Dock = DockStyle.Fill;
                FormatScreen.AddControl(inControl, rel, true, 1, true, false);
                rel.btnAddNew_Click(null, null);
                #endregion

                break;

            case "tbbver":
                #region VER
                if (dgvReports.SelectedRows.Count > 0)
                {
                    DataRow row = (DataRow)(dgvReports.DataSource as DataView).Table.Rows[dgvReports.SelectedRows[0].Index];

                    /*
                     * Report cReport = new Report();
                     * cReport.LOAD((string)row["nome"], false);
                     *
                     * gridWindow grid = new gridWindow(cReport.TABLE.QUERY.ToString(), null);
                     * grid.SetGridHeader(cReport.TABLE.FIELDS.TOGRID);
                     * grid.showWindow();
                     * //*/

                    ControlsConfig.formShow(new ViewReport(int.Parse(row["id"].ToString())), this.Form, ControlsConfig.showType.Dialog, null, true);
                }
                #endregion

                break;

            case "tbbedit":
                #region EDIT
                if (dgvReports.SelectedRows.Count > 0)
                {
                    this.Parent.Controls.Clear();

                    DataRow row = (DataRow)(dgvReports.DataSource as DataView).Table.Rows[dgvReports.SelectedRows[0].Index];

                    rel      = new SxMakeRelatory();
                    rel.Dock = DockStyle.Fill;
                    FormatScreen.AddControl(inControl, rel, true, 1, true, false);
                    relname = (string)row["nome"];
                    rel.btnAbrir_Click(new Label(relname), null);
                }
                #endregion

                break;

            case "tbbdel":
                #region DEL
                if (dgvReports.SelectedRows.Count > 0)
                {
                    DataRow row = (DataRow)(dgvReports.DataSource as DataView).Table.Rows[dgvReports.SelectedRows[0].Index];

                    report = new REPORT.ReportVo();

                    report.ID            = int.Parse(row["id"].ToString());
                    report.IDREPORTGROUP = int.Parse(row["idreportgroup"].ToString());

                    SigaObjects.Reports.Table.TableVo maintable = new SigaObjects.Reports.Table.TableVo();
                    new SigaObjects.Reports.Table.TableDao().load(maintable, report.ID, 0);

                    new SigaObjects.Reports.Report.ReportDao().DeleteRecursiveTables(maintable.ID);
                    new SigaObjects.Reports.Report.ReportDao().delete(report);
                }
                #endregion

                break;

            case "tbbexcel":
                #region EXCEL
                FormatScreen.showNotImplemented();
                #endregion

                break;

            case "tbbpdf":
                #region PDF
                FormatScreen.showNotImplemented();
                #endregion

                break;

            default:
                break;
            }
        }