Esempio n. 1
0
 private void btnChangeRank_Click(object sender, EventArgs e)
 {
     // to do: assignment 2
     if (lbRacers.SelectedIndex != -1)
     {
         Racer r = FindRacer(((Racer)lbRacers.SelectedItem).Id);
         r.setRank(Convert.ToInt32(tbNewRank.Text));
         showAllRacers();
     }
 }
Esempio n. 2
0
        private void btnChangeRank_Click(object sender, EventArgs e)
        {
            // to do: assignment 2
            Racer selected = (Racer)(lbRacers.SelectedItem);

            if (selected != null)
            {
                selected.setRank(Convert.ToInt32(this.tbNewRank.Text));
            }
            showAllRacers();
        }