Example #1
0
        private void openRow(EmpresaVo empresa, bool readOnly)
        {
            int         idx = dgvDados.SelectedRows[0].Index;
            DataRowView row = (dgvDados.DataSource as DataTable).DefaultView[idx];
            int         id  = (int)row["id"];

            empresa.CODIGO        = (string)row["EMPRESA"];
            empresa.CODIGO_FILIAL = (string)row["FILIAl"];
            new EmpresaDao().Load(empresa, null);
            ControlsConfig.formShow(new CadContasAPagar(empresa, id, readOnly), this.Form, ControlsConfig.showType.Dialog);
        }
Example #2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (cbFILIAL.SelectedIndex < 0)
            {
                MessageBox.Show("Selecione uma Empresa/Filial.");
            }
            else
            {
                DataRowView row = cbFILIAL.SelectedItem as DataRowView;
                empresa.CODIGO        = (string)row["M0_CODIGO"];
                empresa.NOME          = (string)row["M0_NOME"];
                empresa.CODIGO_FILIAL = (string)row["M0_CODFIL"];
                empresa.FILIAL        = (string)row["M0_FILIAL"];

                //Form frm = new Form();
                //frm.Controls.Add(toControl);
                //frm.WindowState=FormWindowState.Maximized;
                //frm.ShowDialog(this.Form);
                ControlsConfig.formShow(toControl, this.Form, ControlsConfig.showType.Dialog);
            }
        }
Example #3
0
 public void ShowWindow(Form form)
 {
     ControlsConfig.formShow(this, form, ControlsConfig.showType.Dialog);
 }
Example #4
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;
            }
        }