Exemplo n.º 1
0
        void UpdateConnection2()
        {
            listBox5.Items.Clear();

            stationboard = null;
            try
            {
                if (departure.Name != null)
                {
                    ;
                }
            }
            catch { }
            try
            {
                stationboard = transport.GetStationBoard(departure.Name);
            }
            catch { }

            if (stationboard == null)
            {
                MessageBox.Show("Kein Fahrplan gefunde.");
                return;
            }
            foreach (SwissTransport.StationBoard stationboard in stationboard.Entries)
            {
                listBox5.Items.Add(stationboard.Category + " | " + stationboard.Number + " | " + stationboard.To + " | " + stationboard.Stop.Departure);
            }
        }
Exemplo n.º 2
0
        private void abf_searchAbfahrt(object sender, RoutedEventArgs e)
        {
            string station = abf_cb_name.Text;
            string stationId;

            SwissTransport.Stations stationNames = transport.GetStations(station);

            stationId = stationNames.StationList[0].Id;

            abf_gb_abfahrt.Header = "Abfahrtsplan von " + stationNames.StationList[0].Name;

            SwissTransport.StationBoardRoot stationBoardRoot = transport.GetStationBoard(station, stationId);

            abf_list_abfahrt.Items.Clear();

            foreach (SwissTransport.StationBoard sbr in stationBoardRoot.Entries)
            {
                abf_list_abfahrt.Items.Add(sbr.To);
            }
        }
Exemplo n.º 3
0
        // Funktion um die Abfahrtstafel zu erstellen
        private void CreateDepartureTable(string stationName, string stationId)
        {
            listViewDepartureTable.Items.Clear();

            SwissTransport.StationBoardRoot resultStations = null;
            resultStations = transport.GetStationBoard(stationName, stationId);

            try
            {
                foreach (SwissTransport.StationBoard connectionFromStation in resultStations.Entries)
                {
                    ListViewItem lvi = new ListViewItem(connectionFromStation.Stop.Departure.ToString("HH:mm"));
                    lvi.SubItems.Add(connectionFromStation.To);
                    lvi.SubItems.Add(connectionFromStation.Category);

                    listViewDepartureTable.Items.Add(lvi);
                }
            }
            catch
            {
                MessageBox.Show("Es wurden keine Ergebnisse gefunden");
            }
        }