Exemplo n.º 1
0
        private void btnFlight_Click(object sender, RoutedEventArgs e)
        {
            if (!String.IsNullOrEmpty(txtBoxDestination.Text) && !String.IsNullOrEmpty(comboAirplane.Text))
            {
                int airplane_id = int.Parse(comboAirplane.SelectedValue.ToString());

                ServiceAirNautis.Travel new_travel = new ServiceAirNautis.Travel();
                new_travel.Airplane    = airplane_id;
                new_travel.Destination = txtBoxDestination.Text;

                if (airNautisService.NewOutgoingTravel(new_travel))
                {
                    MessageBox.Show(string.Format("Airplane on his way to {0} !", txtBoxDestination.Text), "Success", MessageBoxButton.OK);
                    DialogResult = true;
                }
                else
                {
                }
            }
        }
Exemplo n.º 2
0
        private void btnFlight_Click(object sender, RoutedEventArgs e)
        {
            if (!String.IsNullOrEmpty(txtBoxOrigin.Text) && !String.IsNullOrEmpty(comboHangar.Text) && !String.IsNullOrEmpty(comboAirplane.Text))
            {
                int airplane_id   = int.Parse(comboAirplane.SelectedValue.ToString());
                int hangar_number = int.Parse(comboHangar.SelectedValue.ToString());


                ServiceAirNautis.Travel new_travel = new ServiceAirNautis.Travel();
                new_travel.Airplane    = airplane_id;
                new_travel.Origin      = txtBoxOrigin.Text;
                new_travel.Destination = hangar_number.ToString();

                if (airNautisService.NewIncomingTravel(new_travel))
                {
                    MessageBox.Show(string.Format("Airplane comming from {0} its on his way to hangar {1} !", txtBoxOrigin.Text, hangar_number), "Success", MessageBoxButton.OK);
                    DialogResult = true;
                }
                else
                {
                    MessageBox.Show(string.Format("Hangar {0} is currently full !", hangar_number), "Alert", MessageBoxButton.OK);
                }
            }
        }