Example #1
0
        private void OnMainUpdateClick(object sender, System.EventArgs e)
        {
            System.Data.DataRow v_row = this.v_maingrid.CurrentRow();

            this.v_reportwindow = new Spartacus.Forms.Window(
                System.Configuration.ConfigurationManager.AppSettings["reportupdate.title"].ToString(),
                600,
                150,
                this.v_mainwindow
                );

            this.v_reportname = new Spartacus.Forms.Textbox(this.v_reportwindow, System.Configuration.ConfigurationManager.AppSettings["reportupdate.name"].ToString());
            this.v_reportname.SetValue(v_row["name"].ToString());
            this.v_reportwindow.Add(this.v_reportname);

            this.v_reportxmlfile = new Spartacus.Forms.Filepicker(
                this.v_reportwindow,
                Spartacus.Forms.Filepicker.Type.OPEN,
                System.Configuration.ConfigurationManager.AppSettings["reportupdate.xmlfile"].ToString(),
                System.Configuration.ConfigurationManager.AppSettings["reportupdate.filter"].ToString()
                );
            this.v_reportxmlfile.SetValue(v_row["xmlfile"].ToString());
            this.v_reportwindow.Add(this.v_reportxmlfile);

            this.v_reportbuttons = new Spartacus.Forms.Buttons(this.v_reportwindow);
            this.v_reportbuttons.AddButton(System.Configuration.ConfigurationManager.AppSettings["reportupdate.save"].ToString(), this.OnReportUpdateSaveClick);
            this.v_reportbuttons.AddButton(System.Configuration.ConfigurationManager.AppSettings["reportupdate.cancel"].ToString(), this.OnReportUpdateCancelClick);
            this.v_reportwindow.Add(this.v_reportbuttons);

            this.v_reportwindow.Show();
        }
Example #2
0
        private void OnMainInsertClick(object sender, System.EventArgs e)
        {
            try
            {
                this.v_reportwindow = new Spartacus.Forms.Window(
                    System.Configuration.ConfigurationManager.AppSettings["reportinsert.title"].ToString(),
                    600,
                    150,
                    this.v_mainwindow
                    );

                this.v_reportname = new Spartacus.Forms.Textbox(this.v_reportwindow, System.Configuration.ConfigurationManager.AppSettings["reportinsert.name"].ToString());
                this.v_reportwindow.Add(this.v_reportname);

                this.v_reportxmlfile = new Spartacus.Forms.Filepicker(
                    this.v_reportwindow,
                    Spartacus.Forms.Filepicker.Type.OPEN,
                    System.Configuration.ConfigurationManager.AppSettings["reportinsert.xmlfile"].ToString(),
                    System.Configuration.ConfigurationManager.AppSettings["reportinsert.filter"].ToString()
                    );
                this.v_reportwindow.Add(this.v_reportxmlfile);

                this.v_reportbuttons = new Spartacus.Forms.Buttons(this.v_reportwindow);
                this.v_reportbuttons.AddButton(System.Configuration.ConfigurationManager.AppSettings["reportinsert.save"].ToString(), this.OnReportInsertSaveClick);
                this.v_reportbuttons.AddButton(System.Configuration.ConfigurationManager.AppSettings["reportinsert.cancel"].ToString(), this.OnReportInsertCancelClick);
                this.v_reportwindow.Add(this.v_reportbuttons);

                this.v_reportwindow.Show();
            }
            catch (Spartacus.Forms.Exception exc)
            {
                Spartacus.Forms.Messagebox.Show(exc.v_message, "Spartacus.Forms.Exception", Spartacus.Forms.Messagebox.Icon.ERROR);
                System.Environment.Exit(-1);
            }
            catch (System.Exception exc)
            {
                Spartacus.Forms.Messagebox.Show(exc.Message, exc.GetType().ToString(), Spartacus.Forms.Messagebox.Icon.ERROR);
                System.Environment.Exit(-1);
            }
        }
