Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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();
            }
        }