示例#1
0
        public ScriptingForm(DBRegistrationClass drc, List <string> script)
        {
            InitializeComponent();
            MdiParent          = FbXpertMainForm.Instance();
            _actScriptingDbReg = drc;
            _lastDirectory     = AppSettingsClass.Instance.PathSettings.ScriptingPath;
            _notifies.Register4Info(FormMeldungRaised);
            _notifies.Register4Error(FormErrorRaised);

            fcbSQL.Clear();
            fcbSQL.SelectionStart = 0;
            string _connstr = ConnectionStrings.Instance.MakeConnectionString(_actScriptingDbReg);

            _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT");
            foreach (string str in script)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    if (str.EndsWith(Environment.NewLine))
                    {
                        this.AppendSql(str);
                    }
                    else
                    {
                        this.AppendSql(str + Environment.NewLine);
                    }
                }
                else
                {
                    this.AppendSql(Environment.NewLine);
                }
            }
        }
示例#2
0
        public ScriptingForm(DBRegistrationClass drc, List <string> script)
        {
            InitializeComponent();
            MdiParent          = FbXpertMainForm.Instance();
            _actScriptingDbReg = drc;
            _lastDirectory     = _actScriptingDbReg.InitialScriptingPath;
            _notifies.Notify.OnRaiseInfoHandler      += MeldungRaised;
            _notifies.Notify.OnRaiseErrorHandler     += ErrorRaised;
            _eventnotifies.Notify.OnRaiseInfoHandler += EventMeldungRaised;
            fcbSQL.Clear();

            fcbSQL.SelectionStart = 0;
            _sql = new SQLScriptingClass(_actScriptingDbReg, "SCRIPT", _notifies, _eventnotifies);
            foreach (string str in script)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    if (str.EndsWith(Environment.NewLine))
                    {
                        this.AppendSql(str);
                    }
                    else
                    {
                        this.AppendSql(str + Environment.NewLine);
                    }
                }
                else
                {
                    this.AppendSql(Environment.NewLine);
                }
            }
        }
示例#3
0
        private void DoGSTAT()
        {
            fctGSTATOutput.Clear();
            fctGSTATOutput.AppendText($@"{DateTime.Now.ToShortDateString()} {DateTime.Now.ToLongTimeString()} Starting of GSTAT{Environment.NewLine}");

            string   args    = txtGSTATParameters.Text.Replace("****", _dbReg.Password);
            string   binfile = $@"{_dbReg.GetFirebirdBinaryPath()}\gstat.exe";
            FileInfo fi      = new FileInfo(binfile);

            if (!fi.Exists)
            {
                object[] p = { fi.FullName, Environment.NewLine };
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "FileNotExistsCaption", "FileNotExists", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Exclamation, null, p);
                return;
            }
            var psi = new ProcessStartInfo(binfile, args);

            psi.RedirectStandardOutput = true;
            psi.RedirectStandardError  = true;
            psi.UseShellExecute        = false;
            psi.CreateNoWindow         = true;

            var ps = new Process();

            ps.StartInfo = psi;
            ps.Start();

            fctGSTATOutput.AppendText(ps.StandardOutput.ReadToEnd());
            fctGSTATOutput.AppendText(ps.StandardError.ReadToEnd());

            ps.WaitForExit();
            ps.Close();

            fctGSTATOutput.AppendText("END of statistics");
        }
示例#4
0
        private void hsCreateDatabase_Click(object sender, EventArgs e)
        {
            var  fi = new FileInfo(txtCreateDatabaseLocationFile.Text);
            bool ok = false;

            if (fi.Exists)
            {
                object[] param = { $@"{txtServer.Text}:{txtCreateDatabaseLocationFile.Text}", Environment.NewLine };
                if (SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "DatabaseExistsCaption", "OverrideExistingDatabase", SEMessageBoxButtons.NoYes, SEMessageBoxIcon.Asterisk, null, param) == SEDialogResult.Yes)
                {
                    ok = DBProviderSet.CreateDatabase(txtCreateDatabaseLocationFile.Text, txtServer.Text, (int)numPort.Value, txtUser.Text, txtPassword.Text, (int)numPacketSize.Value, txtClientLibrary.Text, true, true);
                }
            }
            else
            {
                if (!fi.Directory.Exists)
                {
                    return;
                }
                ok = DBProviderSet.CreateDatabase(txtCreateDatabaseLocationFile.Text, txtServer.Text, (int)numPort.Value, txtUser.Text, txtPassword.Text, (int)numPacketSize.Value, txtClientLibrary.Text, true, true);
            }

            if (!ok)
            {
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "DatabaseError", "DatabaseNotCreated", SEMessageBoxButtons.OK, SEMessageBoxIcon.Asterisk, null, null);
            }
        }
