Exemple #1
0
        private void UserBet_Load(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();

            BindingSource[] bs = new BindingSource[10];
            for (int i = 0; i < 10; i++)
            {
                bs[i]            = new BindingSource();
                bs[i].DataSource = ul.getHero();
            }
            comboBox1.DataSource  = bs[0];
            comboBox2.DataSource  = bs[1];
            comboBox3.DataSource  = bs[2];
            comboBox4.DataSource  = bs[3];
            comboBox5.DataSource  = bs[4];
            comboBox6.DataSource  = bs[5];
            comboBox7.DataSource  = bs[6];
            comboBox8.DataSource  = bs[7];
            comboBox9.DataSource  = bs[8];
            comboBox10.DataSource = bs[9];

            pictureBox13.BackgroundImage = pictureBox11.BackgroundImage = Image.FromFile(ul.getIconPath(radioButton1.Text));
            pictureBox14.BackgroundImage = pictureBox12.BackgroundImage = Image.FromFile(ul.getIconPath(radioButton2.Text));

            radioButton2.Size     = new Size(90, 17);
            radioButton1.Size     = new Size(90, 17);
            radioButton1.Location = new Point(52, 32);
            radioButton2.Location = new Point(190, 32);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();
            string      x  = ul.UpdateTeam(textBox3.Text, textBox4.Text);

            MessageBox.Show(x);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();
            string      x  = ul.UpdateHero(textBox1.Text, textBox2.Text);

            MessageBox.Show(x);
        }
Exemple #4
0
        private void SetupM_Load(object sender, EventArgs e)
        {
            UpdateDBLin   ul  = new UpdateDBLin();
            BindingSource bs1 = new BindingSource();

            bs1.DataSource       = ul.getTeam();
            comboBox1.DataSource = bs1;
            BindingSource bs2 = new BindingSource();

            bs2.DataSource       = ul.getTeam();
            comboBox2.DataSource = bs2;
        }
 private void button2_Click(object sender, EventArgs e)
 {
     if (textBox2.Text != "Team Name" && textBox2.Text != "" && selectedFile != null)
     {
         UpdateDBLin ul = new UpdateDBLin();
         MessageBox.Show(ul.InsertTeam(textBox2.Text, selectedFile));
     }
     else
     {
         MessageBox.Show("Enter Valid Info");
     }
 }
Exemple #6
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedValue.ToString() == comboBox2.SelectedValue.ToString())
     {
         MessageBox.Show("Select Two Different Team");
     }
     else
     {
         UpdateDBLin ul = new UpdateDBLin();
         ul.InsertMatch(comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), dateTimePicker1.Value.Date + dateTimePicker2.Value.TimeOfDay);
         MessageBox.Show("Match Inserted");
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "Hero Name" && textBox1.Text != "")
            {
                UpdateDBLin ul = new UpdateDBLin();

                MessageBox.Show(ul.InsertHero(textBox1.Text));
            }
            else
            {
                MessageBox.Show("Enter Valid Name");
            }
        }
        private void AdminHome_Load(object sender, EventArgs e)
        {
            AutoCompleteStringCollection coll = new AutoCompleteStringCollection();
            UpdateDBLin ul = new UpdateDBLin();

            List <string> li = ul.getAllUser();

            for (int i = 0; i < li.Count(); i++)
            {
                coll.Add(li.ElementAt(i).ToString());
            }

            textBox1.AutoCompleteCustomSource = coll;
        }
Exemple #9
0
        private void button2_Click(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();

            if (data == 0)
            {
                MessageBox.Show("Select A Cell");
            }
            else
            {
                ul.DeleteUserPrediction(ui.UName, data);
                MessageBox.Show("Successfull");
            }
            dataGridView1.DataSource = null;
            dataGridView2.DataSource = null;
            PredictionHistory_Load(this, null);
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.StartsWith("Admin"))
     {
         if (textBox3.Text == ai.Pword)
         {
             UpdateDBLin ul = new UpdateDBLin();
             ul.InsertAdmin(textBox1.Text, textBox2.Text);
             MessageBox.Show("Admin Inserted");
         }
         else
         {
             MessageBox.Show("Password Incorrect");
         }
     }
     else
     {
         MessageBox.Show("Admin Username Must Start with 'Admin'");
     }
 }
        private void button2_Click(object sender, EventArgs e)
        {
            richTextBox1.Visible = false;
            label8.Visible       = true;
            button2.Visible      = false;
            button4.Visible      = false;
            label8.Text          = richTextBox1.Text;
            ui.Abouts            = label8.Text;

            UpdateDBLin ul = new UpdateDBLin();

            if (selectedFile != null)
            {
                ul.UpdateU(ui.UName, richTextBox1.Text, selectedFile);
                pictureBox1.Image = Image.FromFile(selectedFile);
            }
            else
            {
                ul.UpdateU(ui.UName, richTextBox1.Text);
            }
        }
