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

            mainForm.addToPoolList(newPoule);
        }