示例#5
0
        private void hsCreateDatas_Click(object sender, EventArgs e)
        {
            var rpt = new ReportDesignClass
            {
                Datafile   = txtXMLDataFileNew.Text,
                Schemafile = txtXSDSchemaFileNew.Text,
                Reportfile = cbReportFile.Text
            };

            bool createFiles = true;

            if (File.Exists(rpt.Datafile) || File.Exists(rpt.Schemafile))
            {
                object[] param = { rpt.Datafile, rpt.Schemafile, Environment.NewLine };

                createFiles =

                    (SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "FileExistsCaption", "ReportDataFilesExists",
                                                SEMessageBoxButtons.NoYes, SEMessageBoxIcon.Exclamation, null, param) == SEDialogResult.Yes);
            }

            if (createFiles)
            {
                foreach (ListViewItem lvi in lvCreateStatements.Items)
                {
                    if (!lvi.Checked)
                    {
                        continue;
                    }
                    rpt.DataObjects.Add(lvi.Tag as ReportSqlCommands);
                }
                rpt.CreateReportDatas(_dbReg);
            }
            rpt.EditDesignFp(report1);
        }
示例#6
0
        private void DoGFIX()
        {
            FileInfo fi = new FileInfo($@"{_dbReg.GetFirebirdBinaryPath()}\gfix.exe");

            if (!fi.Exists)
            {
                object[] p = { fi.FullName, Environment.NewLine };
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "FileNotExistsCaption", "FileNotExists", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Exclamation, null, p);
                return;
            }

            fctGFIXOutput.Clear();
            string args = txtGFIXParameters.Text.Replace("****", _dbReg.Password);
            var    psi  = new ProcessStartInfo($@"{_dbReg.GetFirebirdBinaryPath()}\gfix.exe", args);

            psi.RedirectStandardOutput = true;
            psi.RedirectStandardError  = true;
            psi.UseShellExecute        = false;
            psi.CreateNoWindow         = true;
            fctGFIXOutput.AppendText($@"Starting of GFIX{Environment.NewLine}");
            var ps = new Process();

            ps.StartInfo = psi;
            ps.Start();
            ps.WaitForExit();

            fctGFIXOutput.AppendText(ps.StandardOutput.ReadToEnd());
            fctGFIXOutput.AppendText(ps.StandardError.ReadToEnd());

            ps.Close();
            fctGFIXOutput.AppendText($@"{Environment.NewLine}End of GFIX{Environment.NewLine}");
        }
示例#7
0
        private void hsDesignEdit_Click_1(object sender, EventArgs e)
        {
            if (DataFilesExisting && !string.IsNullOrEmpty(cbReportFile.Text) && File.Exists(cbReportFile.Text))
            {
                var rpt = report1; // new FastReport.Report();
                rpt.Load(cbReportFile.Text);
                //rpt.FileName = txtREPORTFILE.Text;
                var dorg = new FastReport.Data.XmlDataConnection
                {
                    XmlFile          = cbXMLFile.Text,
                    XsdFile          = cbXSDFile.Text,
                    ConnectionString = string.Format("XsdFile={1};XmlFile={0}", cbXMLFile.Text, cbXSDFile.Text)
                };

                rpt.Dictionary.AddChild(dorg);
                rpt.Design(false);

                if (File.Exists(cbReportFile.Text))
                {
                    return;
                }
                rpt.Save(cbReportFile.Text);
            }
            else
            {
                object[] param = { cbReportFile.Text, Environment.NewLine };
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "FileNotExistsCaption", "ReportFilesNotExists", SEMessageBoxButtons.OK, SEMessageBoxIcon.Exclamation, null, param);
            }
        }
示例#8
0
        private void hsEditDomain_Click(object sender, EventArgs e)
        {
            RefreshDomain();
            DomainForm df = new DomainForm(FbXpertMainForm.Instance(), DBReg, DomainObject);

            df.SetBearbeitenMode(EditStateClass.eBearbeiten.eEdit);
            df.Show();
        }
