Example #1
0
        // Save the player's result
        private void btnSaveResult_Click(object sender, RoutedEventArgs e)
        {
            string name = tbName.Text;

            if (name != "")
            {
                long       timestamp = DateTime.Now.Ticks;
                ScoreEntry score     = new ScoreEntry(name, prize, helpsUsed, timestamp);

                ScoreHandler.AddAndSaveScore(score);
                MainWindow mainWindow = new MainWindow();
                mainWindow.Show();
                Close();
            }
            else
            {
                MessageBox.Show("You didn't entered your name!");
            }
        }
Example #2
0
 // Load the scores from the database into the scores list
 private void GetScores()
 {
     scores = ScoreHandler.LoadScores();
 }