public void addToPoolList(Poule pouleToAdd) { pouleList.Add(pouleToAdd); lbPoule.Items.Add(pouleToAdd.getName()); pouleForm.Close(); pouleForm = null; }
public Judoka(String name, String belt, int weight, Poule poule) { this.name = name; this.belt = belt; this.weight = weight; this.poule = poule; }
public PouleOverview(Form1 mainForm, Poule currentPoule) { InitializeComponent(); this.mainForm = mainForm; this.currentPoule = currentPoule; lblPouleName.Text = currentPoule.getName(); }
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."); } }
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(); } } }
private void Save_Click(object sender, EventArgs e) { Poule newPoule = new Poule(Name.Text); mainForm.addToPoolList(newPoule); }