示例#9
0
        private void hsNewDomain_Click(object sender, EventArgs e)
        {
            RefreshDomain();
            DomainForm df = new DomainForm(FbXpertMainForm.Instance(), DBReg, DomainObject);

            df.SetNew();
            df.Show();
        }
示例#10
0
 private void DomainForm_Load(object sender, EventArgs e)
 {
     SetCombo();
     DataToEdit();
     DataFilled = true;
     ShowCaptions();
     AddExcamples();
     ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
     SetDesign(FbXpertMainForm.Instance().AppDesign);
     ac = new AutocompleteClass(fctSQL, _dbReg);
     ac.RefreshAutocompleteForDatabase();
 }
示例#11
0
 private void DomainForm_Load(object sender, EventArgs e)
 {
     FormDesign.SetFormLeft(this);
     SetCombo();
     DataToEdit();
     DataFilled = true;
     ShowCaptions();
     AddExamples();
     ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
     SetDesign(FbXpertMainForm.Instance().AppDesign);
     SetAutocompeteObjects(_tables);
 }
示例#12
0
 public ScriptingForm(DBRegistrationClass drc)
 {
     InitializeComponent();
     MdiParent          = FbXpertMainForm.Instance();
     _actScriptingDbReg = drc;
     _lastDirectory     = _actScriptingDbReg.InitialScriptingPath;
     _notifies.Notify.OnRaiseInfoHandler      += MeldungRaised;
     _notifies.Notify.OnRaiseErrorHandler     += ErrorRaised;
     _eventnotifies.Notify.OnRaiseInfoHandler += EventMeldungRaised;
     fcbSQL.Clear();
     _sql = new SQLScriptingClass(_actScriptingDbReg, "SCRIPT", _notifies, _eventnotifies);
 }
示例#13
0
 private void GetDatabases()
 {
     cbConnection.Items.Clear();
     foreach (var dbr in DatabaseDefinitions.Instance().Databases)
     {
         cbConnection.Items.Add(dbr);
     }
     if (FbXpertMainForm.Instance().ActRegistrationObject != null)
     {
         int n = cbConnection.FindString(FbXpertMainForm.Instance().ActRegistrationObject.ToString());
         cbConnection.SelectedIndex = n;
     }
 }
示例#14
0
 private void EventsForm_Load(object sender, EventArgs e)
 {
     FormDesign.SetFormLeft(this);
     triggers = StaticTreeClass.Instance().GetAllTriggerObjects(_dbReg);
     lvEvents.Items.Clear();
     SetCombo();
     LoadUserDesign();
     DataToEdit();
     ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
     SetDesign(FbXpertMainForm.Instance().AppDesign);
     RefreshLanguageText();
     Restart();
 }
示例#15
0
 private void VIEWManageForm_Load(object sender, EventArgs e)
 {
     if (DbExplorerForm.Instance().Visible)
     {
         this.Left = DbExplorerForm.Instance().Width + 16;
     }
     RefreshLanguageText();
     fctMessages.Clear();
     ac = new AutocompleteClass(fctCREATEINSERTSQL, DBReg);
     ac.RefreshAutocompleteForView(ViewObject.Name);
     ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
     SetDesign(FbXpertMainForm.Instance().AppDesign);
     RefreshAll();
 }
示例#16
0
 private void hsRunStatement_ClickAsync(object sender, EventArgs e)
 {
     GetDataWorker.CancelGettingData();
     if (GetDataWorker.CancellingDone(5000))
     {
         DataSet dataSet1 = new DataSet();
         dataSet1.Clear();
         dgvResults.AutoGenerateColumns = true;
         DoCreateAlter(fctCREATEINSERTSQL.Lines, DBReg, _localNofity, Name);
         DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo($@"{Name}->RunStatement", StaticVariablesClass.ReloadViews, TnSelected);
         return;
     }
     SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "Cancelling getting Data failed", "Timeout for cancelling getting Data has arrived (5000 ms)");
 }
示例#17
0
        private void EventsForm_Load(object sender, EventArgs e)
        {
            triggers = StaticTreeClass.GetAllTriggerObjects(_dbReg);
            lvEvents.Items.Clear();
            SetCombo();
            LoadUserDesign();
            DataToEdit();

            ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
            SetDesign(FbXpertMainForm.Instance().AppDesign);
            ac = new AutocompleteClass(fctSQL, _dbReg);
            ac.RefreshAutocompleteForDatabase();
            RefreshLanguageText();
            Restart();
        }