Example #3
0
        private void OnMainExecuteClick(object sender, System.EventArgs e)
        {
            System.Data.DataRow v_row = this.v_maingrid.CurrentRow();

            try
            {
                this.v_currentcode = int.Parse(v_row["code"].ToString());
                this.v_currentfile = v_row["xmlfile"].ToString();
                this.v_report      = new Spartacus.Reporting.Report(this.v_currentcode, this.v_currentfile);

                this.v_paramwindow = new Spartacus.Forms.Window(
                    System.Configuration.ConfigurationManager.AppSettings["param.title"].ToString(),
                    500,
                    500,
                    this.v_mainwindow
                    );

                for (int k = 0; k < this.v_report.v_cmd.v_parameters.Count; k++)
                {
                    if (this.v_report.v_cmd.v_parameters[k].v_type == Spartacus.Database.Type.DATE)
                    {
                        Spartacus.Forms.Datetimepicker v_param = new Spartacus.Forms.Datetimepicker(
                            this.v_paramwindow,
                            this.v_report.v_cmd.v_parameters[k].v_description,
                            "dd/MM/yyyy"
                            );
                        this.v_paramwindow.Add(v_param);
                    }
                    else
                    {
                        if (this.v_report.v_cmd.v_parameters[k].v_lookup != null &&
                            this.v_report.v_cmd.v_parameters[k].v_lookup != "")
                        {
                            Spartacus.Forms.Lookup v_param = new Spartacus.Forms.Lookup(
                                this.v_paramwindow,
                                this.v_report.v_cmd.v_parameters[k].v_description
                                );
                            v_param.Populate(this.v_report.v_database, this.v_report.v_cmd.v_parameters[k].v_lookup, "80;150");
                            this.v_paramwindow.Add(v_param);
                        }
                        else
                        {
                            Spartacus.Forms.Textbox v_param = new Spartacus.Forms.Textbox(
                                this.v_paramwindow,
                                this.v_report.v_cmd.v_parameters[k].v_description
                                );
                            this.v_paramwindow.Add(v_param);
                        }
                    }
                }

                this.v_reportpdffile = new Spartacus.Forms.Filepicker(
                    this.v_paramwindow,
                    Spartacus.Forms.Filepicker.Type.SAVE,
                    System.Configuration.ConfigurationManager.AppSettings["param.pdffile"].ToString(),
                    System.Configuration.ConfigurationManager.AppSettings["param.filter"].ToString()
                    );
                this.v_paramwindow.Add(this.v_reportpdffile);

                this.v_parambuttons = new Spartacus.Forms.Buttons(this.v_paramwindow);
                this.v_parambuttons.AddButton(System.Configuration.ConfigurationManager.AppSettings["param.execute"].ToString(), this.OnParamExecuteClick);
                this.v_parambuttons.AddButton(System.Configuration.ConfigurationManager.AppSettings["param.cancel"].ToString(), this.OnParamCancelClick);
                this.v_paramwindow.Add(this.v_parambuttons);

                this.v_progressbar = new Spartacus.Forms.Progressbar(this.v_paramwindow);
                this.v_progressbar.SetValue("Aguardando inĂ­cio", 0);
                this.v_paramwindow.Add(this.v_progressbar);

                this.v_paramwindow.Show();
            }
            catch (Spartacus.Database.Exception exc)
            {
                Spartacus.Forms.Messagebox.Show(exc.v_message, "Spartacus.Database.Exception", Spartacus.Forms.Messagebox.Icon.ERROR);
                System.Environment.Exit(-1);
            }
            catch (Spartacus.Reporting.Exception exc)
            {
                Spartacus.Forms.Messagebox.Show(exc.v_message, "Spartacus.Reporting.Exception", Spartacus.Forms.Messagebox.Icon.ERROR);
                System.Environment.Exit(-1);
            }
            catch (Spartacus.Forms.Exception exc)
            {
                Spartacus.Forms.Messagebox.Show(exc.v_message, "Spartacus.Forms.Exception", Spartacus.Forms.Messagebox.Icon.ERROR);
                System.Environment.Exit(-1);
            }
            catch (System.Exception exc)
            {
                Spartacus.Forms.Messagebox.Show(exc.Message, exc.GetType().ToString(), Spartacus.Forms.Messagebox.Icon.ERROR);
                System.Environment.Exit(-1);
            }
        }