Exemplo n.º 1
0
        private FbXpertMainForm()
        {
            InitializeComponent();

            NotificationsForm.Instance().Init();
            NotifiesClass.Instance().Notify.OnRaiseInfoHandler += InfoRaised;
            NotifiesClass.Instance().Notify.OnRaiseErrorHandler += ErrorRaised;

            LanguageClass.Instance().OnRaiseLanguageChangedHandler += FBXpertMainForm_OnRaiseLanguageChangedHandler;
            NotificationsForm.Instance().SetMDIForm(this);

            string appfile = Application.StartupPath + "\\config\\AppSettings.json";

            if (File.Exists(appfile))
            {
                AppSettingsClass appset = fastJSON.JSON.ToObject(File.ReadAllText(appfile)) as AppSettingsClass;
                AppSettingsClass.Instance().Load(appset);
            }
            else
            {
                AppSettingsClass.Instance();
            }
            NotifiesClass.Instance().InfoThreshold = eInfoLevel.normal;

            //(eInfoLevel) AppSettingsClass.Instance().BehavierSettings.DebugThreshold;
        }
Exemplo n.º 2
0
        public IMPORTDataForm(Form parent, DBRegistrationClass drc)
        {
            InitializeComponent();
            this.MdiParent = parent;

            localNotify = new NotifiesClass()
            {
                ErrorGranularity = eMessageGranularity.never
            };
            localNotify.Register4Info(InfoRaised);
            localNotify.Register4Error(ErrorRaised);

            DBReg = drc;

            var tableObjects = StaticTreeClass.Instance().GetAllNonSystemTableObjectsComplete(DBReg);

            if (tableObjects.Count <= 0)
            {
                return;
            }

            foreach (var tc in tableObjects.Values)
            {
                selTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTables.CheckChecks();
            SelectAllTableFields();
        }
Exemplo n.º 3
0
        void ErrorRaised(object sender, MessageEventArgs k)
        {
            _cmdError++;
            tabERRORS.Text = $@"Errors ({_cmdError})";

            if ((txtErrIntervall.Inhalt.Length > 0) && (cbErrAutoclear.Checked))
            {
                if (rtfERRORS.Lines.Length > Int32.Parse(txtErrIntervall.Inhalt))
                {
                    rtfERRORS.Clear();
                }
            }
            if (rbErrAppend.Checked)
            {
                rtfERRORS.AppendText(k.Meldung);
                if (cbAutoSrcollErr.Checked)
                {
                    rtfERRORS.SelectionStart = rtfERRORS.TextLength;
                    rtfERRORS.Select(rtfERRORS.TextLength, 0);
                    rtfERRORS.ScrollToCaret();
                    rtfERRORS.Refresh();
                }
            }
            else
            {
                rtfERRORS.Text.Insert(0, k.Meldung);
            }
            NotifiesClass nf = _localNotifies.Find("GLOBAL");

            if (nf != null)
            {
                nf.Notify.OnRaiseError(k);
            }
        }
Exemplo n.º 4
0
        public FieldForm(DBRegistrationClass dbReg, Form parent, TreeNode tableNode, TableFieldClass fieldObject, NotifiesClass lnotify, StateClasses.EditStateClass.eBearbeiten bearbeitenMode)
        {
            InitializeComponent();

            DataFilled     = false;
            this.MdiParent = parent;
            _dbReg         = dbReg;
            TableNode      = tableNode;
            var tc = (TableClass)tableNode.Tag;

            TableObject    = tc.Clone() as TableClass;
            BearbeitenMode = bearbeitenMode;
            FillCombos();
            if (BearbeitenMode == StateClasses.EditStateClass.eBearbeiten.eInsert)
            {
                NewFieldObject();
            }
            else
            {
                FieldObject                = fieldObject;
                FieldObject.IsPrimary      = TableObject.IsPrimary(FieldObject.Name);
                FieldObject.Domain.NotNull = TableObject.IsNotNull(FieldObject.Name);
                FieldObject.TableName      = TableObject.Name;
            }

            OrgFieldObject = FieldObject.DeepClone();
            ObjectToEdit(FieldObject);

            _localTableNotify = (lnotify == null) ? new NotifiesClass() : lnotify;

            DataFilled = false;
            _localTableNotify.Register4Info(TableInfoRaised);
            localNotify.Register4Info(InfoRaised);
            localNotify.Register4Error(ErrorRaised);
        }
Exemplo n.º 5
0
 public ReportDesignForm(Form parent, DBRegistrationClass dbReg, NotifiesClass notifies)
 {
     InitializeComponent();
     _notifies = notifies;
     _dbReg    = dbReg;
     SetMdiParent(parent);
 }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
 public SQLScriptingClassOLD(DBRegistrationClass drc, string connectionName = "SCRIPT", NotifiesClass pNotifies = null, NotifiesClass eventNotifies = null)
 {
     _parentNotifies = pNotifies;
     _eventNotifies  = eventNotifies;
     _connectionName = connectionName;
     _drc            = drc;
     _connstr        = ConnectionStrings.Instance().MakeConnectionString(_drc);
     _aktCommand     = new SCRIPTCommandClass();
 }
Exemplo n.º 8
0
        public int RefreshFields()
        {
            if (string.IsNullOrEmpty(ViewObject.Name))
            {
                return(lvFields.Items.Count);
            }

            string         cmd = SQLStatementsClass.Instance().GetViewFields(DBReg.Version, ViewObject.Name);
            ViewFieldClass vf  = null;

            lvFields.Items.Clear();
            dgExportGrid.Rows.Clear();
            try
            {
                var con = new FbConnection(ConnectionStrings.Instance().MakeConnectionString(DBReg));
                con.Open();
                var fcmd  = new FbCommand(cmd, con);
                var dread = fcmd.ExecuteReader();
                if (dread.HasRows)
                {
                    while (dread.Read())
                    {
                        object ob = dread.GetValue(0);
                        object ob_field_position = dread.GetValue(1);

                        string fieldstr   = ob.ToString();
                        string posstr     = ob_field_position.ToString();
                        string typename   = dread.GetValue(3).ToString();
                        string typelength = dread.GetValue(4).ToString();

                        vf = new ViewFieldClass()
                        {
                            Name = fieldstr.Trim()
                        };

                        string[] obarr        = { posstr.Trim(), fieldstr.Trim(), typename.Trim(), typelength.Trim() };
                        object[] obarr_export = { posstr.Trim(), fieldstr.Trim(), true, true };

                        var lvi = new ListViewItem(obarr)
                        {
                            Tag     = vf,
                            Checked = true
                        };
                        lvFields.Items.Add(lvi);
                        dgExportGrid.Rows.Add(obarr_export);
                    }
                }
                con.Close();
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR(BasicClassLibrary.StaticFunctionsClass.DateTimeNowStr() + " ViewManagerForm->RefreshDependenciesFrom->" + ex.Message);
            }
            return(lvFields.Items.Count);
        }
Exemplo n.º 9
0
        private void EXPORTDataForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.WindowState = FormWindowState.Normal;
            if (localNotify == null)
            {
                return;
            }

            localNotify.Notify.OnRaiseInfoHandler  -= new NotifyInfos.RaiseNotifyHandler(InfoRaised);
            localNotify.Notify.OnRaiseErrorHandler -= new NotifyInfos.RaiseNotifyHandler(ErrorRaised);
            localNotify = null;
        }
