private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            HomeUser hu = new HomeUser(ui);

            hu.Show();
        }
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HomeUser h = new HomeUser(ui);

            h.Show();
            this.Close();
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();


            string pass;

            if (textBox1.Text.StartsWith("Admin") == true)
            {
                ai   = ul.getAdmin(textBox1.Text);
                pass = ul.getAdminPass(textBox1.Text);

                if (textBox2.Text == pass)
                {
                    AdminHome h = new AdminHome(ai);
                    h.Show();
                    this.Visible = false;
                }
                else
                {
                    MessageBox.Show("Wrong Password or Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                ui   = ul.getUser(textBox1.Text);
                pass = ul.getPassword(textBox1.Text);

                if (textBox2.Text == pass)
                {
                    HomeUser h = new HomeUser(ui);
                    h.Show();
                    this.Visible = false;
                }
                else
                {
                    MessageBox.Show("Wrong Password or Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            int flag = 0;

            if (ul.detetcPred(ui.UName, MatchID))
            {
                MessageBox.Show("You Already Have a Pending Result");
            }
            else
            {
                if (Convert.ToInt32(numericUpDown2.Value) != 0)
                {
                    if (comboBox1.SelectedIndex == comboBox2.SelectedIndex || comboBox1.SelectedIndex == comboBox3.SelectedIndex || comboBox1.SelectedIndex == comboBox4.SelectedIndex || comboBox1.SelectedIndex == comboBox5.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox2.SelectedIndex == comboBox3.SelectedIndex || comboBox2.SelectedIndex == comboBox4.SelectedIndex || comboBox2.SelectedIndex == comboBox5.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox3.SelectedIndex == comboBox4.SelectedIndex || comboBox3.SelectedIndex == comboBox5.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox4.SelectedIndex == comboBox5.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox6.SelectedIndex == comboBox7.SelectedIndex || comboBox6.SelectedIndex == comboBox8.SelectedIndex || comboBox6.SelectedIndex == comboBox9.SelectedIndex || comboBox6.SelectedIndex == comboBox10.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox7.SelectedIndex == comboBox8.SelectedIndex || comboBox7.SelectedIndex == comboBox9.SelectedIndex || comboBox7.SelectedIndex == comboBox10.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox8.SelectedIndex == comboBox9.SelectedIndex || comboBox8.SelectedIndex == comboBox10.SelectedIndex)
                    {
                        flag = 1;
                    }
                    else if (comboBox9.SelectedIndex == comboBox10.SelectedIndex)
                    {
                        flag = 1;
                    }
                }
                else
                {
                    flag = 0;
                }

                if (flag == 0)
                {
                    int n1 = Convert.ToInt32(numericUpDown1.Value);
                    int n2 = Convert.ToInt32(numericUpDown2.Value);
                    int n3 = Convert.ToInt32(numericUpDown5.Value);

                    int r = Convert.ToInt32(numericUpDown3.Value);
                    int d = Convert.ToInt32(numericUpDown4.Value);

                    ul.InsertBet(ui.UName, MatchID, n1, n2, n3);
                    string[] h = new string[10];



                    h[0] = comboBox1.Text;
                    h[1] = comboBox2.Text;
                    h[2] = comboBox3.Text;
                    h[3] = comboBox4.Text;
                    h[4] = comboBox5.Text;
                    h[5] = comboBox6.Text;
                    h[6] = comboBox7.Text;
                    h[7] = comboBox8.Text;
                    h[8] = comboBox9.Text;
                    h[9] = comboBox10.Text;

                    if (radioButton1.Checked == true)
                    {
                        w = "Radient";
                    }
                    else if (radioButton2.Checked == true)
                    {
                        w = "Dire";
                    }

                    ul.InsertPrediction(ui.UName, MatchID, w, h, r, d);
                    MessageBox.Show("Your Prediction's are Submitted");
                    ui.Igc -= (n1 + n2 + n3);
                    ul.UpdateIGC(ui.UName, ui.Igc);

                    this.Close();
                    HomeUser hu = new HomeUser(ui);
                    hu.Show();
                }
                else
                {
                    MessageBox.Show("Cant Select Same Hero More than once For same Team");
                }
            }
        }