示例#18
0
        private void IMPORTDataForm_Load(object sender, EventArgs e)
        {
            FormDesign.SetFormLeft(this);
            ShowCaptions();
            if (DbExplorerForm.Instance().Visible)
            {
                this.Left = DbExplorerForm.Instance().Width + 16;
            }
            FillCHarsets();
            cbEncodingCSV.Text = ToDBCharsetName(Encoding.Default);
            cbEncoding.Text    = DBReg.CharSet;

            ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
            SetDesign(FbXpertMainForm.Instance().AppDesign);
        }
示例#19
0
        public bool Deserialize(string FileName)
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(DatabaseDefinitions));
                Stream        fs         = new FileStream(FileName, FileMode.Open);
                var           reader     = new XmlTextReader(fs);
                var           PF         = (DatabaseDefinitions)serializer.Deserialize(reader);
                reader.Close();
                this.XMLName   = FileName;
                this.Databases = PF.Databases;
                //       this.OpenDatabaseCount = PF.OpenDatabaseCount;

                int pos = 1;
                foreach (DBRegistrationClass dbr in this.Databases)
                {
                    /*
                     * if (string.IsNullOrEmpty(dbr.InitialScriptingPath))     dbr.InitialScriptingPath = StaticVariablesClass.ScriptPath;
                     * if (string.IsNullOrEmpty(dbr.InitialReportPath))        dbr.InitialReportPath = StaticVariablesClass.ReportPath;
                     *
                     * if (string.IsNullOrEmpty(dbr.Collation))                dbr.Collation = StaticVariablesClass.Collation;
                     * if (string.IsNullOrEmpty(dbr.CommentEnd))               dbr.CommentEnd = StaticVariablesClass.CommentEnd;
                     * if (string.IsNullOrEmpty(dbr.CommentStart))             dbr.CommentStart = StaticVariablesClass.CommentStart;
                     * if (string.IsNullOrEmpty(dbr.InitialTerminator))        dbr.InitialTerminator = StaticVariablesClass.InitialTerminator;
                     * if (string.IsNullOrEmpty(dbr.AlternativeTerminator))    dbr.AlternativeTerminator = StaticVariablesClass.AlternativeTerminator;
                     * if (string.IsNullOrEmpty(dbr.SingleLineComment))        dbr.SingleLineComment = StaticVariablesClass.SingleLineComment;
                     */
                    dbr.Position = pos++;
                }

                if (PF.Reason == null)
                {
                    PF.Reason = "none";
                }
                this.Reason = PF.Reason;
                DataState   = EditStateClass.eDataState.Saved;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "DatabaseConfigurationCaption", "CannotLoadDatabaseConfiguration", SEMessageBoxButtons.OK, SEMessageBoxIcon.Exclamation, null, new object[] { Environment.NewLine, FileName });
                return(false);
            }
            finally
            {
            }
            return(true);
        }
示例#20
0
        public ScriptingForm(DBRegistrationClass drc)
        {
            InitializeComponent();
            MdiParent          = FbXpertMainForm.Instance();
            _actScriptingDbReg = drc;
            _lastDirectory     = AppSettingsClass.Instance.PathSettings.ScriptingPath;
            _notifies.Register4Info(FormMeldungRaised);
            _notifies.Register4Error(FormErrorRaised);

            fcbSQL.Clear();
            fcbSQL.SelectionStart = 0;
            string _connstr = ConnectionStrings.Instance.MakeConnectionString(_actScriptingDbReg);

            _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT");
            _sql.ScriptNotify.Register4Info(EventMeldungRaised);
        }
示例#21
0
        private ExperienceInfo AddToLocalInfo(string keycode, string info)
        {
            ExperienceInfo data = null;

            try
            {
                var sh = new ExperienceInfoClass(_dblocalfile);
                data = sh.InsertExperienceInfo(keycode, info);
                sh.ExperienceInfoRefresh(dgvLocalExperienceInfo, txtLocalExperienceKeyCode.Text);
                sh.SortGrid(dgvLocalExperienceInfo, ExperienceInfoClass.SelColInx);
            }
            catch (Exception ex)
            {
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "#Add to Info", $@"#{ex.Message}", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Error);
            }
            return(data);
        }