Exemplo n.º 10
0
 public static string ConvertDesignType(string name, int length)
 {
     if (name == "LONG")
     {
         switch (length)
         {
         case 4: return("NUMBER");
         }
     }
     else if (name == "TIMESTAMP")
     {
         switch (length)
         {
         case 8: return("TIMESTAMP");
         }
     }
     else if (name == "VARYING")
     {
         return("VARCHAR2");
     }
     else if (name == "DOUBLE")
     {
         switch (length)
         {
         case 8: return("DOUBLE PRECISION");
         }
     }
     else if (name == "DATE")
     {
         return("DATE");
     }
     else if (name == "TIME")
     {
         return("TIME");
     }
     else if (name == "SHORT")
     {
         return("NUMBER");
     }
     else if (name == "BOOLEAN")
     {
         return("BOOLEAN");
     }
     else if (name == "BLOB")
     {
         return("BLOB");
     }
     NotifiesClass.Instance().AddToERROR("Datatype:" + name + " not defined !!! (StaticVariables->ConvertDiesignType)");
     return("UNDEFINED");
 }
Exemplo n.º 11
0
        public SelectDefaultForm(Form parent, NotifiesClass locNotify)
        {
            InitializeComponent();
            this.MdiParent = parent;
            localNotify    = locNotify;
            cbDefaults.Items.Clear();
            cbDefaults.Items.Add("CURRENT_USER");
            cbDefaults.Items.Add("CURRENT_DATE");
            cbDefaults.Items.Add("CURRENT_TIMESTAMP");
            cbDefaults.Items.Add("CURRENT_TIME");
            cbDefaults.Items.Add("CURRENT_ROLE");
            cbDefaults.Items.Add("CURRENT_PATH");

            cbDefaults.SelectedIndex = 0;
        }
Exemplo n.º 12
0
        public SelectDefaultForm(Form parent, NotifiesClass locNotify, string key, string[] items)
        {
            InitializeComponent();
            this.MdiParent = parent;
            localNotify    = locNotify;
            _key           = key;
            cbDefaults.Items.Clear();
            foreach (string s in items)
            {
                cbDefaults.Items.Add(s);
            }


            cbDefaults.SelectedIndex = 0;
        }
Exemplo n.º 13
0
        public MeasurementClass(MeasurementConfigClass measConfig, bool worker)
        {
            mcc = measConfig;

            nf = new NotifiesClass();
            nf.Register4Info(InfoRaised);
            nf.Register4Error(ErrorRaised);
            if (worker)
            {
                measWorker = new System.ComponentModel.BackgroundWorker();
                this.measWorker.WorkerReportsProgress      = true;
                this.measWorker.WorkerSupportsCancellation = true;
                this.measWorker.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.measWorker_DoWork);
                this.measWorker.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.measWorker_ProgressChanged);
                this.measWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.measWorker_RunWorkerCompleted);
            }
        }
Exemplo n.º 14
0
        public void WaitClosed(ConnectionClass cc1, string str)
        {
            int n = 0;

            while (!cc1.ConnectionIsClosed() && (n < 10))
            {
                Thread.Sleep(200);
                n++;
            }

            if (cc1.ConnectionIsClosed())
            {
                return;
            }
            if (NotifiesClass.Instance().AllowErrors)
            {
                NotifiesClass.Instance().AddToERROR("Timeout for Connection " + cc1.ConnName + " while " + str);
            }
        }
