private void button2_Click(object sender, EventArgs e) { AddLine form = new AddLine(); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Buses bus = busLines.ElementAt(lbBuses.SelectedIndex); bus.addLine(form.line); loadLines(bus); AverageAndMostExpensiveRoutes(bus); } }
private void Form1_Load(object sender, EventArgs e) { Buses a = new Buses("Transkop", "OH213BT", true); a.addLine(new Lines("4:20", "Jamaica", 500)); Buses b = new Buses("Galeb", "OH111VG", false); b.addLine(new Lines("15:20", "Bitola", 150)); busLines.Add(a); busLines.Add(b); btnRemoveBus.Enabled = false; loadBuses(); }