示例#22
0
        private bool UpdateToInfo()
        {
            bool ok = false;

            try
            {
                var sh = new ExperienceInfoClass(_dbfile);
                ok = sh.UpdateExperienceInfo(ExData);
                sh.ExperienceInfoRefresh(dgvExperienceInfo, txtExperienceKeyCode.Text);
                sh.SortGrid(dgvExperienceInfo, ExperienceInfoClass.SelColInx);
            }
            catch (Exception ex)
            {
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "#Update Info", $@"#{ex.Message}", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Error);
            }
            return(ok);
        }
示例#23
0
        public static bool TabControl_DrawItem(BasicNormalFormClass frm, DrawItemEventArgs e, object control, bool firsttab)
        {
            TabControl tabControl1 = control as TabControl;

            frm.SetDesign(FbXpertMainForm.Instance().AppDesign);
            TabPage  tabPages = tabControl1.TabPages[e.Index];
            Graphics graphics = e.Graphics;

            SolidBrush darkBrush    = new SolidBrush(frm.GetDesignColor(SystemColors.ControlDark));
            SolidBrush controlBrush = new SolidBrush(frm.GetDesignColor(SystemColors.Control));

            SolidBrush darkText  = new SolidBrush(Color.Black);
            SolidBrush lightText = new SolidBrush(Color.White);

            Rectangle    tabBounds = tabControl1.GetTabRect(e.Index);
            Font         tabFont   = frm.Font;
            StringFormat strFormat = new StringFormat
            {
                Alignment     = StringAlignment.Center,
                LineAlignment = StringAlignment.Center
            };

            if (!firsttab)
            {
                e.Graphics.FillRectangle(controlBrush, frm.ClientRectangle);
                firsttab = true;
            }

            if (e.State != DrawItemState.Selected)
            {
                graphics.FillRectangle(controlBrush, e.Bounds);
                graphics.DrawString(tabPages.Text, tabFont, darkText, tabBounds, new StringFormat(strFormat));
            }
            else
            {
                graphics.FillRectangle(darkBrush, e.Bounds); //fill background color
                graphics.DrawString(tabPages.Text, tabFont, lightText, tabBounds, new StringFormat(strFormat));
            }
            darkText.Dispose();
            lightText.Dispose();
            darkBrush.Dispose();
            controlBrush.Dispose();
            graphics.Dispose();
            return(firsttab);
        }
示例#24
0
        private void VIEWManageForm_Load(object sender, EventArgs e)
        {
            FormDesign.SetFormLeft(this);
            RefreshLanguageText();
            fctMessages.Clear();

            ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
            SetDesign(FbXpertMainForm.Instance().AppDesign);
            if (getData)
            {
                RefreshAll();
            }
            else
            {
                RefreshStruct();
            }
            // DBReg.AutocompleteSetTextobjectForDatabase(fctCREATEINSERTSQL);
        }
示例#25
0
        private void EXPORTDataForm_Load(object sender, EventArgs e)
        {
            ShowCaptions();
            if (DbExplorerForm.Instance().Visible)
            {
                this.Left = DbExplorerForm.Instance().Width + 16;
            }

            cbCharSet.Items.Clear();
            cbCharSet.Items.Add(new EncodingClass(Encoding.UTF8));
            cbCharSet.Items.Add(new EncodingClass(Encoding.ASCII));
            cbCharSet.Items.Add(new EncodingClass(Encoding.Default));
            cbCharSet.Items.Add(new EncodingClass(Encoding.Unicode));

            cbCharSet.SelectedIndex = 0;
            gbCharset.Enabled       = cbExportToFile.Checked;
            gbFileName.Enabled      = cbExportToFile.Checked;
            gbFolder.Enabled        = cbExportToFile.Checked;

            ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
            SetDesign(FbXpertMainForm.Instance().AppDesign);
        }