Exemplo n.º 15
0
        private void hsExport_Click(object sender, EventArgs e)
        {
            var ew = new ExportWorkers(NotifiesClass.Instance())
            {
                alltables = new List <TableClass>()
            };

            ew.alltables.Clear();
            ew.AktDBReg      = DBReg;
            ew.ShowScripting = cbViewInScript.Checked;
            ew.WriteToFile   = cbExportToFile.Checked;

            if (ew.WriteToFile)
            {
                if ((txtFileName.Text.IndexOf(".", StringComparison.Ordinal)) < 0)
                {
                    txtFileName.Text += ".sql";
                }
                var di = ActFolder.Tag as DirectoryInfo;
                ew.SQLFileInfo = new FileInfo(di?.FullName + "\\" + txtFileName.Text);
                ew.CharSet     = cbCharSet.SelectedItem as EncodingClass;
            }
            else
            {
                ew.SQLFileInfo = null;
            }


            for (int i = 0; i < selTables.ItemDatas.Count; i++)
            {
                var itm = selTables.ItemDatas[i] as ItemDataClass;
                var tc  = itm.Object as TableClass;
                tc.State = selTables.GetItemCheckState(i);
                if (tc.State != CheckState.Checked)
                {
                    continue;
                }
                ew.alltables.Add(tc);
            }

            ew.StartworkerGetTableData(ew.alltables, DBReg, ew.SQLFileInfo);
        }
Exemplo n.º 16
0
        public int RefreshDependenciesFrom()
        {
            dsDependencies.Clear();
            dgvDependencies.AutoGenerateColumns = true;
            string cmd_index = SQLStatementsClass.Instance().GetViewManagerDependenciesFROM(DBReg.Version, ViewObject.Name);

            try
            {
                var           con = new FbConnection(ConnectionStrings.Instance().MakeConnectionString(DBReg));
                FbDataAdapter ds  = new FbDataAdapter(cmd_index, con);
                ds.Fill(dsDependencies);
                con.Close();
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR(BasicClassLibrary.StaticFunctionsClass.DateTimeNowStr() + " ViewManagerForm->RefreshDependenciesFrom->" + ex.Message);
            }
            bsDependencies.DataMember = "Table";

            return(dsDependencies.Tables[0].Rows.Count);
        }
Exemplo n.º 17
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);
            }
            else
            {
                _dbReg.Position = DatabaseDefinitions.Instance().Databases.Count + 1;
                DatabaseDefinitions.Instance().Databases.Add(_dbReg);
                DataToEdit();
            }

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

            _dbReg.State = Cloned ? eRegState.create : eRegState.update;

            BearbeitenMode = EditStateClass.eBearbeiten.eEdit;
            if (_connectionDataChanged)
            {
                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;
            }

            if (Cloned)
            {
                Close();
            }
        }
Exemplo n.º 18
0
        public int RefreshDependenciesTo()
        {
            string cmd = SQLStatementsClass.Instance().GetDepentenciesGenerators(_dbReg.Version, GeneratorObject.Name);

            try
            {
                dsDependenciesTo.Clear();
                dgvDependenciesTo.AutoGenerateColumns = true;

                var con = new FbConnection(ConnectionStrings.Instance().MakeConnectionString(_dbReg));
                var ds  = new FbDataAdapter(cmd, con);
                ds.Fill(dsDependenciesTo);
                con.Close();
                bsDependenciesTo.DataMember = "Table";
                return(dsDependenciesTo.Tables[0].Rows.Count);
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR($@"{StaticFunctionsClass.DateTimeNowStr()} GeneratorForm -> RefreshDependenciesTo: {ex.Message}");
            }
            return(0);
        }
Exemplo n.º 19
0
        public int RefreshMonitorConnections()
        {
            GetConnections();
            try
            {
                string cmd_index = SQLStatementsClass.Instance().GetMonitorConnections(DBReg.Version, cbAllConnections.Checked);
                dsMonConnections.Clear();
                dgvMonConnections.AutoGenerateColumns = true;

                var con = new FbConnection(ConnectionStrings.Instance().MakeConnectionString(DBReg));
                var ds  = new FbDataAdapter(cmd_index, con);
                ds.Fill(dsMonConnections);
                con.Close();
                bsMonConnections.DataMember = "Table";
                return(dsMonConnections.Tables[0].Rows.Count);
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR(AppStaticFunctionsClass.GetFormattedError($@"{Name}-> RefreshMonitorConnections()", ex));
            }
            bsMonConnections.DataMember = "Table";
            return(dsMonConnections.Tables[0].Rows.Count);
        }
Exemplo n.º 20
0
        public SQLViewForm1(DBRegistrationClass ca, List <TableClass> actTables, Form mdiParent = null, eColorDesigns appDesign = eColorDesigns.Gray, eColorDesigns developDesign = eColorDesigns.Gray, bool testMode = false)
        {
            MdiParent      = mdiParent;
            _dbReg         = ca;
            _actTables     = actTables;
            _appDesign     = appDesign;
            _developDesign = developDesign;
            InitializeComponent();

            var nf = new NotifiesClass();

            nf.gaugeNotify.OnRaiseGaugeHandler += new NotifyGauge.RaiseGaugeHandler(GaugeRaised);
            _localNotifies.AddNotify(nf, "SQLViewForm");
            _localNotifies.AddNotify(NotifiesClass.Instance(), "GLOBAL");
            _sqLcommand           = new SQLCommandsClass(_dbReg, _localNotifies.Find("SQLViewForm"));
            tabPageSucceeded.Text = "commands succeded DESC";
            Meldungen();
            Errors();
            History();
            ClearDevelopDesign(_developDesign);
            SetDesign(_appDesign);
            cbTestlauf.Checked = testMode;
            cbTestlauf.Visible = testMode;
        }
