/// <summary>
 /// On 'Login' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         txtUserName.Text = txtUserName.Text.Trim();
         txtPassword.Text = txtPassword.Text.Trim();
         if (txtUserName.Text.ToLower() == "admin" && txtPassword.Text == "cybro")
         {
             this.Close();
             frmStoredProcedureInserter frmStoredProcedureInserter = new frmStoredProcedureInserter();
             frmStoredProcedureInserter _isOpen = Application.OpenForms["frmStoredProcedureInserter"] as frmStoredProcedureInserter;
             if (_isOpen == null)
             {
                 frmStoredProcedureInserter.WindowState = FormWindowState.Normal;
                 frmStoredProcedureInserter.MdiParent = formMDI.MDIObj;//formMDI.frmMDI;
                 frmStoredProcedureInserter.Show();
             }
             else
             {
                 _isOpen.MdiParent = formMDI.MDIObj;
                 if (_isOpen.WindowState == FormWindowState.Minimized)
                 {
                     _isOpen.WindowState = FormWindowState.Normal;
                 }
                 if (_isOpen.Enabled)
                 {
                     _isOpen.Activate();
                     _isOpen.BringToFront();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("QRYL:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #2
0
 /// <summary>
 /// On 'Login' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         txtUserName.Text = txtUserName.Text.Trim();
         txtPassword.Text = txtPassword.Text.Trim();
         if (txtUserName.Text.ToLower() == "admin" && txtPassword.Text == "cybro")
         {
             this.Close();
             frmStoredProcedureInserter frmStoredProcedureInserter = new frmStoredProcedureInserter();
             frmStoredProcedureInserter _isOpen = Application.OpenForms["frmStoredProcedureInserter"] as frmStoredProcedureInserter;
             if (_isOpen == null)
             {
                 frmStoredProcedureInserter.WindowState = FormWindowState.Normal;
                 frmStoredProcedureInserter.MdiParent   = formMDI.MDIObj;//formMDI.frmMDI;
                 frmStoredProcedureInserter.Show();
             }
             else
             {
                 _isOpen.MdiParent = formMDI.MDIObj;
                 if (_isOpen.WindowState == FormWindowState.Minimized)
                 {
                     _isOpen.WindowState = FormWindowState.Normal;
                 }
                 if (_isOpen.Enabled)
                 {
                     _isOpen.Activate();
                     _isOpen.BringToFront();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "QRYL:2" + ex.Message;
     }
 }