Exemple #12
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);
                }
            }
        }
        private void MatchResult_Load(object sender, EventArgs e)
        {
            UpdateDBLin     ul = new UpdateDBLin();
            MyDBDataContext cntx;

            cntx = new MyDBDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\Important Documents\Project\Solution1\OOP2\DotaDB.mdf;Integrated Security=True;Connect Timeout=30");

            var str = from a in cntx.MResults
                      where a.MatchId == mr.MatchId
                      select a;

            dataGridView1.DataSource = str;

            var st = from a in cntx.MatchPs
                     where a.MatchId == mp.MatchId && a.Username == mp.Username
                     select a;

            dataGridView2.DataSource = st;

            ul.InsertUserPrediction(mp, bs1, bs2, bs3, w1, w2, w3);
            ul.DeletePred(mp.Username, mp.MatchId);
        }
        private void buttom1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox1.Text != "Username")
            {
                UpdateDBLin ul = new UpdateDBLin();
                User        ui = ul.AdminGetUser(textBox1.Text);

                if (ui.UserName != null)
                {
                    AdminCUser ac = new AdminCUser(this, ui, ai);
                    this.Hide();
                    ac.Show();
                }
                else
                {
                    MessageBox.Show("User Not Found");
                }
            }
            else
            {
                MessageBox.Show("Enter Valid Username");
            }
        }
