Пример #1
0
        private void buttonConnections_Click(object sender, EventArgs e)
        {
            Connections    connections    = new Connections();
            StationHandler stationHandler = new StationHandler();

            if (stationHandler.StationExists(comboBoxConnectionsDeparture.Text))
            {
                if (stationHandler.StationExists(comboBoxConnectionsArrival.Text))
                {
                    string date = dateTimePickerDepartureDate.Value.ToString("yyyy-MM-dd");
                    string time = dateTimePickerDepartureTime.Value.ToString("HH:mm");
                    connections = _transport.GetConnections(comboBoxConnectionsDeparture.Text, comboBoxConnectionsArrival.Text, date, time);
                    if (connections.ConnectionList.Count != 0)
                    {
                        DataGridViewFiller dataGridViewFiller = new DataGridViewFiller();
                        dataGridViewFiller.FillDataGridConnections(connections, dataGridViewConnections);
                    }
                    else
                    {
                        MessageBox.Show("Keine Verbindungen gefunden.");
                    }
                }
                else
                {
                    MessageBox.Show("Ankunftsort nicht gefunden");
                }
            }
            else
            {
                MessageBox.Show("Abfahrtsort nicht gefunden.");
            }
        }
Пример #2
0
        //Buttons
        private void buttonShowDepartureBoard_Click(object sender, EventArgs e)
        {
            StationHandler stationHandler = new StationHandler();

            if (stationHandler.StationExists(comboBoxDepartureBoardDeparture.Text))
            {
                StationBoardRoot stationBoardRoot = new StationBoardRoot();
                stationBoardRoot = _transport.GetStationBoard(comboBoxDepartureBoardDeparture.Text, "");
                DataGridViewFiller dataGridViewFiller = new DataGridViewFiller();
                dataGridViewFiller.FillDataGridDepartureBoard(stationBoardRoot, dataGridViewDepartureBoard);
            }
            else
            {
                MessageBox.Show("Station nicht gefunden.");
            }
        }
Пример #3
0
        //
        //Events
        //

        //buttons
        private void buttonShowNearMe_Click(object sender, EventArgs e)
        {
            if (watcher.Position.Location.IsUnknown)
            {
                MessageBox.Show("Aktueller Standort nicht verfügbar");
            }
            else
            {
                string   x        = watcher.Position.Location.Latitude.ToString();
                string   y        = watcher.Position.Location.Longitude.ToString();
                Stations stations = new Stations();
                stations = _transport.GetStations(x, y);
                DataGridViewFiller dataGridViewFiller = new DataGridViewFiller();
                dataGridViewFiller.FillDataGridNearMe(stations, dataGridViewNearMe);
            }
            watcher.Stop();
        }