예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     //check that fields have been filed in
     //add ID to the users list
     if (Register.Text.Equals("Unregister"))
     {
         t.RemoveEntrant(me.ID);
         me.RemoveTournament(t.GetID());
         Register.Text = "Register";
     }
     else if (textBox1.Text.Any() && Register.Text == "Register")
     {
         //add tag checking
         t.AddEntrant(new Entrant(me, textBox1.Text));
         me.AddTournament(t.GetID());
         Register.Text = "Unregister";
     }
     else
     {
         label9.Text = "Please Enter a Tag";
     }
     UpdateDisplayEntrants();
     //otherwise remove the id and the user from the list of entrants
 }