Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            // ConnectServer
            if (Login.Text.Length < 4 || Login.Text.Length < 4)
            {
                MessageBox.Show("Логін та пароль мають складатися не менше ніж з 4 символів!");
                return;
            }
            rs.Login = Login.Text;
            rs.Parol = Parol.Text;
            rs       = ConnectServer.GetDataServer(rs);
            //rs = new RiskManagementLib();
            rs.isCorrect = 1;
            if (rs.isCorrect == 0)
            {
                MessageBox.Show("Неправильний логін або пароль!");
                return;
            }


            if (FormS == null)
            {
                FormS   = new FormSources(rs);
                thread1 = new Thread(new ParameterizedThreadStart(FormInThread));
                thread1.Start(FormS);
            }
            else if (FormS.IsDisposed)
            {
                FormS   = new FormSources(rs);
                thread1 = new Thread(new ParameterizedThreadStart(FormInThread));
                thread1.Start(FormS);
            }
            Close();
        }
 internal void ActivateFormSources(RiskManagementLib rs)
 {
     if (Application.OpenForms["FormSources"] == null)
     {
         formSources = new FormSources(rs);
         thread1     = new Thread(new ParameterizedThreadStart(FormInThread));
         thread1.Start(formSources);
     }
     else
     {
         SetForegroundWindow(rs.FormSourcesProcess);
     }
 }
Esempio n. 3
0
 private void джерелаПоявиРизиківToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (FormS == null)
     {
         FormS   = new FormSources(rs);
         thread1 = new Thread(new ParameterizedThreadStart(FormInThread));
         thread1.Start(FormS);
     }
     else if (FormS.IsDisposed)
     {
         FormS   = new FormSources(rs);
         thread1 = new Thread(new ParameterizedThreadStart(FormInThread));
         thread1.Start(FormS);
     }
 }