Beispiel #1
0
 public void addToPoolList(Poule pouleToAdd)
 {
     pouleList.Add(pouleToAdd);
     lbPoule.Items.Add(pouleToAdd.getName());
     pouleForm.Close();
     pouleForm = null;
 }
Beispiel #2
0
 public Judoka(String name, String belt, int weight, Poule poule)
 {
     this.name   = name;
     this.belt   = belt;
     this.weight = weight;
     this.poule  = poule;
 }
Beispiel #3
0
 public PouleOverview(Form1 mainForm, Poule currentPoule)
 {
     InitializeComponent();
     this.mainForm     = mainForm;
     this.currentPoule = currentPoule;
     lblPouleName.Text = currentPoule.getName();
 }
Beispiel #4
0
        private void btCreate_Click(object sender, EventArgs e)
        {
            Poule currentPoule = pouleOverview.getCurrentPoule();

            if (tbName.Text != null && tbWeight.Text != null && cbBelt.SelectedValue != null)
            {
                Judoka newJudoka = new Judoka(tbName.Text, cbBelt.SelectedValue.ToString(), Convert.ToInt32(tbWeight.Text), currentPoule);
            }
            else
            {
                MessageBox.Show("Please make sure all the fields are filled.");
            }
        }
Beispiel #5
0
        private void lbPoule_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.lbPoule.IndexFromPoint(e.Location);

            if (index != ListBox.NoMatches)
            {
                Poule currentPoule;
                foreach (Poule p in pouleList)
                {
                    if (p.getName() == lbPoule.SelectedItem.ToString())
                    {
                        currentPoule  = new Poule();
                        currentPoule  = p;
                        pouleOverview = new PouleOverview(this, currentPoule);
                        break;
                    }
                }
                if (pouleOverview != null)
                {
                    pouleOverview.Show();
                }
            }
        }
Beispiel #6
0
        private void Save_Click(object sender, EventArgs e)
        {
            Poule newPoule = new Poule(Name.Text);

            mainForm.addToPoolList(newPoule);
        }