private void bContinue_Click(object sender, EventArgs e) { if (tName.TextLength > 0 && tProducer.TextLength > 0 && tMaterial.TextLength > 0 && tPrice.TextLength > 0 && tColor.TextLength > 0 && cbShoelaces.SelectedIndex != -1) { var sneakers = new Sneakers(tName.Text, tProducer.Text, tMaterial.Text, Convert.ToDouble(tPrice.Text), tColor.Text, (bool)cbShoelaces.SelectedItem); storage.AddItem(sneakers); this.Close(); } }
private void bContinue_Click(object sender, EventArgs e) { if (tName.TextLength > 0 && tProducer.TextLength > 0 && tMaterial.TextLength > 0 && tPrice.TextLength > 0 && cbType.SelectedIndex != -1) { var shoes = new Shoes(tName.Text, tProducer.Text, tMaterial.Text, Convert.ToDouble(tPrice.Text), (HeelType)cbType.SelectedItem); storage.AddItem(shoes); this.Close(); } }