示例#26
0
        private void DoGBAK()
        {
            FileInfo fi = new FileInfo($@"{_dbReg.GetFirebirdBinaryPath()}\gbak.exe");

            if (!fi.Exists)
            {
                object[] p = { fi.FullName, Environment.NewLine };
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "FileNotExistsCaption", "FileNotExists", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Exclamation, null, p);
                return;
            }
            fctGBAKOutput.Clear();
            string args = txtGBAKParameters.Text.Replace("****", _dbReg.Password);
            var    psi  = new ProcessStartInfo($@"{_dbReg.GetFirebirdBinaryPath()}\gbak.exe", args);

            psi.RedirectStandardOutput = true;
            psi.RedirectStandardError  = true;
            psi.UseShellExecute        = false;
            psi.CreateNoWindow         = true;
            fctGBAKOutput.AppendText($@"Starting of GBAK{Environment.NewLine}");

            backgroundWorker1 = new BackgroundWorker();
            backgroundWorker1.WorkerReportsProgress = true;
            backgroundWorker1.ProgressChanged      += backgroundWorker1_ProgressChanged;
            backgroundWorker1.DoWork                    += backgroundWorker1_DoWork;
            backgroundWorker1.RunWorkerCompleted        += backgroundWorker1_RunWorkerCompleted;
            backgroundWorker1.WorkerSupportsCancellation = true;
            backgroundWorker1.RunWorkerAsync();

            ps                     = new Process();
            ps.StartInfo           = psi;
            ps.EnableRaisingEvents = true;
            ps.Exited             += Ps_Exited;

            ps.Start();
            sw = new StreamWatcher(ps.StandardOutput.BaseStream);
            sw.MessageAvailable       += Sw_MessageAvailable;
            sw_error                   = new StreamWatcher(ps.StandardError.BaseStream);
            sw_error.MessageAvailable += Sw_MessageAvailable;
        }
示例#27
0
        private void hsCreateDatabase_Click(object sender, EventArgs e)
        {
            var fi = new FileInfo(txtLocation.Text);

            if (fi.Exists)
            {
                object[] param = { $@"{txtServer.Text}:{txtLocation.Text}", Environment.NewLine };
                if (SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "DatabaseExistsCaption", "OverrideExistingDatabase", SEMessageBoxButtons.NoYes, SEMessageBoxIcon.Asterisk, null, param) == SEDialogResult.Yes)
                {
                    DBProviderSet.CreateDatabase(txtLocation.Text, txtServer.Text, txtUser.Text, txtPassword.Text,
                                                 StaticFunctionsClass.ToIntDef(txtPacketsize.Text, AppSettingsClass.Instance().DatabaseSettings.DefaultPacketSize), true, true);
                }
            }
            else
            {
                if (!fi.Directory.Exists)
                {
                    return;
                }
                DBProviderSet.CreateDatabase(txtLocation.Text, txtServer.Text, txtUser.Text, txtPassword.Text,
                                             StaticFunctionsClass.ToIntDef(txtPacketsize.Text, AppSettingsClass.Instance().DatabaseSettings.DefaultPacketSize), true, true);
            }
        }
示例#28
0
        private void DoISQL()
        {
            //string args = $"-u SYSDBA -p masterkey -r -d {dbReg.DatabasePath}";
            FileInfo fi = new FileInfo($@"{_dbReg.FirebirdBinaryPath}\isql.exe");

            if (fi.Exists)
            {
                string arg = txtISQLPassword.Text.Replace("****", _dbReg.Password);
                var    psi = new ProcessStartInfo(fi.FullName, txtISQLParameters.Text);
                psi.UseShellExecute = false;

                var ps = new Process();
                ps.StartInfo = psi;
                ps.Start();

                ps.WaitForExit();
                ps.Close();
            }
            else
            {
                object[] p = { fi.FullName, Environment.NewLine };
                SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "FileNotExistsCaption", "FileNotExists", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Exclamation, null, p);
            }
        }
示例#29
0
        private void hsDeleteLocalData_Click(object sender, EventArgs e)
        {
            int n = 0;

            foreach (DataGridViewRow dr in dgvLocalExperienceInfo.SelectedRows)
            {
                if (explocal.DeleteExperienceInfoEntry((int)dr.Cells[0].Value))
                {
                    n++;
                }
            }
            if (n > 0)
            {
                try
                {
                    explocal.ExperienceInfoRefresh(dgvLocalExperienceInfo, txtLocalExperienceKeyCode.Text);
                    explocal.SortGrid(dgvLocalExperienceInfo, ExperienceInfoClass.SelColInx);
                }
                catch (Exception ex)
                {
                    SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "#Delete Info", $@"#{ex.Message}", FormStartPosition.CenterScreen, SEMessageBoxButtons.OK, SEMessageBoxIcon.Error);
                }
            }
        }
示例#30
0
 public override void FormLoadFirst()
 {
     base.FormLoadFirst();
     ClearDevelopDesign(FbXpertMainForm.Instance().DevelopDesign);
     SetDesign(FbXpertMainForm.Instance().AppDesign);
 }