コード例 #1
0
        private void ExecueteSQL()
        {
            string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg);
            var    _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(InfoRaised);
            _sql.ScriptNotify.Register4Error(ErrorRaised);

            var riList    = _sql.ExecuteCommands(fctSQL.Lines);
            var riFailure = riList.Find(x => x.commandDone == false);

            EditToData();
            if (riFailure == null)
            {
                OrgFieldObject = FieldObject.DeepClone();
                BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit;
                ObjectToEdit(FieldObject);
                MakeSQL();
            }
            AppStaticFunctionsClass.SendResultNotify(riList, localNotify);

            string info = (riFailure == null)
                ? $@"Fields for {_dbReg.Alias}->{FieldObject.TableName} updated."
                : $@"Fields for {_dbReg.Alias}->{FieldObject.TableName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadFields, $@"->Proc:{Name}->ExecueteSQL()");
            _localTableNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadFields);
        }
コード例 #2
0
        private void Create()
        {
            //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify);
            string _connstr  = ConnectionStrings.Instance.MakeConnectionString(_dbReg);
            var    _sql      = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT");
            var    riList    = _sql.ExecuteCommands(fctSQL.Lines);
            var    riFailure = riList.Find(x => x.commandDone == false);

            if (riFailure == null)
            {
                old_constraint_name = txtConstraintName.Text;
            }

            AppStaticFunctionsClass.SendResultNotify(riList, _localNotify);

            string info = (riFailure == null)
                ? $@"Foreign key for {_dbReg.Alias}->{ForeignKeyObject.SourceTableName} updated."
                : $@"Foreign key for {_dbReg.Alias}->{ForeignKeyObject.SourceTableName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadAllForeignKeys, $@"->Proc:{Name}->Create");
            _localNotify.Notify.RaiseInfo(info);


            BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit;
        }
コード例 #3
0
        public void SaveConfig()
        {
            _dbReg.State = eRegState.none;
            var tn = _dbReg.GetNode();

            tn.Text = _dbReg.Alias;
            if (BearbeitenMode == EditStateClass.eBearbeiten.eEdit)
            {
                var drc = DatabaseDefinitions.Instance.Databases.Find(x => x.Position == _dbReg.Position);
                _dbReg.State = eRegState.update;
            }
            else
            {
                _dbReg.Position = DatabaseDefinitions.Instance.Databases.Count + 1;
                DatabaseDefinitions.Instance.Databases.Add(_dbReg);
                DataToEdit();
                _dbReg.State = eRegState.create;
            }

            DatabaseDefinitions.Instance.SerializeCurrent("User changed");

            BearbeitenMode = EditStateClass.eBearbeiten.eEdit;
            if ((_connectionDataChanged) || (_dbReg.State != eRegState.update))
            {
                NotifiesClass.Instance.Notify.RaiseInfo($@"Configuration saved for {_dbReg.Alias}->Proc:{Name}->SaveConfig", StaticVariablesClass.DatabaseConfigDataSaved, (object)_dbReg);
                DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo($@"{_dbReg.Alias}->Proc:{Name}->SaveConfig", StaticVariablesClass.DatabaseConfigDataSaved, (object)_dbReg);
                _connectionDataChanged = false;
            }

            if (_dataChanged)
            {
                tn.Text      = _dbReg.Alias;
                _dataChanged = false;
            }
        }
コード例 #4
0
 private void ShowDbExplorer()
 {
     _dbe             = DbExplorerForm.Instance(this);
     _dbe.WindowState = FormWindowState.Normal;
     _dbe.Show();
     _dbe.BringToFront();
 }
コード例 #5
0
        private void Create()
        {
            //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify);
            string _connstr  = ConnectionStrings.Instance.MakeConnectionString(_dbReg);
            var    _sql      = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT");
            var    riList    = _sql.ExecuteCommands(fctSQL.Lines);
            var    riFailure = riList.Find(x => x.commandDone == false);

            oldIndexColumnName = _indexObject.Name;

            if (_dataFilled)
            {
                MakeSQL();
            }

            AppStaticFunctionsClass.SendResultNotify(riList, _localNotify);


            string info = (riFailure == null)
                ? $@"Index {_dbReg.Alias}->{_indexObject.Name} updated."
                : $@"Index {_dbReg.Alias}->{_indexObject.Name} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadIndex, $@"->Proc:{Name}->Create");
            _localNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadIndex, $@"->Proc:{Name}->Create");
        }
