Example #1
0
        public void RefreshUtilityServerList()
        {
            string SelectedUtilityServer = "";

            //Check to see if the lstServerNames is loaded and has a selected item
            if (lstServerNames.SelectedItem != null)
            {
                SelectedUtilityServer = lstServerNames.SelectedItem.ToString();
            }

            //reload server list
            LoadTabData.LoadUtilityServerList(LoadTabData.CurrentCentralUtilityServer);
            lstServerNames.ClearSelected();
            lstServerNames.Items.Clear();
            if (LoadTabData.ServerList != null)
            {
                lstServerNames.Items.AddRange(LoadTabData.ServerList);
            }

            //Re-select the selected item from before the refresh
            if ((lstServerNames.Items.Contains(SelectedUtilityServer)) && (SelectedUtilityServer != string.Empty))
            {
                int index = lstServerNames.FindStringExact(SelectedUtilityServer);
                if (index != -1)
                {
                    lstServerNames.SetSelected(index, true);
                }
            }

            Application.DoEvents();
        }
        private void btnConnect_Click(object sender, EventArgs e)
        {
            this.toolStripStatusLabel.Text = "Loading Database Maintenance Utility Console...";
            Application.DoEvents();

            //Set public variable to keep track of currently selected CentralUtility server
            LoadTabData.CurrentCentralUtilityServer = this.txtCentralUtilityServer.Text;

            //Load the new main console form
            LoadTabData.LoadConsoleForm();

            //Close the old main console form if open
            int cnt = 0;

            foreach (Form OpenForm in Application.OpenForms)
            {
                if (OpenForm.Name == "frmMain")
                {
                    cnt++;
                }
            }
            if (cnt > 1)
            {
                CloseOpenForm(typeof(frmMain));
            }

            //Hide the connection manager
            this.Hide();
        }
Example #3
0
        private void RefreshBackupPlansView()
        {
            //Set vars
            DataTable vwGetBackupPlans = new DataTable("vwGetBackupPlans");
            int       SelectedIndex    = this.lstServerNames.SelectedIndex;

            LoadTabData.CurrentUtilityServer = this.lstServerNames.Items[SelectedIndex].ToString();

            //Load datatable
            vwGetBackupPlans = LoadTabData.LoadBackupPlans(LoadTabData.CurrentUtilityServer);

            //Load the data grid view
            this.dgvBackupPlans.DataSource = vwGetBackupPlans;

            //Resize the columns
            this.dgvBackupPlans.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
        }