Beispiel #1
0
        private void Add_Button_Click(object sender, RoutedEventArgs e)
        {
            Console.WriteLine(DepartureDateTime);

            Console.WriteLine(ArrivalDateTime);
            bool success = false;

            try
            {
                var planeDetail = (PlaneDetailDao)planeTypeCombobox.SelectedItem;

                var flightInfo = new FlightInfo()
                {
                    FlightNo           = FlightNoTextbox,
                    PlaneId            = planeDetail.PlaneId,
                    DepartureAirport   = DepartureAirportTextbox,
                    ArrivalAirport     = ArrivalAirportTextbox,
                    DepartureTime      = DepartureDateTime,
                    ArrivalTime        = ArrivalDateTime,
                    FirstClassPrice    = FirstClassPriceTextbox,
                    EconomyClassPrice  = EconomyClassPriceTextbox,
                    FirstClassCapacity = FirstClassCapacityTextbox,
                    EcoClassCapacity   = EconomyClassCapacityTextbox,
                    IsAvailable        = IsAvailable,
                };

                var flightServiceClient = new FlightServiceClient();
                success = flightServiceClient.InsertFlightInfo(flightInfo);
            }
            catch (Exception)
            {
            }


            if (success)
            {
                var flightDetails = new FlightDetails();
                NavigationService.Navigate(flightDetails);
            }
            else
            {
                ErrorDisplay.Text = "Cannot add flight information. Invalid input.";
            }
        }
Beispiel #2
0
        private void Guest_Button_Click(object sender, RoutedEventArgs e)
        {
            var flight = new FlightDetails();

            NavigationService.Navigate(flight);
        }