/// <summary> /// AddPassenger click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { //create new instance of add passenger window wndAddPass = new wndAddPassenger(); //display it wndAddPass.ShowDialog(); //if the user is in save passenger mode if (wndAddPass.saveMode) { //new instance of clsFlightManager class clsFlightManager = new clsFlightManager(); //disable buttons, forcing user to click on a label cmdDisableButtons(); } } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// The event handler for the Add Passenger button /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The event args</param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { wndAddPass = new wndAddPassenger(this); wndAddPass.ShowDialog(); } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// This will happen whenever AddPassenger has happened /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { wndAddPass = new wndAddPassenger(); wndAddPass.ShowDialog(); if (clsPassengerManager.insertLName != "" && clsPassengerManager.insertFname != "") { gPassengerCommands.IsEnabled = false; cbChooseFlight.IsEnabled = false; cbChoosePassenger.IsEnabled = false; } } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// Opens a new Window to add new Passenger /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { //Creating the new window and showing it wndAddPass = new wndAddPassenger(); wndAddPass.ShowDialog(); //checking to see if the clicked cancel or save. If saved then dissable the panels if (GlobalVariables.PAddOn) { cbChoosePassenger.IsEnabled = false; gPassengerCommands.IsEnabled = false; cbChooseFlight.IsEnabled = false; } } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// This method opens a new window for a new passenger for the current flight to be added. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { wndAddPass.ShowDialog(); //IF submission happened, then select that new person/call change seat if (wndAddPass.GetsubmissionStatus() == true) { PopulateChoosePassengerCB(sFlightID); cmdChangeSeat_Click(sender, e); } else { } } 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); } }
/// <summary> /// Starts the process to add a new passenger /// Opens a new wpf form when clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { wndAddPass = new wndAddPassenger(); wndAddPass.ShowDialog(); //gets the passenger first name from the wndAddPass wpf form passengerName = wndAddPass.txtFirstName.Text; //only hits if the user clicked on save with correct information if (passengerName != "") { //globally set the passengerID so we can query it into the link table when the user clicks a tile passID = fClass.GetPassengerID(passengerName); addingSeat = true; //refreshing list if (activeSeatCanvas == c767_Seats) { PopulateBoeingColors(); } else { PopulateAirbusColors(); } //disable all form except for addPassenger BUtton DisableAllControls(); } } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }
/// <summary> /// OnClick Listener for the Add Passenger button /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">Event object</param> private void cmdAddPassenger_Click(object sender, RoutedEventArgs e) { try { //Show Add Passenger window wndAddPass = new wndAddPassenger(((Flight)(cbChooseFlight.SelectedItem))._Id); wndAddPass.ShowDialog(); //Enable/Disable buttons resetButtonUI(); //Rebind the passengers with the newly inserted passenger included rebindPassengers(); //Set the currently selected index to be the last passenger added cbChoosePassenger.SelectedIndex = BoundPassenger.Count - 1; //Change the status to Adding Passenger Status = "Adding Passenger"; //Show a message to the user FlightStatusTxt.Text = "Please select an empty seat(blue) for " + ((Passenger)(cbChoosePassenger.SelectedItem))._FullName + "."; } catch (Exception ex) { HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name, MethodInfo.GetCurrentMethod().Name, ex.Message); } }