Exemplo n.º 21
0
        public CreateNewTableForm(DBRegistrationClass dbReg, Form parent, NotifiesClass lnotify)
        {
            InitializeComponent();
            MdiParent = parent;
            _dbReg    = dbReg;


            _tableObject      = new TableClass();
            _tableObject.Name = "NEW_TABLE";

            _fieldObject      = new TableFieldClass();
            _fieldObject.Name = "ID";
            //_fieldObject.RawType = "INTEGER";
            _fieldObject.Domain.Name    = "ID";
            _fieldObject.Domain.RawType = "INTEGER";
            _localTableNotify           = lnotify;

            _dataFilled = false;
            DataToEdit();
            cbPrimaryKey.Enabled = true;
            _localTableNotify.Notify.OnRaiseInfoHandler += new NotifyInfos.RaiseNotifyHandler(TableInfoRaised);
            _localNotify.Notify.OnRaiseInfoHandler      += new NotifyInfos.RaiseNotifyHandler(InfoRaised);
            _localNotify.Notify.OnRaiseErrorHandler     += new NotifyInfos.RaiseNotifyHandler(ErrorRaised);
        }
Exemplo n.º 22
0
        private SQLCommandsReturnInfoClass ExecSql(HistoryMode toHistory)
        {
            dataSet1.Clear();
            dgvResults.AutoGenerateColumns = true;
            if (txtSQL.Text.Length <= 0)
            {
                return(new SQLCommandsReturnInfoClass());
            }

            _sqLcommand.SetEncoding(cbEncoding.Text);
            var ri = _sqLcommand.ExecuteCommandWithGlobalConnection(txtSQL.Lines);

            lblUsedMs.Text = ri.costs.ToString();
            dataSet1       = ri.dataSet;

            if (dataSet1?.Tables.Count > 0)
            {
                bindingSource1.DataSource = dataSet1;
                bindingSource1.DataMember = "Table";
            }
            else if (ri.lastCommandType == SQLCommandType.select)
            {
                NotifiesClass.Instance().AddToERROR("SQLViewForm->ExecSql->No datas selected");
                _localNotifies?.AddToERROR("SQLViewForm->ExecSql->No datas selected");
            }

            if (ri.commandDone)
            {
                AddToHistory(toHistory, ri.lastSQL);
            }
            else
            {
                AddToFailedHistory(toHistory, ri.lastSQL);
            }
            return(ri);
        }
Exemplo n.º 23
0
        public int RefreshDependencies()
        {
            dsDependencies.Clear();
            dgvDependenciesTo.AutoGenerateColumns = true;

            string cmd_index = SQLStatementsClass.Instance().GetFieldDependencies(_dbReg.Version, TableObject.Name, FieldObject.Name);

            try
            {
                var           con = new FbConnection(ConnectionStrings.Instance().MakeConnectionString(_dbReg));
                FbDataAdapter ds  = new FbDataAdapter(cmd_index, con);
                ds.Fill(dsDependencies);
                con.Close();
                bsDependencies.DataMember = "Table";
                bsDependencies.DataSource = dsDependencies;

                return(dsDependencies.Tables[0].Rows.Count);
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR($"{StaticFunctionsClass.DateTimeNowStr()}->FieldForm->RefreshDependencies->{ex.Message}");
            }
            return(0);
        }
