private void button1_Click(object sender, EventArgs e) { listBox1.Items.Clear(); List <Highscore> lista = HighscoresDAO.findAll(); foreach (Highscore hs in lista) { listBox1.Items.Add(hs); } }
private void button2_Click(object sender, EventArgs e) { Highscore hs = new Highscore(); hs.Gamer = textBox1.Text; hs.Hscore = int.Parse(textBox2.Text); HighscoresDAO.insert(hs); textBox1.Text = ""; textBox2.Text = ""; button1_Click(this, null); }