Esempio n. 1
0
        private void button8_Click(object sender, EventArgs e)
        {
            if (!button8Clicked)
            {
                random = new Random();
                int buttonsCount = buttons.Count - 1;
                randomNubmer = buttons[random.Next(0, buttonsCount)];
                buttons.Remove(randomNubmer);
                button8Num     = randomNubmer;
                button8Clicked = true;
                Button8Logic();
                previousValue  = value;
                previousButton = 8;
            }
            else
            {
                Button8Logic();
                previousValue  = value;
                previousButton = 8;
            }

            if (gameOver)
            {
                MessageBox.Show("Congratulations, You've completed the game!", "CONGRATULATIONS!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

                Hide();
                practiceMenu practiceMenu = new practiceMenu(_username);
                practiceMenu.Show();
            }
        }
Esempio n. 2
0
        private void practiceBtn_Click(object sender, EventArgs e)
        {
            this.Hide();
            practiceMenu pm = new practiceMenu(_username);

            pm.Show();
        }
Esempio n. 3
0
        private void btnEndPractice_Click(object sender, EventArgs e)
        {
            using (SqlConnection conn = new SqlConnection(@"Data Source=DESKTOP-I1C7SOR;Initial Catalog=mathClassroomDB;Integrated Security=True"))
            {
                string query = @"INSERT INTO StudentPracticeResults (Username, Score, Time, DateTaken, Subject) VALUES (@Username, @Score, @Time, @DateTaken, @Subject)";

                conn.Open();

                SqlCommand command = new SqlCommand(query, conn);

                command.Parameters.AddWithValue("@Username", _username);
                command.Parameters.AddWithValue("@Score", score.ToString() + "out of 15");
                command.Parameters.AddWithValue("@Time", time.ToString());
                command.Parameters.AddWithValue("@DateTaken", DateTime.Now.ToShortDateString());
                command.Parameters.AddWithValue("@Subject", "Addition");

                command.ExecuteNonQuery();

                conn.Close();
            }

            MessageBox.Show("Your score has been saved.", "Thank You", MessageBoxButtons.OK, MessageBoxIcon.Information);

            Hide();
            practiceMenu ss = new practiceMenu(_username);

            ss.Show();
        }
Esempio n. 4
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Hide();
            practiceMenu practiceMenu = new practiceMenu(_username);

            practiceMenu.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Hide();
            practiceMenu pm = new practiceMenu(_username);

            pm.Show();
        }
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            this.Hide();
            practiceMenu pm = new practiceMenu(_username);

            pm.ShowDialog();
        }
Esempio n. 7
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            SqlConnection  conn = new SqlConnection(@"Data Source=DESKTOP-I1C7SOR;Initial Catalog=mathClassroomDB;Integrated Security=True");
            SqlDataAdapter sda  = new SqlDataAdapter("select count(*) from StudentLogins where Username = '******' and Password = '******'", conn);
            DataTable      dt   = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                practiceMenu ss = new practiceMenu(usernameEntry.Text);
                ss.Show();
            }
            else
            {
                MessageBox.Show("please enter correct username and password");
            }
        }