Beispiel #1
0
        private void smbtnDatabases_Click(object sender, EventArgs e)
        {
            bool exits = false;
            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(frmDatabases))
                {
                    form.Activate();
                    form.BringToFront();
                    form.WindowState = FormWindowState.Normal;
                    exits = true;
                    break;
                }
            }

            if (!exits)
            {
                frmDatabases frm = new frmDatabases();
                frm.MdiParent = this;
                frm.Show();
            }
        }
Beispiel #2
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtDatabase.Text.Trim().Length < 1)
                {
                    MessageBox.Show("Databse Alias is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                AddNewServer();

                if (_parentForm is frmDatabases)
                {
                    frmDatabases frm = _parentForm as frmDatabases;
                    frm.LoadDatabases();
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #3
0
        private void smbtnDatabases_Click(object sender, EventArgs e)
        {
            bool exits = false;

            foreach (Form form in Application.OpenForms)
            {
                if (form.GetType() == typeof(frmDatabases))
                {
                    form.Activate();
                    form.BringToFront();
                    form.WindowState = FormWindowState.Normal;
                    exits            = true;
                    break;
                }
            }

            if (!exits)
            {
                frmDatabases frm = new frmDatabases();
                frm.MdiParent = this;
                frm.Show();
            }
        }