Ejemplo n.º 1
0
 private void OverViewPlaneRefresh()
 {
     try
     {
         ServiceReference1.AirportDto airport = (ServiceReference1.AirportDto)dgOverViewAirports.SelectedItem;
         ServiceReference1.PlaneDto[] planes  = proxyPlane.GetPlanesWhereAirportId(airport.AirportId);
         dgOverViewPlanes.ItemsSource = planes;
         planes = proxyPlane.GetPlanesInAir();
         dgOverViewPlanesInAir.ItemsSource = planes;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Choose city first", "PARAMS !!", MessageBoxButton.OK);
         return;
     }
 }
Ejemplo n.º 2
0
        public void MyInit()
        {
            ServiceReference1.AirportDto airport = new ServiceReference1.AirportDto();
            airport.AirportId = 1;
            airport.City      = "Danzig";
            proxyAirports.AddAirport(airport);
            airport.AirportId = 2;
            airport.City      = "Moscow";
            proxyAirports.AddAirport(airport);
            airport.AirportId = 3;
            airport.City      = "Breslau";
            proxyAirports.AddAirport(airport);

            ServiceReference1.PlaneDto plane = new ServiceReference1.PlaneDto();
            plane.PlaneId      = 1;
            plane.SerialNumber = 12311;
            plane.AirportId    = 1;
            proxyPlane.AddPlane(plane);
            plane              = new ServiceReference1.PlaneDto();
            plane.PlaneId      = 2;
            plane.SerialNumber = 123111;
            plane.AirportId    = 2;
            proxyPlane.AddPlane(plane);

            ServiceReference1.PassengerDto pass = new ServiceReference1.PassengerDto();
            pass.PassengerId = 1;
            pass.FirstName   = "Adam";
            pass.LastName    = "Smith";
            pass.PlaneId     = null;
            proxyPassenger.AddPassenger(pass);
            pass             = new ServiceReference1.PassengerDto();
            pass.PassengerId = 2;
            pass.FirstName   = "John";
            pass.LastName    = "Wayne";
            pass.PlaneId     = null;
            proxyPassenger.AddPassenger(pass);

            ServiceReference1.FlightDto flight = new ServiceReference1.FlightDto();
            flight.FlightId       = 1;
            flight.TimeDeparture  = new System.DateTime(2019, 11, 2, 13, 13, 13);
            flight.TimeArrival    = new System.DateTime(2019, 11, 3, 16, 16, 16);
            flight.AimArrivalId   = 2;
            flight.AimDepartureId = 1;
            flight.PlaneId        = 1;
            proxyFlight.AddFlight(flight);
            flight.FlightId       = 2;
            flight.TimeDeparture  = new System.DateTime(2019, 11, 5, 13, 13, 13);
            flight.TimeArrival    = new System.DateTime(2019, 11, 8, 16, 16, 16);
            flight.AimArrivalId   = 3;
            flight.AimDepartureId = 2;
            flight.PlaneId        = 2;
            proxyFlight.AddFlight(flight);
            flight.FlightId       = 3;
            flight.TimeDeparture  = new System.DateTime(2019, 11, 7, 13, 13, 13);
            flight.TimeArrival    = new System.DateTime(2019, 11, 16, 16, 16, 16);
            flight.AimArrivalId   = 3;
            flight.AimDepartureId = 2;
            flight.PlaneId        = 1;
            proxyFlight.AddFlight(flight);

            ServiceReference1.TicketDto ticket = new ServiceReference1.TicketDto();
            ticket.TicketId    = 1;
            ticket.Price       = 100;
            ticket.FlightId    = 1;
            ticket.PassengerId = 1;
            proxyTicket.AddTicket(ticket);
            ticket.TicketId    = 2;
            ticket.Price       = 100;
            ticket.FlightId    = 2;
            ticket.PassengerId = 1;
            proxyTicket.AddTicket(ticket);
        }