Exemplo n.º 24
0
        public EXPORTDataForm(Form parent, DBRegistrationClass drc)
        {
            InitializeComponent();
            this.MdiParent = parent;

            localNotify = new NotifiesClass()
            {
                NotifyType  = eNotifyType.ErrorWithoutMessage,
                AllowErrors = false
            };
            localNotify.Notify.OnRaiseInfoHandler  += new NotifyInfos.RaiseNotifyHandler(InfoRaised);
            localNotify.Notify.OnRaiseErrorHandler += new NotifyInfos.RaiseNotifyHandler(ErrorRaised);

            DBReg = drc;

            var viewobjects      = StaticTreeClass.GetViewObjects(DBReg);
            var tableObjects     = StaticTreeClass.GetAllTableObjectsComplete(DBReg);
            var domainObjects    = StaticTreeClass.GetDomainObjects(DBReg);
            var generatorObjects = StaticTreeClass.GetGeneratorObjects(DBReg);
            var indecesObjects   = StaticTreeClass.GetIndecesObjects(DBReg);
            var triggerObjects   = StaticTreeClass.GetTriggerObjects(DBReg);
            //var procedureObjects = StaticTreeClass.GetAllProcedureObjects(DBReg);
            var procedureObjects = StaticTreeClass.GetProcedureObjects(DBReg);
            var functionObjects  = StaticTreeClass.GetInternalFunctionObjects(DBReg);

            if (tableObjects.Count <= 0)
            {
                return;
            }

            foreach (var tc in tableObjects.Values)
            {
                selTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTables.CheckChecks();

            foreach (var tc in tableObjects.Values)
            {
                selStructureTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selStructureTables.CheckChecks();

            SelectAllTableFields();

            foreach (var tc in viewobjects.Values)
            {
                selStructureViews.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selStructureViews.CheckChecks();

            foreach (var tc in domainObjects.Values)
            {
                if ((tc.ToString().StartsWith("RDB$")) || (tc.ToString().StartsWith("SEC$")) || (tc.ToString().StartsWith("MON$")))
                {
                    continue;
                }
                selDomains.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selDomains.CheckChecks();

            foreach (var tc in generatorObjects.Values)
            {
                if ((tc.ToString().StartsWith("RDB$")) || (tc.ToString().StartsWith("SEC$")) || (tc.ToString().StartsWith("MON$")))
                {
                    continue;
                }
                selGenerators.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selGenerators.CheckChecks();


            foreach (var tc in triggerObjects.Values)
            {
                selTriggerStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTriggerStructure.CheckChecks();


            foreach (var tc in indecesObjects.Values)
            {
                selIndeces.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selIndeces.CheckChecks();

            foreach (var tc in procedureObjects.Values)
            {
                selProceduresStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selProceduresStructure.CheckChecks();

            foreach (var tc in functionObjects.Values)
            {
                selFunctionsStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selFunctionsStructure.CheckChecks();

            var itm = selTables.ItemDatas[0] as ItemDataClass;

            TableObject = itm.Object as TableClass;

            selExportStructureList.AllowMultipleChecks = true;

            selExportStructureList.Add("Domains", CheckState.Checked, new DomainClass());
            selExportStructureList.Add("UDFs", CheckState.Checked, new UserDefinedFunctionClass());
            selExportStructureList.Add("Generators", CheckState.Checked, new GeneratorClass());
            selExportStructureList.Add("Procedures", CheckState.Checked, new ProcedureClass());
            selExportStructureList.Add("Functions", CheckState.Checked, new FunctionClass());
            selExportStructureList.Add("Tables", CheckState.Checked, new TableClass());
            selExportStructureList.Add("Views", CheckState.Checked, new ViewClass());
            selExportStructureList.Add("Check constraints", CheckState.Checked, new ChecksClass());
            selExportStructureList.Add("Unique constraints", CheckState.Checked, new UniquesClass());
            selExportStructureList.Add("Primary keys", CheckState.Checked, new PrimaryKeyClass());
            selExportStructureList.Add("Foreign keys", CheckState.Checked, new ForeignKeyClass());
            selExportStructureList.Add("Indices", CheckState.Checked, new IndexClass());
            selExportStructureList.Add("Triggers", CheckState.Checked, new TriggerClass());

            selExportStructureList.Add("UDF descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Generator descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Procedure descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Table descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Table field descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("View descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("View field descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Index descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Trigger descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Procedure parameter descriptions", CheckState.Checked, new object());
        }
Exemplo n.º 25
0
        private void hsExportStructure_Click(object sender, EventArgs e)
        {
            var ew = new ExportWorkers(NotifiesClass.Instance())
            {
                allviews = new List <ViewClass>()
            };

            ew.allviews.Clear();

            ew.alltables = new List <TableClass>();
            ew.alltables.Clear();

            ew.allPKConstraints = new Dictionary <string, PrimaryKeyClass>();
            ew.allPKConstraints.Clear();

            ew.allFKConstraints = new Dictionary <string, ForeignKeyClass>();
            ew.allFKConstraints.Clear();

            ew.allDomains = new Dictionary <string, DomainClass>();
            ew.allDomains.Clear();

            ew.allGenerator = new Dictionary <string, GeneratorClass>();
            ew.allGenerator.Clear();

            ew.allTrigger = new Dictionary <string, TriggerClass>();
            ew.allTrigger.Clear();

            ew.allIndeces = new Dictionary <string, IndexClass>();
            ew.allIndeces.Clear();

            ew.allProcedures = new Dictionary <string, ProcedureClass>();
            ew.allProcedures.Clear();

            ew.allFunctions = new Dictionary <string, FunctionClass>();
            ew.allFunctions.Clear();

            ew.AktDBReg                  = DBReg;
            ew.ShowScripting             = cbViewObjectScript.Checked;
            ew.WriteToFile               = cbObjectExportToFile.Checked;
            ew.CommitAfterStatement      = cbStructureCommit.Checked;
            ew.CreateConnectionStatement = cbStructureConnectiionStatement.Checked;
            ew.CreateDatabaseStatement   = cbStructureCreateDatabaseStatement.Checked;
            ew.CreateMode                = (rbCREATEObject.Checked) ? eCreateMode.create : eCreateMode.recreate;

            if (ew.WriteToFile)
            {
                if ((txtFileName.Text.IndexOf(".")) < 0)
                {
                    txtFileName.Text += ".sql";
                }
                var di = ActFolder.Tag as DirectoryInfo;
                ew.SQLFileInfo = new FileInfo(di.FullName + "\\" + txtFileName.Text);
                ew.CharSet     = cbCharSet.SelectedItem as EncodingClass;
            }
            else
            {
                ew.SQLFileInfo = null;
            }



            ew.StartworkerGetDatabaseStructure(DBReg, ew.SQLFileInfo);

            foreach (var itm in selExportStructureList.CheckedItemDatasNotNulls)
            {
                //if ((itm.Check != CheckState.Checked)||(itm.Object == null)) continue;

                if (itm.Object.GetType() == typeof(TableClass))
                {
                    ew.alltables.AddRange(ExportTableStructure(ew));
                    ew.StartworkerGetTableStructure(ew.alltables, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(ViewClass))
                {
                    ew.allviews.AddRange(ExportViewStructure(ew));
                    ew.StartworkerGetViewStructure(ew.allviews, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(PrimaryKeyClass))
                {
                    ExportPKTableStructure(ew);
                    ew.StartworkerGetPKTableStructure(ew.allPKConstraints, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(ForeignKeyClass))
                {
                    ExportFKTableStructure(ew);
                    ew.StartworkerGetFKTableStructure(ew.allFKConstraints, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(DomainClass))
                {
                    ExportDomainStructure(ew);
                    ew.StartworkerGetDomainStructure(ew.allDomains, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(GeneratorClass))
                {
                    ExportGeneratorStructure(ew);
                    ew.StartworkerGetGeneratorStructure(ew.allGenerator, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(IndexClass))
                {
                    ExportIndecesStructure(ew);
                    ew.StartworkerGetIndecesStructure(ew.allIndeces, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(TriggerClass))
                {
                    ExportTriggerStructure(ew);
                    ew.StartworkerGetTriggerStructure(ew.allTrigger, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(ProcedureClass))
                {
                    ExportProcedureStructure(ew);
                    ew.StartworkerGetProcedureDefinitionStructure(ew.allProcedures, DBReg, ew.SQLFileInfo);

                    ew.StartworkerGetProcedureStructure(ew.allProcedures, DBReg, ew.SQLFileInfo);
                }
                else if (itm.Object.GetType() == typeof(FunctionClass))
                {
                    ExportFunctionStructure(ew);
                    ew.StartworkerGetFunctionDefinitionStructure(ew.allFunctions, DBReg, ew.SQLFileInfo);

                    ew.StartworkerGetFunctionStructure(ew.allFunctions, DBReg, ew.SQLFileInfo);
                }
            }

            ew.WaitForWorker();
            ew.MakeScript();
            NotificationsForm.Instance().Close();
        }
Exemplo n.º 26
0
        public int RefreshDatas(string cmd)
        {
            int errorsCnt     = 0;
            int errorsAllowed = BasicClassLibrary.StaticFunctionsClass.ToIntDef(txtMaxAllowedErrors.Text, 0);

            if (string.IsNullOrEmpty(ViewObject.Name))
            {
                return(dsViewContent.Tables[0].Rows.Count);
            }
            try
            {
                long.TryParse(txtMaxRows.Text, out var maxRows);

                dgvResults.AutoGenerateColumns = true;
                GetDataWorker.ReportProgress(1, "Reading data...");
                long skip = 0;

                if (_dataConnection != null)
                {
                    if (_dataConnection.State != System.Data.ConnectionState.Closed)
                    {
                        _dataConnection.Close();
                    }
                }
                _dataConnection = new FbConnection(ConnectionStrings.Instance().MakeConnectionString(DBReg));
                _dataConnection.Open();
                var cnt = DBReg.SkipForSelect;
                var sk  = DBReg.SkipForSelect;
                if ((maxRows > 0) && (cnt > maxRows))
                {
                    cnt = maxRows;
                    sk  = cnt;
                }
                string cmds = string.Empty;
                while ((cnt >= sk) && (skip < maxRows || maxRows <= 0))
                {
                    try
                    {
                        if (this.GetDataWorker.CancellationPending)
                        {
                            return(0);
                        }
                        cmds = $@"SELECT FIRST {sk} SKIP {skip} {cmd};";
                        var ds = new FbDataAdapter(cmds, _dataConnection);

                        cnt = ds.Fill(dsViewContent);
                        GetDataWorker.ReportProgress(1, "..." + skip.ToString());
                        skip += cnt;
                    }
                    catch (Exception ex)
                    {
                        _localNofity.AddToERROR($@"{BasicClassLibrary.StaticFunctionsClass.DateTimeNowStr()}->{this.Name}->RefreshDatas({cmds}), msg:{ex.Message}");
                        errorsCnt++;

                        if (errorsCnt > errorsAllowed)
                        {
                            GetDataWorker.CancelAsync();
                        }
                    }
                }
                _dataConnection.Close();
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR($@"{BasicClassLibrary.StaticFunctionsClass.DateTimeNowStr()}->{this.Name}->RefreshDatas({cmd}), msg:{ex.Message}");
            }
            return(dsViewContent.Tables[0].Rows.Count);
        }
Exemplo n.º 27
0
 private void DoCreateAlter(IList <string> cmd, DBRegistrationClass DBReg, NotifiesClass _localNofity, string Name)
 {
     var SQLcommand = new SQLCommandsClass(DBReg, _localNofity);
     var ri         = SQLcommand.ExecuteCommand(cmd, true);
 }
Exemplo n.º 28
0
        private bool CreateDatabase(string sqlCmd)
        {
            /*
             *  CREATE DATABASE 'localhost:D:\Data\kj\KJFERT59.FDB'
             *  USER 'SYSDBA' PASSWORD 'masterkey'
             *  PAGE_SIZE 8192
             *  DEFAULT CHARACTER SET NONE;
             */
            string sql        = sqlCmd.ToUpper();
            string location   = "D:\\Data\\test111.FDB";
            string server     = "localhost";
            string user       = "******";
            string password   = "******";
            string packetsize = "8192";

            int inx = sql.IndexOf("CREATE DATABASE ", StringComparison.Ordinal);

            if (inx >= 0)
            {
                string cmd3 = sqlCmd.Substring(inx + 16);
                int    inx2 = cmd3.IndexOf(" ", StringComparison.Ordinal);
                string arg  = cmd3.Substring(0, inx2);

                int inx3 = arg.IndexOf(":\\", StringComparison.Ordinal);
                int inx4 = arg.IndexOf(":", StringComparison.Ordinal);
                if (inx4 < inx3)
                {
                    //server
                    server   = arg.Substring(0, inx4).Replace("'", "");
                    location = arg.Substring(inx4 + 1);
                    location = location.Replace("'", "");
                }
                else
                {
                    //nur dateipfad
                    server   = "localhost";
                    location = arg.Replace("'", "");
                }
            }

            inx = sql.IndexOf("USER ", StringComparison.Ordinal);
            if (inx >= 0)
            {
                string cmd3 = sqlCmd.Substring(inx + 5);
                int    inx2 = cmd3.IndexOf(" ", StringComparison.Ordinal);
                string arg  = cmd3.Substring(0, inx2);
                user = arg.Replace("'", "");
            }

            inx = sql.IndexOf("PASSWORD ", StringComparison.Ordinal);
            if (inx >= 0)
            {
                string cmd3 = sqlCmd.Substring(inx + 9);
                int    inx2 = cmd3.IndexOf(" ", StringComparison.Ordinal);
                string arg  = cmd3.Substring(0, inx2);
                password = arg.Replace("'", "");
            }

            inx = sql.IndexOf("PAGE_SIZE ", StringComparison.Ordinal);
            if (inx >= 0)
            {
                string cmd3 = sqlCmd.Substring(inx + 10);
                int    inx2 = cmd3.IndexOf(" ", StringComparison.Ordinal);
                string arg  = cmd3.Substring(0, inx2);
                packetsize = arg;
            }

            try
            {
                _parentNotifies?.AddToINFO(StaticFunctionsClass.DateTimeNowStr() + " ...Creating new database via script " + server + ":" + location);
                DBProviderSet.CreateDatabase(location, server, user, password, StaticFunctionsClass.ToIntDef(packetsize, AppSettingsClass.Instance().DatabaseSettings.DefaultPacketSize));
            }
            catch (Exception ex)
            {
                NotifiesClass.Instance().AddToERROR(AppStaticFunctionsClass.GetFormattedError($@"{sqlCmd}-> CreateDatabase()", ex));
            }

            return(true);
        }
Exemplo n.º 29
0
        public static TreeNode GetNewNode(string name)
        {
            TreeNode         node;
            ContextMenuStrip cmnull = new ContextMenuStrip();

            switch (name.ToUpper())
            {
            case StaticVariablesClass.DatabaseKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Database",
                    Tag  = new DBRegistrationClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsDatabase,
                    ImageIndex = (int)eImageIndex.DATABASE_INACTIVE
                };
                return(node);

            case StaticVariablesClass.ProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Procedures",
                    Tag  = new ProceduresGroupClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsProcedureGroup,
                    ImageIndex = (int)eImageIndex.PROCEDURE
                };
                return(node);

            case StaticVariablesClass.ProceduresKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Procedures",
                    Tag  = new ProcedureClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsProcedure,
                    ImageIndex = (int)eImageIndex.PROCEDURE
                };
                return(node);

            case StaticVariablesClass.FunctionsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "User defined functions",
                    Tag  = new UserDefinedFunctionGroupClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsFunctionGroup,
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.UserDefinedFunctionsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "User defined functions",
                    Tag  = new UserDefinedFunctionGroupClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsUserDefinedFunctionGroup,
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.ForeignKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsForeignKeyGroup,
                    Text       = "Foreign Keys",
                    Tag        = new ForeignKeyGroupClass(),
                    ImageIndex = (int)eImageIndex.KEYS
                };
                return(node);

            case StaticVariablesClass.PrimaryKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsPrimaryKeyGroup,
                    Text       = "Primary Keys",
                    Tag        = new PrimaryKeyGroupClass(),
                    ImageIndex = (int)eImageIndex.PRIMARYKEY
                };
                return(node);

            case StaticVariablesClass.PrimaryKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsPrimaryKey,
                    Text       = "Primary Key",
                    Tag        = new PrimaryKeyClass(),
                    ImageIndex = (int)eImageIndex.PRIMARYKEY
                };
                return(node);

            case StaticVariablesClass.ConstraintsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsContraintsGroup,
                    Text       = "Constraints",
                    Tag        = new ConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.KEYS
                };
                return(node);

            case StaticVariablesClass.ConstraintsKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsContraints,
                    Text       = "Constraint",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.KEYS
                };
                return(node);

            case StaticVariablesClass.FunctionsKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsFunction,
                    Text       = "Function",
                    Name       = name.ToUpper(),
                    Tag        = new FunctionClass(),
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.UserDefinedFunctionsKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsUserDefinedFunction,
                    Text       = "User defined function",
                    Name       = name.ToUpper(),
                    Tag        = new UserDefinedFunctionClass(),
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.ForeignKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsForeignKey,
                    Text       = "Foreign Key",
                    Tag        = new ForeignKeyClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.FOREIGNKEY
                };
                return(node);

            case StaticVariablesClass.FieldsKeyStr:

                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Field",
                    Tag        = new TableFieldClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.FieldsKeyGroupStr:

                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Fields",
                    Name       = name.ToUpper(),
                    Tag        = new TableFieldGroupClass(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.ViewFieldsKeyStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Field",
                    Tag        = new ViewFieldClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.ViewFieldsKeyGroupStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Fields",
                    Name       = name.ToUpper(),
                    Tag        = new  ViewFieldGroupClass(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.UniquesKeyGroupStr:
                node = new TreeNode()
                {
                    ContextMenuStrip = cmnull,
                    Text             = "Uniques",
                    //    Name = StaticVariablesClass.UniquesKeyGroupStr,
                    Tag        = new  UniqueConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.UNIQUE
                };
                return(node);

            case StaticVariablesClass.UniquesKeyStr:

                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Unique",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.UNIQUE
                };

                return(node);

            case StaticVariablesClass.NotNullKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Not Nulls",
                    Name       = name.ToUpper(),
                    Tag        = new NotNullConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.NOTNULL
                };
                return(node);

            case StaticVariablesClass.NotNullKeyStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Not Null",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.NOTNULL
                };
                return(node);

            case StaticVariablesClass.ChecksKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Checks",
                    Name       = name.ToUpper(),
                    Tag        = new ChecksKeyConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.CHECK
                };
                return(node);

            case StaticVariablesClass.ChecksKeyStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Check",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.CHECK
                };
                return(node);

            case StaticVariablesClass.DependenciesKeyGroupStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesTablesKeyGroupStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Tables",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToTablesKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies To",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromTablesKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies From",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Triggers",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies To",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependencies From",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesToTriggersKeyStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependency to",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromTriggersKeyStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependency from",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesViewsKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Views",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToViewsKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Depends on Views",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesToViewsKeyStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Depends to View",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromViewsKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependencies from Views",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesFromViewsKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends from View",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);


            case StaticVariablesClass.DependenciesFromKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Dependencies from ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesFromKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends from ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesToKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Dependencies to ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesToKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends to ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);


            case StaticVariablesClass.DependenciesProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Procedures",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends on Procedures",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesToProceduresKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends on procedure",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Dependencies From",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesFromProceduresKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends from procedure",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.TriggersKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "Triggers",
                    Name = name.ToUpper(),
                    Tag  = new TriggerGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsTriggerGroup,
                    ImageIndex = (int)eImageIndex.TRIGGERS
                };

                return(node);

            case StaticVariablesClass.TriggersKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsTrigger,
                    Text       = "Trigger",
                    Tag        = new TriggerClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.TRIGGERS
                };
                return(node);

            case StaticVariablesClass.IndicesKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "Indices",
                    Name = name.ToUpper(),
                    Tag  = new IndexGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsIndicesGroup,
                    ImageIndex = (int)eImageIndex.INDEX
                };
                return(node);

            case StaticVariablesClass.IndicesKeyStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = ContextMenusClass.Instance().cmsIndices,
                    Text       = "Index",
                    Tag        = new IndexClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.INDEX
                };
                return(node);

            case StaticVariablesClass.RolesKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Roles",
                    Tag  = new RoleGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsRolesGroup,
                    ImageIndex = (int)eImageIndex.ROLES
                };
                return(node);

            case StaticVariablesClass.RolesKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsRoles,
                    Text       = "Role",
                    Tag        = new RoleClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.ROLES
                };
                return(node);

            case StaticVariablesClass.GeneratorsKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "Generators",
                    Name = name.ToUpper(),
                    Tag  = new GeneratorGroupClass(),
                    // ContextMenuStrip = ContextMenusClass.Instance().cmsGeneratorGroup,
                    ImageIndex = (int)eImageIndex.GENERATORS
                };
                return(node);

            case StaticVariablesClass.GeneratorsKeyStr:
                node = new TreeNode()
                {
                    Text = "Generators",
                    Name = name.ToUpper(),
                    Tag  = new GeneratorClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsGenerator,
                    ImageIndex = (int)eImageIndex.GENERATORS
                };
                return(node);

            case StaticVariablesClass.CommonTablesKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Tables",
                    Tag  = new TableGroupClass(),
                    //  ContextMenuStrip = ContextMenusClass.Instance().cmsTableGroup,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.TablesKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Table",
                    Tag  = new TableClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsTable,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.SystemTablesKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "System Tables",
                    Tag  = new SystemTableGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsSystemTableGroup,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.SystemTablesKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Systemtable",
                    Tag  = new SystemTableClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsSystemTable,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.ViewsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Views",
                    Tag  = new ViewGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsViewGroup,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);

            case StaticVariablesClass.ViewsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "View",
                    Tag  = new ViewClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsView,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);


            case StaticVariablesClass.ConstraintsViewsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Constraints Views",
                    Tag  = new ViewGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsViewGroup,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);

            case StaticVariablesClass.ConstraintsViewsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Constraints for View",
                    Tag  = new ViewClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsView,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);

            case StaticVariablesClass.DomainsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Domains",
                    Tag  = new DomainGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsDomainGroup,
                    ImageIndex = (int)eImageIndex.DOMAIN
                };
                return(node);

            case StaticVariablesClass.DomainsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Domain",
                    Tag  = new DomainClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsDomain,
                    ImageIndex = (int)eImageIndex.DOMAIN
                };
                return(node);
            }
            NotifiesClass.Instance().AddToERROR("DataCLassFactory->GetNode->" + name + " not created", "GetNode");
            return(null);
        }
Exemplo n.º 30
0
        static public long SendResultNotify(List <SQLCommandsReturnInfoClass> riList, NotifiesClass notify)
        {
            long costs = 0;

            foreach (var ri in riList)
            {
                costs += ri.costs;
                if (ri.commandDone)
                {
                    notify.Notify.RaiseInfo($@"Done: {ri.lastSQL}{Environment.NewLine}", StaticVariablesClass.ReloadFields);
                }
                else
                {
                    notify.Notify.RaiseError($@"ERROR: {ri.lastSQL}->{ri.lastError}{Environment.NewLine}", StaticVariablesClass.ReloadFields);
                }
            }
            return(costs);
        }