private void button4_Click(object sender, EventArgs e)
        {
            if (cbFM.Checked == true || cbSM.Checked == true || cbSD.Checked == true || rbtnA.Checked == true ||
                rbtnB.Checked == true || rbtnC.Checked == true || cmbContribution.SelectedIndex != -1 || txtAmount.Text != "")
            {
                DialogResult = MessageBox.Show("Leave Form?", "Alert", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (DialogResult == DialogResult.Yes)
                {
                    switch (RegForm.Cross)
                    {
                    case 0:
                    case 1:
                    case 2:
                        tr = true;
                        this.Close();
                        RegForm.Cross = 3;
                        RegForm RegForm1 = new RegForm();
                        RegForm1.Show();
                        return;

                    case 4:
                        tr    = true;
                        Cross = 0;
                        this.Close();
                        RunnerMenu RunnerMenu = new RunnerMenu();
                        RunnerMenu.Show();
                        return;
                    }
                }
            }
            else
            {
                switch (RegForm.Cross)
                {
                case 0:
                case 1:
                case 2:
                    tr = true;
                    this.Close();
                    RegForm.Cross = 3;
                    RegForm RegForm1 = new RegForm();
                    RegForm1.Show();
                    return;

                case 4:
                    tr    = true;
                    Cross = 0;
                    this.Close();
                    RunnerMenu RunnerMenu = new RunnerMenu();
                    RunnerMenu.Show();
                    return;
                }
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     tr = true;
     this.Close();
     if (DBConnection.Connect() == true)
     {
         RegForm RegForm = new RegForm();
         RegForm.Show();
     }
     else
     {
         RegOrLoginForm Form = new RegOrLoginForm();
         Form.Show();
     }
 }