Interaction logic for PopUpAirlinerFacility.xaml
Inheritance: PopUpWindow
        public static object ShowPopUp(AirlinerClass airlinerClass, AirlinerFacility.FacilityType type)
        {
            PopUpWindow window = new PopUpAirlinerFacility(airlinerClass, type);

            window.ShowDialog();

            return window.Selected == null ? null : window.Selected;
        }
Beispiel #2
0
        public static object ShowPopUp(AirlinerClass airlinerClass, AirlinerFacility.FacilityType type)
        {
            PopUpWindow window = new PopUpAirlinerFacility(airlinerClass, type);

            window.ShowDialog();

            return(window.Selected == null ? null : window.Selected);
        }
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            AirlinerFacilityItem item = (AirlinerFacilityItem)((Button)sender).Tag;

            AirlinerFacility facility = (AirlinerFacility)PopUpAirlinerFacility.ShowPopUp(item.AirlinerClass, item.Facility.Type);

            if (facility != null && item.AirlinerClass.getFacility(item.Facility.Type) != facility)
            {
                if (facility.Type == AirlinerFacility.FacilityType.Seat)
                {
                    item.AirlinerClass.SeatingCapacity = Convert.ToInt16(Convert.ToDouble(item.AirlinerClass.RegularSeatingCapacity) / facility.SeatUses);
                }

                item.AirlinerClass.setFacility(null, facility);

                showFacilities();
            }
        }