Exemple #1
0
        //buttons
        private void buttonShowMap_Click(object sender, EventArgs e)
        {
            StationHandler stationHandler = new StationHandler();

            if (stationHandler.StationExists(comboBoxMapsStation.Text))
            {
                //change gMapControl
                gMapControlStation.MapProvider = GMapProviders.GoogleMap;
                gMapControlStation.DragButton  = MouseButtons.Left;
                gMapControlStation.Visible     = true;
                //position
                Stations stations = new Stations();
                stations = _transport.GetStations(comboBoxMapsStation.Text);
                double      x     = stations.StationList[0].Coordinate.XCoordinate;
                double      y     = stations.StationList[0].Coordinate.YCoordinate;
                PointLatLng point = new PointLatLng(x, y);
                gMapControlStation.Position = point;
                //Marker
                GMapMarker  marker  = new GMarkerGoogle(point, GMarkerGoogleType.red_pushpin);
                GMapOverlay markers = new GMapOverlay("makers");
                markers.Markers.Add(marker);
                gMapControlStation.Overlays.Clear();
                gMapControlStation.Overlays.Add(markers);
            }
            else
            {
                MessageBox.Show("Station nicht gefunden.");
            }
        }
Exemple #2
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.");
            }
        }
Exemple #3
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.");
            }
        }