private void Verbindung_Suchen_Click(object sender, EventArgs e) { Connections connections = transport.GetConnections(comboBoxVon.Text, comboBoxNach.Text); listBoxVonNach.Items.Clear(); foreach (connection connection in connections.ConnectionList) { listBoxVonNach.Items.Add(comboBoxVon.Text + "\t" + comboBoxNach.Text + "\tAbfahrt" + connection.From.Departure + "\tAnkunft" + connection.To.Arrival); } }
// filling information to viwelist private void suchen_Click(object sender, EventArgs e) { try { this.verbindungen.Items.Clear(); string from = this.standort.Text; string to = this.zielort.Text; if (CheckStations(standort) && CheckStations(zielort) && CheckTime(time)) { string Date = datum.Value.Year + "-" + datum.Value.Month + "-" + datum.Value.Day; foreach (global::SwissTransport.Connection connection in m_transport.GetConnections(from, to, Date, time.Text).ConnectionList) { verbindungen.Items.Add(Connections(connection)); } } if (!CheckTime(time)) { MessageBox.Show("Bitte zeit überprüfen"); } if (!CheckStations(standort)) { MessageBox.Show("Bitte Standort überprüfen"); } if (!CheckStations(zielort)) { MessageBox.Show("Bitte zielort überprüfen"); } } catch { MessageBox.Show("Fehler"); } }