Esempio n. 1
0
        public void load(ReportVo report, int idreportgroup, string filtro)
        {
            string strFiltro = "";

            strFiltro += (idreportgroup > 0) ? " idReportGroup = " + idreportgroup : " idReportGroup != 0";
            strFiltro += (filtro != null) ? "   AND " + filtro : filtro;

            load(report, strFiltro);
        }
Esempio n. 2
0
        public void load(ReportVo report, string reportName, string filtro)
        {
            string strFiltro = "";

            strFiltro += (reportName != null) ? " nome = '" + reportName + "'" : "";
            strFiltro += (filtro != null) ? "   AND " + filtro           : filtro;

            load(report, strFiltro);
        }
Esempio n. 3
0
        public int update(ReportVo report)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.AppendLine("UPDATE report");
            this.QUERY.AppendLine("   SET idReportGroup    = " + report.IDREPORTGROUP);
            this.QUERY.AppendLine("     , nome             = '" + report.NOME + "'");
            this.QUERY.AppendLine("     , username         = '******'");
            this.QUERY.AppendLine("     , filial           = '" + report.FILIAL + "'");
            this.QUERY.AppendLine("     , empresa          = '" + report.EMPRESA + "'");
            this.QUERY.AppendLine(" WHERE id = " + report.ID);

            return(getData().DefaultView.Count);
        }
Esempio n. 4
0
        public void load(ReportVo report, string filtro)
        {
            DataTable table = select(filtro, false);

            if (table.DefaultView.Count > 0)
            {
                report.IDREPORTGROUP = (int)table.DefaultView[0]["idReportGroup"];
                report.ID            = (int)table.DefaultView[0]["id"];
                report.EMPRESA       = (string)table.DefaultView[0]["empresa"];
                report.NOME          = (string)table.DefaultView[0]["nome"];
                report.USERNAME      = (string)table.DefaultView[0]["username"];
                report.FILIAL        = (string)table.DefaultView[0]["filial"];
            }
        }
Esempio n. 5
0
        public int insert(ReportVo report)
        {
            this.QUERY = new StringBuilder(fromDatabase);

            this.QUERY.Append("INSERT INTO report");
            this.QUERY.AppendLine("(idReportGroup, nome, username, filial, empresa)");

            this.QUERY.Append("VALUES(");
            this.QUERY.Append("" + report.IDREPORTGROUP + ",");
            this.QUERY.Append("'" + report.NOME + "',");
            this.QUERY.Append("'" + report.USERNAME + "',");
            this.QUERY.Append("'" + report.FILIAL + "',");
            this.QUERY.Append("'" + report.EMPRESA + "'");
            this.QUERY.AppendLine(")");

            return(getData().DefaultView.Count);
        }
Esempio n. 6
0
        public int save(ReportVo report)
        {
            if (report.ID == 0)
            {
                int i = insert(report);
                this.load(report);

                report.TABLE.REPORT = report;
                new Table.TableDao().save(report.TABLE);

                return(i);
            }
            else
            {
                return(update(report));
            }
        }
Esempio n. 7
0
        public void load(List <ReportVo> reports, int idreportgroup, string filtro)
        {
            DataTable table = select(idreportgroup, filtro, false);

            for (int i = 0; i < table.DefaultView.Count; i++)
            {
                ReportVo report = new ReportVo();
                report.IDREPORTGROUP = idreportgroup;

                report.ID       = (int)table.DefaultView[i]["id"];
                report.EMPRESA  = (string)table.DefaultView[i]["empresa"];
                report.NOME     = (string)table.DefaultView[i]["nome"];
                report.USERNAME = (string)table.DefaultView[i]["username"];
                report.FILIAL   = (string)table.DefaultView[i]["filial"];

                reports.Add(report);
            }
        }
Esempio n. 8
0
 public void load(ReportVo report, int idreportgroup)
 {
     load(report, idreportgroup, " nome = '" + report.NOME + "'");
 }
Esempio n. 9
0
 public void load(ReportVo report)
 {
     load(report, report.IDREPORTGROUP);
 }
Esempio n. 10
0
 public DataTable select(int idreportgroup, ReportVo report)
 {
     return(this.select(idreportgroup, " nome = '" + report.NOME + "'"));
 }
Esempio n. 11
0
 public int delete(ReportVo report)
 {
     return(delete(report.IDREPORTGROUP, "id = " + report.ID));
 }
Esempio n. 12
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;
            }
        }