private void buttonOrderSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBoxCustomerName.Text)) { MessageBox.Show("A név megadása kötelező!"); return; } List <string> selectedequipments = new List <string>(); foreach (var item in checkedListBoxEquipments.CheckedItems) { selectedequipments.Add(item.ToString()); } PlushBase plush = new Plush(); if (selectedequipments.Contains("Sál")) { plush = new ScarfDecorator(plush); } if (selectedequipments.Contains("Sapka")) { plush = new CapDecorator(plush); } if (selectedequipments.Contains("Nyakörv")) { plush = new CollarDecorator(plush); } if (selectedequipments.Contains("Pulcsi")) { plush = new HoodieDecorator(plush); } if (selectedequipments.Contains("Napszemüveg")) { plush = new SunglassesDecorator(plush); } plushOrders.InsertOrder(plushWarehouse.plushId, plush.GetEquipments(), textBoxCustomerName.Text, orderQuantity); this.Close(); }