Exemple #1
0
 /// <summary>
 /// constructor for the add passenger window
 /// </summary>
 public wndAddPassenger(clsUILogic uILogic)
 {
     try
     {
         InitializeComponent();
         this.uILogic = uILogic;
     }
     catch (Exception ex)
     {
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." + MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
     }
 }
        public MainWindow()
        {
            try
            {
                InitializeComponent();
                Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

                UILogic = new clsUILogic();

                List <clsFlightsObject> flights = UILogic.listOfFlightMethod();

                cbChooseFlight.ItemsSource = flights;
                colorSeats();
            }
            catch (Exception ex)
            {
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                            MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
 private void cmdAddPassenger_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         wndAddPass = new wndAddPassenger(UILogic);
         wndAddPass.ShowDialog();
         UILogic = wndAddPass.uILogic;
         if (UILogic.bNewPassangerAdded)
         {
             cbChooseFlight.IsEnabled     = false;
             cbChoosePassenger.IsEnabled  = false;
             cmdAddPassenger.IsEnabled    = false;
             cmdChangeSeat.IsEnabled      = false;
             cmdDeletePassenger.IsEnabled = false;
         }
     }
     catch (Exception ex)
     {
         HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                     MethodInfo.GetCurrentMethod().Name, ex.Message);
     }
 }