Ejemplo n.º 1
0
        private void Btn_Edit_Click(object sender, RoutedEventArgs e)
        {
            Airport selectedAirport = (Airport)DGAirport.SelectedItem;

            if (SelectedAirport(selectedAirport))
            {
                Airport           oldAirport = selectedAirport.Clone() as Airport;
                EditAirportWindow eaw        = new EditAirportWindow(selectedAirport, EditAirportWindow.Option.EDIT);
                if (eaw.ShowDialog() != true)
                {
                    int index = IndexOfSelectedAirport(oldAirport.AirportID);
                    Data.Instance.Airports[index] = oldAirport;
                }
                else
                {
                    selectedAirport.Change();
                }
            }
        }
Ejemplo n.º 2
0
        private void Btn_Add_Click(object sender, RoutedEventArgs e)
        {
            EditAirportWindow eaw = new EditAirportWindow(new Airport(), EditAirportWindow.Option.ADDING);

            eaw.ShowDialog();
        }