コード例 #6
0
        private void FBXpertMainForm_Load(object sender, EventArgs e)
        {
            //   LanguageClass.Instance().InitEmbedded(this,"FBXpert.Languages","Language","de");
            LanguageClass.Instance().InitFile(this, $@"{Application.StartupPath}\Languages\", "Language", ".", "de");
            LanguageClass.Instance().OnRaiseLanguageExceptionHandler += FbXpertMainForm_OnRaiseLanguageExceptionHandler;
            LanguageClass.Instance().ChangeLanguage(LanguageClass.German);

            Text = $@"FBXpert V {Assembly.GetAssembly(GetType()).GetName().Version}";
            Application.DoEvents();
            var cf = FBXInfo.Instance();

            cf.MdiParent = this;
            cf.Show();

            _dbe = DbExplorerForm.Instance(this);
            if (_dbe.ReadDatabaseDefinition())
            {
                Application.DoEvents();
                NotifiesClass.Instance().InfoThreshold = eInfoLevel.normal;
                _dbe.SetCaption();
                _dbe.Show();
                _dbe.Enabled = false;
                _dbe.MakeDatabaseTree(false);
                _dbe.OpenActiveDatabases();
                if (NotificationsForm.Instance().Visible)
                {
                    NotificationsForm.Instance().Close();
                }
                NotifiesClass.Instance().InfoThreshold = eInfoLevel.few;
            }
            DbExplorerForm.Instance().Enabled = true;
            LanguageClass.Instance().ChangeLanguage(LanguageClass.German);
        }
コード例 #7
0
        private void contextMenuStrip2_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem == tsmiDesignEarth)
            {
                AppDesign = ReloadDesign(eColorDesigns.Earth);

                /*
                 * var pc = new ProgressClockForm(this)
                 * {
                 *  X = 50,
                 *  Y = 200
                 * };
                 * pc.Show();
                 */
            }
            else if (e.ClickedItem == tsmiDesignGray)
            {
                AppDesign = ReloadDesign(eColorDesigns.Gray);
            }
            else if (e.ClickedItem == tsmiAppSettings)
            {
                var af = new AppSettingsForm(this);
                af.Show();
            }
            else if (e.ClickedItem == tsmiDatabaseDesign)
            {
                DatabaseDesignForm.Instance.SetParent(MdiParent);
                DatabaseDesignForm.Instance.Show();
            }
            else if (e.ClickedItem == tsmiCreateUUID)
            {
                var uuid = new UUIDForm(MdiParent);
                uuid.Show();
            }
            else if (e.ClickedItem == tsmiScripting)
            {
                var dbReg = new DBRegistrationClass();
                var dbm   = new ScriptingForm(dbReg);
                dbm.Show();
            }
            else if (e.ClickedItem == tsmiDatabasRegistration)
            {
                var cfg = new DatabaseConfigForm(Instance(), ActRegistrationObject, DbExplorerForm.Instance().GetTree(), DbExplorerForm.Instance().GetTree().Nodes.Count, EditStateClass.eBearbeiten.eEdit);
                cfg.Show();
            }
            else if (e.ClickedItem == tsmiGerman)
            {
                LanguageClass.Instance.ChangeLanguage(LanguageConsts.Deutsch);
            }
            else if (e.ClickedItem == tsmiEnglish)
            {
                LanguageClass.Instance.ChangeLanguage(LanguageConsts.Englisch);
            }
            else if (e.ClickedItem == tsmiJapanese)
            {
                LanguageClass.Instance.ChangeLanguage(LanguageConsts.Japanisch);
            }
        }
コード例 #8
0
        private void Create()
        {
            var _sql      = new SQLScriptingClass(_dbReg, "SCRIPT", _localNotify);
            var riList    = _sql.ExecuteCommands(fctSQL.Lines);
            var riFailure = riList.Find(x => x.commandDone = false);

            string info = (riFailure == null)
                ? $@"Table {_dbReg.Alias}->{_tableObject.Name} updated."
                : $@"Table {_dbReg.Alias}->{_tableObject.Name} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadTable, $@"->Proc:{Name}->Create");
            _localNotify.Notify.RaiseInfo(info);
        }
コード例 #9
0
ファイル: VIEWManageForm.cs プロジェクト: eksotama/FBXpert
 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)");
 }
コード例 #10
0
ファイル: VIEWManageForm.cs プロジェクト: eksotama/FBXpert
 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();
 }
