private void button1_Click(object sender, EventArgs e) { Vehicul vehicul = new Vehicul(); AdaugareVehicul adaugare = new AdaugareVehicul(vehicul); adaugare.ShowDialog(); p = p + vehicul; listViewVehicule.Items.Clear(); foreach (Vehicul v in vehiculs) { ListViewItem listViewItem = new ListViewItem(v.ModelMasina); listViewItem.SubItems.Add(v.AnFabricatie.ToString()); listViewItem.SubItems.Add(v.Pret.ToString()); listViewVehicule.Items.Add(listViewItem); listViewItem.Tag = v; } }
public AdaugareVehicul(Vehicul vehicul) { this.vehicul = vehicul; InitializeComponent(); }