Пример #1
0
        private void ObjectBackToDev_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "DBObject");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            if (!IsDevServer())
            {
                MessageBox.Show("This server is not a development server - Changing the status is not allowed.", "Change Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                ConnectionString = GetServerConnectionString(AliasName);

                LoadObjectStatusDetail();
            }

            if (CurrentObjectText.Trim() == "")
            {
                CurrentObjectText = GetObjectText(ConnectionString, DatabaseName, ObjectName);

                CurrentObjectText = gs.ChangeCreateToAlter(CurrentObjectText);
            }
        }
Пример #2
0
        private void ObjectUndoCheckOut_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "DBObject");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            ConnectionString = GetServerConnectionString(AliasName);

            LoadObjectStatusDetail();

            GetPreviousVersion();

            if (CurrentObjectText.Trim() == "")
            {
                CurrentObjectText = GetObjectText(ConnectionString, DatabaseName, ObjectName);

                CurrentObjectText = gs.ChangeCreateToAlter(CurrentObjectText);
            }
        }
Пример #3
0
        private void DBObject_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "SSMSDBObject");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            tsbViewObject.Enabled = false;
            //tsbCheckInOut.Enabled = false;
            tsbHistory.Enabled = false;
            //tsbCompare.Enabled = false;

            tDatabaseName.Text = DatabaseName;
            tObjectName.Text   = ObjectName;

            LoadSelectedObject();
        }
Пример #4
0
        private void CheckCombo_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                //sn.ConnectionString = DefaultConnectionString;

                DataTable dt = sn.SingleUser(Environment.UserName, "CheckCombo");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            XMLServerAlias = gs.ServerAliasSelected;

            if (XMLServerAlias.Trim() != "")
            {
                if (!GetServerDetail(XMLServerAlias))
                {
                    //Get the databases on the default connection

                    LoadDatabaseNames();
                    cAll.Checked = true;
                }

                LoadDatabaseNames();

                DatabaseSelection = gs.DatabaseSelection;

                if (DatabaseSelection.Trim() == "")
                {
                    cAll.Checked = true;
                }
                else
                {
                    LoadDatabaseSelection();
                    SetChecks();
                }
            }
            else
            {
                //Get the databases on the default connection

                LoadDatabaseNames();
                cAll.Checked = true;
            }

            this.Height = 30;
        }
Пример #5
0
        private void AddProject_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "AddProject");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserID = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            LoadServerGroups();
        }
Пример #6
0
        private void CompareObjectsMulti_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "CompareObject");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            GetServers(UserID);
        }
Пример #7
0
        private void ProjectBackup_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "ProjectBackup");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            GetServers();

            cmdBackup.Enabled = false;
        }
Пример #8
0
        private void ServerSettings_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "ServerSettings");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            this.Text = "Server Settings - " + UserName;

            LoadServerNames();

            tsbSave.Enabled           = false;
            tsbTestConnection.Enabled = false;
        }
Пример #9
0
        private void DBObjectMulti_Load(object sender, EventArgs e)
        {
            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "DBObject");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            tsbFilter.Enabled       = false;
            tsbRemoveFilter.Enabled = false;
            tsbViewObject.Enabled   = false;
            //tsbCheckInOut.Enabled = false;
            tsbHistory.Enabled = false;
            tsbCompare.Enabled = false;
        }
Пример #10
0
        private void Search_Load(object sender, EventArgs e)
        {
            Loading = true;

            using (DataStuff sn = new DataStuff())
            {
                DataTable dt = sn.SingleUser(Environment.UserName, "Search");

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        UserName = row["UserName"].ToString();
                        UserID   = Convert.ToInt32(row["UserID"].ToString());
                    }
                }
            }

            cmdSearch.Text       = "Go";
            cmdSearch.ImageIndex = 0;

            dbCheckBox1.ConnectionString        = ConnectionString;      //This one gets changed when the server alias changes.
            dbCheckBox1.DefaultConnectionString = StoreConnectionString; //This is the main connection to the source control db

            dbCheckBox1.Parent = this;
            dbCheckBox1.Left   = 903;
            dbCheckBox1.Top    = 2;
            dbCheckBox1.BringToFront();
            dbCheckBox1.SelectionChangedDatabase += DatabaseChanged;
            dbCheckBox1.RefreshDatabase          += RedoSearchDB;

            objectSelector1.BringToFront();
            objectSelector1.SelectionChangedObjectSelector += ObjectsChanged;

            dbCheckBox1.BringToFront();

            scMain.Left  = pSearch.Left;
            scMain.Width = this.Width - 20;

            scMain.Top    = 40;
            scMain.Height = this.Height - scMain.Top - 5;

            pDetail.Top    = pStatusBar.Top + pStatusBar.Height + 5;
            pDetail.Height = scMain.Panel2.Height - pDetail.Top;
            pDetail.Width  = pStatusBar.Width;

            cmdSearch.Enabled = false;

            DatabasesSelected = dbCheckBox1.DatabaseSelection;
            ObjectsSelected   = objectSelector1.ObjectsSelected;

            dgvDetail.Visible = false;
            tDetail.Visible   = true;

            LoadEnvironments();
            cbEnvironment.Text = gs.ServerAliasSelected;

            Search_Resize(sender, e);

            tSearchString.Focus();

            Loading = false;
        }