コード例 #11
0
        private void DatabaseCompareFrom_Load(object sender, EventArgs e)
        {
            LanguageChanged();
            hsSearchDown.Enabled = false;
            hsSearchUp.Enabled   = false;
            hsSeach.Enabled      = txtSearchCode.TextLength > 0;

            //  fbdSourcePath.SelectedPath = AppSettingsClass.Instance().PathSettings.DesignClassesOutputPath;
            ShowCaptions();
            if (DbExplorerForm.Instance().Visible)
            {
                Left = DbExplorerForm.Instance().Width + 16;
            }
            GetAllDatabases();
        }
コード例 #12
0
        private void CreateNewTableForm_Load(object sender, EventArgs e)
        {
            if (this.Left < DbExplorerForm.Instance().Width + 16)
            {
                this.Left = DbExplorerForm.Instance().Width + 16;
            }

            _dataFilled = false;

            FillCombos();

            SetVisible();
            _dataFilled = true;
            MakeSQL(true);
        }
コード例 #13
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);
        }
コード例 #14
0
 public static void SetFormLeft(Form frm)
 {
     if (DbExplorerForm.Instance().Visible)
     {
         int left = DbExplorerForm.Instance().Width + DbExplorerForm.Instance().Left;
         if (frm.Left < left)
         {
             frm.Left = left + 2;
         }
         return;
     }
     if (frm.Left < 0)
     {
         frm.Left = 0;
     }
 }
コード例 #15
0
 private void cmsNotifications_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem == tsmiNotes)
     {
         NotificationsForm.Instance().SetMDIForm(this);
         int wdh = DbExplorerForm.Instance().Width + 16;
         NotificationsForm.Instance().SetLeft = wdh;
         NotificationsForm.Instance().Set();
         NotificationsForm.Instance().Show();
     }
     else if (e.ClickedItem == tsmiErrors)
     {
         NotificationsForm.Instance().SetMDIForm(this);
         NotificationsForm.Instance().SetLeft = DbExplorerForm.Instance().Width + 16;
         NotificationsForm.Instance().Set();
         NotificationsForm.Instance().Show();
     }
 }
コード例 #16
0
ファイル: XMLDesignForm.cs プロジェクト: eksotama/FBXpert
 private void XMLDesignForm_Load(object sender, EventArgs e)
 {
     LanguageChanged();
     hsSearchDown.Enabled               = false;
     hsSearchUp.Enabled                 = false;
     hsSeach.Enabled                    = txtSearchCode.TextLength > 0;
     fbdSourcePath.SelectedPath         = _dbReg.CodeSettings.SourceCodeOutputPath;
     txtSourceCodePath.Text             = _dbReg.CodeSettings.SourceCodeOutputPath;
     rbGenerateInrWithGenerator.Checked = _dbReg.CodeSettings.SourceCodePrimaryKeyType == eSourceCodePrimaryKeyType.GeneratorInteger;
     rbGenerateGUID.Checked             = _dbReg.CodeSettings.SourceCodePrimaryKeyType == eSourceCodePrimaryKeyType.UUID;
     txtDBNamespace.Text                = _dbReg.CodeSettings.SourceCodeNamespace;
     ShowCaptions();
     if (DbExplorerForm.Instance().Visible)
     {
         Left = DbExplorerForm.Instance().Width + 16;
     }
     RefreshXml();
     FillDBObjects();
 }
コード例 #17
0
        private void Create()
        {
            //var _sql = new SQLScriptingClass(_dbReg,"SCRIPT",_localNotify);

            string _connstr = ConnectionStrings.Instance.MakeConnectionString(_dbReg);
            var    _sql     = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT");
            var    riList   = _sql.ExecuteCommands(fctSQL.Lines);

            var riFailure = riList.Find(x => x.commandDone == false);

            AppStaticFunctionsClass.SendResultNotify(riList, _localNotify);

            string info = (riFailure == null)
                ? $@"NotNull {_dbReg.Alias}->Field:{cbFields.Text}->NOT NULL Constraint:{txtConstraintName.Text} updated."
                : $@"NotNull {_dbReg.Alias}->Field:{cbFields.Text}->NOT NULL Constraint {txtConstraintName.Text} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadConstraits, $@"->Proc:{Name}->Create");
            _localNotify.Notify.RaiseInfo(info);
        }
コード例 #18
0
        private void Create()
        {
            var _sql   = new SQLScriptingClass(_dbReg, "SCRIPT", _localNotify);
            var riList = _sql.ExecuteCommands(fctSQL.Lines);

            var riFailure = riList.Find(x => x.commandDone = false);

            oldIndexName = NewIndexName;
            if (DataFilled)
            {
                MakeSQL();
            }

            string info = (riFailure == null)
                ? $@"Index {_dbReg.Alias}->{NewIndexName} updated."
                : $@"Index {_dbReg.Alias}->{NewIndexName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, Constants.ReloadIndex, $@"->Proc:{Name}->Create");
            _localNotify.Notify.RaiseInfo(info, Constants.ReloadIndex, $@"->Proc:{Name}->Create");
        }
コード例 #19
0
        private void ExecueteSQL()
        {
            var _sql      = new SQLScriptingClass(_dbReg, "SCRIPT", localNotify);
            var riList    = _sql.ExecuteCommands(fctSQL.Lines);
            var riFailure = riList.Find(x => x.commandDone == false);

            EditToObject();
            if (riFailure == null)
            {
                OrgFieldObject = FieldObject.DeepClone();
                BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit;
                ObjectToEdit(FieldObject);
                MakeSQL();
            }
            string info = (riFailure == null)
                ? $@"Fields for {_dbReg.Alias}->{FieldObject.TableName} updated."
                : $@"Fields for {_dbReg.Alias}->{FieldObject.TableName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadFields, $@"->Proc:{Name}->Create");
            _localTableNotify.Notify.RaiseInfo(info);
        }
コード例 #20
0
ファイル: ForeignKeyForm.cs プロジェクト: eksotama/FBXpert
        private void Create()
        {
            var _sql      = new SQLScriptingClass(_dbReg, "SCRIPT", _localNotify);
            var riList    = _sql.ExecuteCommands(fctSQL.Lines);
            var riFailure = riList.Find(x => x.commandDone = false);

            if (riFailure == null)
            {
                old_constraint_name = txtConstraintName.Name;
            }


            string info = (riFailure == null)
                ? $@"Foreign key for {_dbReg.Alias}->{ForeignKeyObject.SourceTableName} updated."
                : $@"Foreign key for {_dbReg.Alias}->{ForeignKeyObject.SourceTableName} not updated !!!{Environment.NewLine}{riFailure.nErrors} errors, last error:{riFailure.lastError}";

            DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo(info, StaticVariablesClass.ReloadForeignKeys, $@"->Proc:{Name}->Create");
            _localNotify.Notify.RaiseInfo(info);


            BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit;
        }
コード例 #21
0
ファイル: EXPORTDataForm.cs プロジェクト: eksotama/FBXpert
        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);
        }
コード例 #22
0
        private void FieldForm_Load(object sender, EventArgs e)
        {
            if (this.Left < DbExplorerForm.Instance().Width + 16)
            {
                this.Left = DbExplorerForm.Instance().Width + 16;
            }
            DataFilled = false;
            //FillCombos();


            if (BearbeitenMode == StateClasses.EditStateClass.eBearbeiten.eInsert)
            {
                dsDependencies.Clear();
            }
            else
            {
                RefreshAll();
            }

            rbUseFIELDTYPE.Checked = true;
            SetVisible();
            DataFilled = true;
            MakeSQL();
        }
コード例 #23
0
        private void DatabaseConfigForm_Load(object sender, EventArgs e)
        {
            oldserver            = _dbReg.Server;
            fbdPath.SelectedPath = $@"{Application.StartupPath}\{_dbReg.Version}\fbclient.dll";
            if (this.Left < DbExplorerForm.Instance().Width + 16)
            {
                this.Left = DbExplorerForm.Instance().Width + 16;
            }
            LanguageChanged();
            ShowCaptions();

            if (BearbeitenMode == EditStateClass.eBearbeiten.eEdit)
            {
                DataToEdit();
                if (Cloned)
                {
                    BearbeitenMode = EditStateClass.eBearbeiten.eInsert;
                }
            }
            else
            {
                NewDataToEdit();
            }
        }
