Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            tr = true;
            this.Close();
            RunnerControl Form = new RunnerControl();

            Form.Show();
        }
Exemplo n.º 2
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         DBConnection.GetEmail = dataGridView1.CurrentRow.Cells[2].Value.ToString();
         tr = true;
         this.Close();
         RunnerControl Form = new RunnerControl();
         Form.Show();
     }
 }
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = MessageBox.Show("Leave Regestration?", "Alert", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (DialogResult == DialogResult.Yes)
            {
                switch (RegForm.Cross)
                {
                case 1:
                    tr = true;
                    this.Close();
                    RunnerControl RCForm = new RunnerControl();
                    RCForm.Show();
                    return;

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

                case 0:
                case 2:
                case 4:
                    tr    = true;
                    Cross = 0;
                    this.Close();
                    RunnerMenu RunnerMenu = new RunnerMenu();
                    RunnerMenu.Show();
                    return;
                }
            }
        }
Exemplo n.º 4
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (MyRecords.RecorcdsArrow == 1)
     {
         tr = true;
         this.Close();
         RunnerMenu RMForm = new RunnerMenu();
         RMForm.Show();
     }
     else
     {
         tr = true;
         this.Close();
         RunnerControl RCForm = new RunnerControl();
         RCForm.Show();
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            if ((cbFM.Checked == true || cbSM.Checked == true || cbSD.Checked == true) &&
                (rbtnA.Checked == true || rbtnB.Checked == true || rbtnC.Checked == true))
            {
                switch (RegForm.Cross)
                {
                case 0:
                {
                    DBConnection.AddUserAndRunner(DBConnection.GetEmail, RegForm.Password, RegForm.FirstName,
                                                  RegForm.SurName, RegForm.Gender, RegForm.DateOfBirth, RegForm.County, RegForm.PathToPhoto);

                    DBConnection.RegOnMarathon(swichOption, TotalAmount.ToString(),
                                               cmbContribution.SelectedValue.ToString(), txtAmount.Text);

                    DBConnection.AddCharity(cmbContribution.Text, txtAmount.Text);

                    tr = true;
                    this.Close();
                    ConfirmReg Form = new ConfirmReg();
                    Form.Show();
                    break;
                }

                case 4:
                case 1:
                case 2:
                {
                    if (RegForm.Cross != 4)
                    {
                        DBConnection.EditUserAndRunner(DBConnection.GetEmail, RegForm.Password, RegForm.FirstName,
                                                       RegForm.SurName, RegForm.Gender, RegForm.DateOfBirth, RegForm.County, RegForm.PathToPhoto);
                    }

                    DBConnection.EditMarathon(swichOption, TotalAmount.ToString(),
                                              cmbContribution.SelectedValue.ToString(), txtAmount.Text);

                    DBConnection.EditCharity(cmbContribution.Text, txtAmount.Text);

                    if (cbSD.Checked == true)
                    {
                        DBConnection.AddFR();
                    }
                    else
                    {
                        DBConnection.DeleteFR();
                    }

                    if (cbSM.Checked == true)
                    {
                        DBConnection.AddHM();
                    }
                    else
                    {
                        DBConnection.DeleteHM();
                    }

                    if (cbFM.Checked == true)
                    {
                        DBConnection.AddFM();
                    }
                    else
                    {
                        DBConnection.DeleteFM();
                    }

                    switch (RegForm.Cross)
                    {
                    case 1:
                        tr = true;
                        this.Close();
                        RunnerControl RCMenu = new RunnerControl();
                        RCMenu.Show();
                        break;

                    case 4:
                    case 2:
                        tr = true;
                        this.Close();
                        RunnerMenu RMenu = new RunnerMenu();
                        RMenu.Show();
                        break;
                    }
                    break;
                }
                }
            }
            else
            {
                lblError.Visible = true;
                lblError.Text    = "At least 1 marathon must be selected";
            }
        }
Exemplo n.º 6
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (txtEmail.Text != "" || txtPassword.Text != "" || txtCPassword.Text != "" || txtName.Text != "" || txtSurname.Text != "" || GenderComboBox.SelectedIndex != -1 || CountrycomboBox.SelectedIndex != -1)
            {
                DialogResult = MessageBox.Show("Leave Form?", "Alert", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (DialogResult == DialogResult.Yes)
                {
                    switch (Cross)
                    {
                    case 0:
                        tr    = true;
                        Cross = 0;
                        this.Close();
                        RegOrLoginForm RegOrLoginForm1 = new RegOrLoginForm();
                        RegOrLoginForm1.Show();
                        return;

                    case 1:
                        tr              = true;
                        Cross           = 0;
                        lblCaption.Text = "Sign Up";
                        this.Close();
                        RunnerControl RunnerControl = new RunnerControl();
                        RunnerControl.Show();
                        return;

                    case 2:
                        tr              = true;
                        Cross           = 0;
                        lblCaption.Text = "Sign Up";
                        this.Close();
                        RunnerMenu RunnerMenu = new RunnerMenu();
                        RunnerMenu.Show();
                        return;
                    }
                }
            }
            else
            {
                switch (Cross)
                {
                case 4:
                case 0:
                    tr    = true;
                    Cross = 0;
                    this.Close();
                    RegOrLoginForm RegOrLoginForm1 = new RegOrLoginForm();
                    RegOrLoginForm1.Show();
                    return;

                case 1:
                    tr              = true;
                    Cross           = 0;
                    lblCaption.Text = "Sign Up";
                    this.Close();
                    RunnerControl RunnerControl = new RunnerControl();
                    RunnerControl.Show();
                    return;

                case 2:
                    tr              = true;
                    Cross           = 0;
                    lblCaption.Text = "Sign Up";
                    this.Close();
                    RunnerMenu RunnerMenu = new RunnerMenu();
                    RunnerMenu.Show();
                    return;
                }
            }
        }