Пример #1
0
        private void createTicket()
        {
            //StationList stationList = new StationList();
            //for new build
            //Station startStation = stationList.GetStationByLocation(selectedStartStation.GetLocation());
            //Station endStation = stationList.GetStationByLocation(selectedEndStation.GetLocation());
            Station startStation = _stations.GetStationByLocation(_startStation);
            Station endStation   = _stations.GetStationByLocation(_endStation);
            Route   route        = new Route(startStation, endStation, Convert.ToDecimal(_ticketAmount.Substring(1)));
            Ticket  ticket       = new Ticket(route, true, DateTime.Now, null, "single", _account);

            startStation.AddTicketToList(ticket);
            endStation.AddTicketToList(ticket);
            ticket.InitialiseTicketId();
        }
Пример #2
0
        private void btnCreateScanner_Click(object sender, EventArgs e)
        {
            bool radChosen;

            if (radEntry.Checked)
            {
                radChosen = true;
            }
            else
            {
                radChosen = false;
            }
            Station station = _stations.GetStationByLocation(selectedStation);

            _scanner = new Scanner(station, radChosen);
            ScannerFeedbackGUI gui = new ScannerFeedbackGUI(_scanner);

            gui.Show();
        }
Пример #3
0
 private void RouteSetup() {
     StationList _stations = new StationList();
     _stations = LoadStations(_stations);
     routes.AddRoute(new Route(_stations.GetStationByLocation("Sheffield"), _stations.GetStationByLocation("Meadowhall"), 25.00m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Sheffield"), _stations.GetStationByLocation("Leeds"), 15.00m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Nottingham"), _stations.GetStationByLocation("Sheffield"), 12.50m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("London"), _stations.GetStationByLocation("Brighton"), 23.00m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Manchester"), _stations.GetStationByLocation("Liverpool"), 27.60m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Liverpool"), _stations.GetStationByLocation("Sheffield"), 32.00m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("London"), _stations.GetStationByLocation("Birmingham"), 39.50m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Birmingham"), _stations.GetStationByLocation("London"), 39.50m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Edinburgh"), _stations.GetStationByLocation("Glasgow"), 10.00m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Edinburgh"), _stations.GetStationByLocation("London"), 70.00m));
     routes.AddRoute(new Route(_stations.GetStationByLocation("Plymouth"), _stations.GetStationByLocation("Ipswich"), 26.00m));
 }