Exemple #15
0
        private void button2_Click(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();
            string      pass;

            if (check == 0)
            {
                pass = ul.getPassword(ui.UName);
                if (textBox1.Text == pass && textBox2.Text == textBox3.Text)
                {
                    ul.UpdateUP(ui.UName, textBox2.Text);

                    MessageBox.Show("Successfull");
                    obj.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Password didn't match");
                }
            }
            else
            {
                pass = ul.getAdminPass(ai.UName);
                if (textBox1.Text == pass && textBox2.Text == textBox3.Text)
                {
                    ul.UpdateAP(ai.UName, textBox2.Text);
                    MessageBox.Show("Successfull");
                    obj.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Password didn't match");
                }
            }
        }
        private void CheckP_Load(object sender, EventArgs e)
        {
            int         mc;
            UpdateDBLin ul = new UpdateDBLin();

            mc = ul.getPreCount(ui.UName);


            List <int> li = ul.getPredID(ui.UName);


            if (mc == 0)
            {
                label3.Visible = true;
            }

            Panel[] x     = new Panel[mc];
            int     range = 3;

            for (int i = 0; i < mc; i++)
            {
                x[i]                       = new Panel();
                x[i].Name                  = "Panel" + i;
                x[i].Size                  = new Size(313, 87);
                x[i].Location              = new Point(3, range);
                range                     += 93;
                x[i].Visible               = true;
                x[i].BackgroundImage       = Image.FromFile(@"F:\Important Documents\Project\dota.jpg");
                x[i].BackgroundImageLayout = ImageLayout.Stretch;

                panel1.Controls.Add(x[i]);

                Label[]      l = new Label[2];
                PictureBox[] p = new PictureBox[3];
                Button       b = new Button();


                b.Text     = "Results";
                b.Location = new Point(119, 59);
                b.Visible  = true;
                b.Size     = new Size(75, 23);
                b.Click   += new EventHandler(button_Click);
                b.Name     = li.ElementAt(i).ToString();
                x[i].Controls.Add(b);

                string[] t = ul.getPredTeam(li.ElementAt(i));


                for (int j = 0; j <= 1; j++)
                {
                    l[j]           = new Label();
                    l[j].Visible   = true;
                    l[j].Name      = "Label" + j;
                    l[j].Size      = new Size(60, 40);
                    l[j].Text      = t[j];
                    l[j].TextAlign = ContentAlignment.MiddleCenter;
                    x[i].Controls.Add(l[j]);



                    p[j]                       = new PictureBox();
                    p[j].Visible               = true;
                    p[j].BackgroundImage       = Image.FromFile(@ul.getIconPath(t[j]));
                    p[j].BackgroundImageLayout = ImageLayout.Zoom;
                    p[j].Size                  = new Size(45, 42);
                    x[i].Controls.Add(p[j]);
                }

                l[0].Location              = new Point(53, 11);
                l[1].Location              = new Point(190, 11);
                p[0].Location              = new Point(3, 11);
                p[1].Location              = new Point(265, 11);
                p[2]                       = new PictureBox();
                p[2].Size                  = new Size(45, 42);
                p[2].Visible               = true;
                p[2].Location              = new Point(128, 11);
                p[2].BackgroundImage       = Image.FromFile(@"F:\Important Documents\Project\Vs2.png");
                p[2].BackgroundImageLayout = ImageLayout.Zoom;
                x[i].Controls.Add(p[2]);
            }
        }
        private void button_Click(object sender, EventArgs e)
        {
            var         button = sender as Button;
            UpdateDBLin ul     = new UpdateDBLin();
            int         bx     = ui.Igc;
            int         mid    = Convert.ToInt32(button.Name);

            int flag = 0, w1 = 0, w2 = 0, w3 = 0;

            if (DateTime.Now >= ul.getMatchTime(Convert.ToInt32(button.Name)))
            {
                MResult mr = ul.getResult(Convert.ToInt32(button.Name));
                MatchP  mp = ul.getMatchPred(Convert.ToInt32(button.Name), ui.UName);
                Bet     b  = ul.getBets(Convert.ToInt32(button.Name), ui.UName);


                if (mr.Win == mp.Win)
                {
                    ui.Igc += Convert.ToInt32((b.Section1 * 2));
                    w1      = Convert.ToInt32((b.Section1 * 2));
                    flag    = 1;
                }

                if (mr.DireScore == mp.DireScore)
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 3));
                    w3     += Convert.ToInt32((b.Section3 * 3));
                    flag    = 1;
                }

                if (mr.RadientScore == mp.RadientScore)
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 3));
                    w3     += Convert.ToInt32((b.Section3 * 3));
                    flag    = 1;
                }



                if (ul.HeroMatchRad(mp.Hero1, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section2 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchRad(mp.Hero2, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section2 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchRad(mp.Hero3, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section2 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchRad(mp.Hero4, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section2 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchRad(mp.Hero5, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section2 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchDir(mp.Hero6, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchDir(mp.Hero7, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchDir(mp.Hero8, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchDir(mp.Hero9, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }
                if (ul.HeroMatchDir(mp.Hero10, mid))
                {
                    ui.Igc += Convert.ToInt32((b.Section3 * 1));
                    w2     += Convert.ToInt32((b.Section2 * 1));
                    flag    = 1;
                }


                ul.UpdateIGC(ui.UName, ui.Igc);


                if (flag == 1)
                {
                    MessageBox.Show("Congrats ! You won.Your In Game Credit Has Been Updated");
                }
                else
                {
                    MessageBox.Show("Sorry ! You Didn't Win.Better Luck Next Time");
                }
                MatchResult mat = new MatchResult(obj, ui, mr, mp, w1, w2, w3, Convert.ToInt32(b.Section1), Convert.ToInt32(b.Section2), Convert.ToInt32(b.Section3), bx);
                this.Close();
                mat.Show();
            }
            else
            {
                MessageBox.Show("Results not Ready");
            }
        }
Exemple #18
0
        private void HomeUser_Load(object sender, EventArgs e)
        {
            UpdateDBLin ul = new UpdateDBLin();

            x = ul.MatchCount();

            if (x == 0)
            {
                label4.Visible = true;
            }
            List <string>[] li    = ul.getMatch();
            List <DateTime> dt    = ul.getTime();
            int             range = 3;

            Panel[] p = new Panel[x];
            for (int i = 0; i < x; i++)
            {
                p[i]                       = new Panel();
                p[i].Name                  = "Panel" + i;
                p[i].BackgroundImage       = Image.FromFile(@"F:\Important Documents\Project\Vs.jpg");
                p[i].BackgroundImageLayout = ImageLayout.Zoom;
                p[i].Visible               = true;
                p[i].Location              = new Point(3, range);
                range                     += 76;
                p[i].Size                  = new Size(345, 67);
                p[i].Cursor                = Cursors.Hand;
                p[i].Click                += new EventHandler(panelClick);

                PictureBox[] px   = new PictureBox[2];
                Label[]      lb   = new Label[2];
                Label        date = new Label();
                date.Location  = new Point(225, 55);
                date.BackColor = Color.Transparent;
                date.Size      = new Size(120, 12);
                date.TextAlign = ContentAlignment.MiddleCenter;
                date.Font      = new Font("Times New Roman", 7, FontStyle.Regular);
                date.Name      = "Date";
                p[i].Controls.Add(date);
                for (int j = 0; j < 2; j++)
                {
                    px[j]      = new PictureBox();
                    lb[j]      = new Label();
                    px[j].Size = new Size(35, 35);
                    lb[j].Size = new Size(65, 15);

                    lb[j].Name      = "Label" + j;
                    lb[j].TextAlign = ContentAlignment.MiddleCenter;
                    px[j].Visible   = true;
                    p[i].Controls.Add(lb[j]);
                    p[i].Controls.Add(px[j]);
                    lb[j].Visible = true;
                    px[j].BackgroundImageLayout = ImageLayout.Zoom;
                }
                px[0].Location        = new Point(22, 15);
                px[1].Location        = new Point(290, 15);
                px[0].BackgroundImage = Image.FromFile(@ul.getIconPath(li[0].ElementAt(i)));
                px[1].BackgroundImage = Image.FromFile(@ul.getIconPath(li[1].ElementAt(i)));

                lb[0].Text     = li[0].ElementAt(i);
                lb[1].Text     = li[1].ElementAt(i);
                date.Text      = dt.ElementAt(i).ToString();
                lb[0].Location = new Point(62, 24);
                lb[1].Location = new Point(219, 24);

                panel4.Controls.Add(p[i]);
            }
        }