Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }