public Form1() { InitializeComponent(); Bus bus = new Bus("5463", "ЈСП 5", true); bus.AddDestination(new Line("Аеродром", 12, 5, 35)); lbBussues.Items.Add(bus); loadLines(); }
public Form1() { InitializeComponent(); Bus bus = new Bus("5463", "ЈСП 5", true); bus.AddDestination(new Line("Аеродром", 12, 5, 35)); lbBussues.Items.Add(bus); loadLines(); }
private void btnAddDestination_Click(object sender, EventArgs e) { AddLine form = new AddLine(); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Bus airport = lbBussues.SelectedItem as Bus; airport.AddDestination(form.Line); loadLines(); } }