Esempio n. 1
0
        public TournamentViewer(Tournament j, User i)
        {
            t  = j;
            me = i;
            InitializeComponent();

            label1.Text = t.GetName();
            label2.Text = t.GetGame();
            switch (t.GetStyle())
            {
            case 0:
                label3.Text = "Double Elimination";
                break;

            case 1:
                label3.Text = "Single Elimination";
                break;

            case 2:
                label3.Text = "Round Robin";
                break;
            }
            label4.Text = t.GetDate().ToString();
            label5.Text = t.GetLocation();
            label6.Text = t.GetEntryFee().ToString();
            label7.Text = t.GetMaxEntrants().ToString();
            label8.Text = t.GetTotalEntrants().ToString();
            if (t.GetEntrants().Exists(x => x.GetUserID().Equals(me.ID)))
            {
                textBox1.Text = t.GetEntrants().Find(x => x.GetUserID().Equals(me.ID)).GetTag();
                Register.Text = "Unregister";
            }
            UpdateDisplayEntrants();
            this.Show();
        }
 public TournamentCreationForm(Tournament b, bool f)
 {
     InitializeComponent();
     a = b;
     if (f)
     {
         textBox1.Text           = b.GetName();
         textBox2.Text           = b.GetGame();
         comboBox1.SelectedIndex = b.GetStyle();
         dateTimePicker1.Value   = b.GetDate();
         textBox4.Text           = b.GetLocation();
         textBox5.Text           = b.GetEntryFee().ToString();
         textBox6.Text           = b.GetMaxEntrants().ToString();
     }
     this.Show();
 }