Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("" + Convert.ToInt16(btnDeleteId));
            RcordEachUser rcordEachUser = new RcordEachUser();

            rcordEachUser.id = Convert.ToInt16(btnDeleteId);
            rcordEachUser.DeleteRecord();
            (Application.OpenForms["RecordUser"] as RecordUser).Fill();
        }
Esempio n. 2
0
        private void insertRecord()
        {
            RcordEachUser RecordEachUser = new RcordEachUser();

            RecordEachUser.idUser = id;
            RecordEachUser.max    = MaxNumber().ToString();
            RecordEachUser.move   = btnMove.Text;
            RecordEachUser.score  = btnScore.Text;
            RecordEachUser.time   = (label3.Text + ": " + label4.Text + ": " + label5.Text);
            RecordEachUser.inserRecord();
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            RcordEachUser rcordEachUser = new RcordEachUser();

            rcordEachUser.id = Convert.ToInt16(button2.Tag);
            List <Input> input = rcordEachUser.selectRecord();
            Input        temp  = new Input();

            if (input.Count > 0)
            {
                for (int i = 0; i < input.Count; i++)
                {
                    for (int j = 0; j < input.Count - 1; j++)
                    {
                        if (Convert.ToInt16(input[j].Score) < Convert.ToInt16(input[j + 1].Score))
                        {
                            temp         = input[j + 1];
                            input[j + 1] = input[j];
                            input[j]     = temp;
                        }
                    }
                }

                Game game = new Game();
                game.bestRecord = input[0].Score;
                game.userName   = uName;
                game.id         = Convert.ToInt16(button2.Tag);
                game.picture    = label1.Tag.ToString();
                game.Show();
            }
            else
            {
                Game game = new Game();
                game.bestRecord = "-1";
                game.userName   = uName;
                game.picture    = label1.Tag.ToString();
                game.id         = Convert.ToInt16(button2.Tag);
                game.Show();
            }
        }
Esempio n. 4
0
        public void Sort()
        {
            G.currentForm = this;
            RcordEachUser rcordEachUser = new RcordEachUser();

            rcordEachUser.id = id;
            input            = rcordEachUser.selectRecord();
            Input temp = new Input();

            for (int i = 0; i < input.Count; i++)
            {
                for (int j = 0; j < input.Count - 1; j++)
                {
                    if (Convert.ToInt16(input[j].Score) < Convert.ToInt16(input[j + 1].Score))
                    {
                        temp         = input[j + 1];
                        input[j + 1] = input[j];
                        input[j]     = temp;
                    }
                }
            }
        }
Esempio n. 5
0
        public Input Sort(int id)
        {
            G.currentForm = this;
            RcordEachUser rcordEachUser = new RcordEachUser();

            rcordEachUser.id = id;
            List <Input> input = rcordEachUser.selectRecord();
            Input        temp  = new Input();

            for (int i = 0; i < input.Count; i++)
            {
                for (int j = 0; j < input.Count - 1; j++)
                {
                    if (Convert.ToInt16(input[j].Score) < Convert.ToInt16(input[j + 1].Score))
                    {
                        temp         = input[j + 1];
                        input[j + 1] = input[j];
                        input[j]     = temp;
                    }
                }
            }
            if (input.Count > 0)
            {
                Input temp2 = new Input();
                temp2.Id    = id;
                temp2.Score = input[0].Score;
                temp2.Max   = input[0].Max;
                return(temp2);
            }
            else
            {
                Input temp2 = new Input();
                temp2.Id    = id;
                temp2.Score = "0";
                temp2.Max   = "0";
                return(temp2);
            }
        }