Example #1
0
        //go back to main menu
        private void exitBtn_Click(object sender, EventArgs e)
        {
            var s = new Startscreen();

            s.Show();
            this.Hide();
        }
Example #2
0
        private void backToMainButton_Click(object sender, EventArgs e)
        {
            Startscreen s = new Startscreen();

            s.Show();
            this.Close();
        }
Example #3
0
        //updates the database with user supplied fields
        //then loads start screen
        private void submitBtn_Click(object sender, EventArgs e)
        {
            var    name         = nameTxtBx.Text;
            var    message      = commentTxtBx.Text;
            string insertLeader = "INSERT into Player (Name,Message,Score) " +
                                  " VALUES ('" + name + "', '" + message + "', '" + score + "')";

            dbConnection = ConfigurationManager.ConnectionStrings["BrickyBreaky.Properties.Settings.LeaderboardDBConnectionString"].ConnectionString;

            using (SqlConnection myConnection = new SqlConnection(dbConnection))
            {
                using (SqlCommand s = new SqlCommand(insertLeader))
                {
                    s.Connection = myConnection;
                    myConnection.Open();
                    s.ExecuteNonQuery();
                    myConnection.Close();
                }
            }
            Startscreen start = new Startscreen();

            start.Show();
            this.Close();
        }