private void button1_Click(object sender, EventArgs e) { PartyToys party = new PartyToys(); PartyEditForm partyEdit = new PartyEditForm(party); partyEdit.ShowDialog(); if (partyEdit.DialogResult == DialogResult.OK) { theShop.AddAPartyofToys(party); RefreshData(); } }
public PartyEditForm(PartyToys partyToys) { InitializeComponent(); thePartyToys = partyToys; if (partyToys.TheToy != null) { listBox1.Items.Add(partyToys); } foreach (Toy i in allToys) { listBox1.Items.Add(i); } }
public void AddAPartyofToys(PartyToys toyParty) { supplies.Add(toyParty); CalculateToys(); }
private void button3_Click(object sender, EventArgs e) { thePartyToys = new PartyToys(); DialogResult = DialogResult.No; Close(); }