コード例 #24
0
        private void FBXpertMainForm_Load(object sender, EventArgs e)
        {
            //   LanguageClass.Instance.InitEmbedded(this,"FBXpert.Languages","Language","de");
            ProgramAttributes.Instance.Init(System.Reflection.Assembly.GetExecutingAssembly());
            LanguageClass.Instance.InitFile(this.GetType().Assembly, $@"{ApplicationPathClass.Instance.ApplicationPath}\Languages\", "Language", ".", "de");
            LanguageClass.Instance.OnRaiseLanguageExceptionHandler += FbXpertMainForm_OnRaiseLanguageExceptionHandler;
            LanguageClass.Instance.ChangeLanguage(LanguageConsts.Deutsch);
            string test = LanguageClass.Instance.GetString("test");


            this.Text = $@"{ProgramAttributes.Instance.GetAppName()} V {ProgramAttributes.Instance.GetAppVersion()}";

            Application.DoEvents();

            FBXInfo.Instance.MdiParent = this;
            FBXInfo.Instance.Show();

            _dbe = DbExplorerForm.Instance(this);

            string pf = $@"{AppSettingsClass.Instance.PathSettings.DatabasesConfigPath}\{AppSettingsClass.Instance.PathSettings.DatabaseConfigFile}";
            bool   dz = DatabaseDefinitions.Instance.Deserialize(pf);

            SetLastLoadedDefinition(pf);
            if (dz)
            {
                Application.DoEvents();
                NotifiesClass.Instance.InfoGranularity = eMessageGranularity.normal;
                _dbe.SetCaption();
                _dbe.Show();
                _dbe.Enabled = false;
                _dbe.MakeDatabaseTree(false);
                int n = DatabaseDefinitions.Instance.CountToOpen();
                if (n > AppSettingsClass.Instance.DatabaseSettings.OpenDatabaseCount)
                {
                    object[] p = { n, Environment.NewLine };
                    if (SEMessageBox.ShowMDIDialog(FbXpertMainForm.Instance(), "OpenDatabases", "DoYouWantOpenDatabases", FormStartPosition.CenterScreen,
                                                   SEMessageBoxButtons.NoYes, SEMessageBoxIcon.Exclamation, null, p) == SEDialogResult.Yes)
                    {
                        _dbe.OpenActiveDatabases();
                    }
                    else
                    {
                        DatabaseDefinitions.Instance.DataState = EditStateClass.eDataState.UnSaved;
                        DatabaseDefinitions.Instance.MarkDatabasesActiv(false);
                    }
                }
                else
                {
                    _dbe.OpenActiveDatabases();
                }
                if (NotificationsForm.Instance().Visible)
                {
                    NotificationsForm.Instance().Close();
                }
                NotifiesClass.Instance.InfoGranularity = eMessageGranularity.few;
            }
            DbExplorerForm.Instance().Enabled = true;
            LanguageClass.Instance.ChangeLanguage(LanguageConsts.Deutsch);
            SEHotSpot.Controller.Instance.NewKeyboardHooks(this);
            DbExplorerForm.Instance().Select();
        }
コード例 #25
0
        private void hsRestore_Click(object sender, EventArgs e)
        {
            n = 0;
            var ca = new ConnectionAttributes();

            ca.Server = DBReg.Server;
            //SE  ca.Client = DRC.Client;
            ca.DatabasePath   = txtRestoreDetinationDatabasePath.Text;
            ca.Password       = DBReg.Password;
            ca.User           = DBReg.User;
            ca.ConnectionType = DBReg.ConnectionType;
            ca.CharSet        = DBReg.CharSet;
            ca.PacketSize     = DBReg.PacketSize;
            ca.Port           = DBReg.Port;

            string connstr = ConnectionStrings.Instance().MakeConnectionString(ca);

            lvRestoreMessage.Items.Clear();
            var bu = new RestoreClass(connstr);

            bu.Restore.ServiceOutput += Restore_ServiceOutput;

            var lf = new List <FirebirdSql.Data.Services.FbBackupFile>();



            for (int i = 0; i < lvRestore.Items.Count; i++)
            {
                ListViewItem lvi = lvRestore.Items[i];
                FirebirdSql.Data.Services.FbBackupFile bf = (FirebirdSql.Data.Services.FbBackupFile)lvi.Tag;

                lf.Add(bf);
            }
            bu.SetFiles(lf.ToArray());

            if (rbReplaceDatabase.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.Replace);
            }
            else
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.Create);
            }
            if (cbRestoreNoIndices.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.DeactivateIndexes);
            }
            if (cbRestoreNoShadows.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.NoShadow);
            }
            if (cbRestoreInvidualCommit.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.IndividualCommit);
            }
            if (cbRestoreMetatdataOnly.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.MetaDataOnly);
            }
            if (cbRestoreNoVaildy.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.NoValidity);
            }
            if (cbRestoreUseAllSpace.Checked)
            {
                bu.AddOptions(FirebirdSql.Data.Services.FbRestoreFlags.UseAllSpace);
            }
            ConnectionPoolClass.Instance().CloseAllConnections();
            if (ConnectionPoolClass.Instance().AktCON != null)
            {
                ConnectionPoolClass.Instance().AktCON.Close();
            }
            bu.Execute();
            DbExplorerForm.Instance().MakeDatabaseTree(true);
        }