/// <summary> /// OBtiene el pasajero y valida la selección. /// </summary> /// <returns></returns> public InterJetPassanger GetPassanger() { InterJetPassanger pax = this.PassangerFactory[this.CurrentUserControl.PassangerType](); TextBox nameTextBox = this.GetTextBoxByName("Name_"); this.ValidateTextBoxEmptyNess(nameTextBox, "NOMBRE", this.PassangerID); pax.Name = nameTextBox.Text; TextBox lastNameTextBox = this.GetTextBoxByName("LastName"); this.ValidateTextBoxEmptyNess(lastNameTextBox, "APELLIDO", this.PassangerID); pax.LastName = lastNameTextBox.Text; ComboBox titleComboBox = this.GetComboBoxByName("Title"); this.ValidateComboBox(titleComboBox, "TITULO", this.PassangerID); pax.Title = titleComboBox.SelectedValue.ToString(); pax.DateOfBirth = this.CurrentUserControl.DateOfBirth; if (pax.Title == "INF") { ComboBox tripInfantComboBox = this.GetComboBoxByName("cmbTripInfant"); this.ValidateComboBox(tripInfantComboBox, "TripINFANTE", this.PassangerID); pax.TripInfant = Convert.ToInt32(tripInfantComboBox.SelectedValue); } return(pax); }
/// <summary> /// Sets the inter jet passanger. /// </summary> /// <param name="passanger">The passanger.</param> public void SetInterJetPassanger(InterJetPassanger passanger) { //TextBox clubInteJetTextBox = this.GetTextBoxByName("ClubInterJet"); //clubInteJetTextBox.Text = passanger.InterJetClubCode; TextBox nameTextBox = this.GetTextBoxByName("Name_"); nameTextBox.Text = passanger.Name; TextBox lastNameTextBox = this.GetTextBoxByName("LastName"); lastNameTextBox.Text = passanger.LastName; ComboBox titleComboBox = this.GetComboBoxByName("Title"); titleComboBox.SelectedItem = passanger.Title; ComboBox suffixComboBox = this.GetComboBoxByName("Suffix"); titleComboBox.SelectedItem = passanger.Suffix; CheckBox contactCheckBox = this.GetCheckBoxByName("Contact"); contactCheckBox.Checked = passanger.IsTheContact; this.CurrentUserControl.DateOfBirth = passanger.DateOfBirth; }
private void AsignInfantToPasanger(string idOfPassangerAssigned, InterJetPassangerInfant infant, ComboBox selectedPassangerID) { var passangers = (InterJetPassangers)this.Session["Passangers"]; InterJetPassanger passanger = passangers.FindPassanger(idOfPassangerAssigned); if (passanger is InterJetAdultPassanger) { var adultPassanger = (InterJetAdultPassanger)passanger; if (!adultPassanger.HasAlreadyAInfant) { adultPassanger.AssignedInfant = infant; infant.AssignedPassanger = adultPassanger; } else { selectedPassangerID.Focus(); throw new Exception(string.Format("POR FAVOR INDIQUE OTRO PASAJERO QUE ACOMPAÑE AL INFANTE {0}.", infant.Name)); } } else { var seniorPassanger = (InterJetSeniorAdultPassanger)passanger; if (!seniorPassanger.HasAlreadyAInfant) { seniorPassanger.AssignedInfant = infant; infant.AssignedPassanger = seniorPassanger; } else { selectedPassangerID.Focus(); throw new Exception(string.Format("POR FAVOR INDIQUE OTRO PASAJERO QUE ACOMPAÑE AL INFANTE {0}.", infant.Name)); } } }
/// <summary> /// Sets the inter jet passanger. /// </summary> /// <param name="passanger">The passanger.</param> public void SetInterJetPassanger(InterJetPassanger passanger) { CheckBox chkDeparture = this.GetCheckBoxByName("Departure"); chkDeparture.Checked = passanger.Departure; CheckBox chkArrival = this.GetCheckBoxByName("Arrival"); chkArrival.Checked = passanger.Arrival; }
/// <summary> /// Sets the inter jet passanger. /// </summary> /// <param name="passanger">The passanger.</param> public void SetInterJetPassanger(InterJetPassanger passanger) { TextBox nameTextBox = this.GetTextBoxByName("Name_"); nameTextBox.Text = passanger.Name; TextBox lastNameTextBox = this.GetTextBoxByName("LastName"); lastNameTextBox.Text = passanger.LastName; ComboBox titleComboBox = this.GetComboBoxByName("Title"); titleComboBox.Text = TranslateFromTitleToTitulo(passanger.Title); this.CurrentUserControl.DateOfBirth = passanger.DateOfBirth; if (passanger.Title == "INF") { ComboBox tripInfantComboBox = this.GetComboBoxByName("cmbTripInfant"); tripInfantComboBox.Text = TranslateFromTripInfant(passanger.TripInfant); } }
/// <summary> /// OBtiene el pasajero y valida la selección. /// </summary> /// <returns></returns> public InterJetPassanger GetPassanger() { InterJetPassanger pax = this.PassangerFactory[this.CurrentUserControl.PassangerType](); //TextBox clubInteJetTextBox = this.GetTextBoxByName("ClubInterJet"); //pax.InterJetClubCode = clubInteJetTextBox.Text; TextBox nameTextBox = this.GetTextBoxByName("Name_"); this.ValidateTextBoxEmptyNess(nameTextBox, "NOMBRE", this.PassangerID); pax.Name = nameTextBox.Text; TextBox lastNameTextBox = this.GetTextBoxByName("LastName"); this.ValidateTextBoxEmptyNess(lastNameTextBox, "APELLIDO", this.PassangerID); pax.LastName = lastNameTextBox.Text; ComboBox titleComboBox = this.GetComboBoxByName("Title"); this.ValidateComboBox(titleComboBox, "TITULO", this.PassangerID); pax.Title = titleComboBox.SelectedValue.ToString(); ComboBox suffixComboBox = this.GetComboBoxByName("Suffix"); pax.Suffix = suffixComboBox.SelectedItem.ToString(); CheckBox contactCheckBox = this.GetCheckBoxByName("Contact"); // ClubInterJet pax.IsTheContact = contactCheckBox.Checked; //TextBox lclubInterJetTextBox = this.GetTextBoxByName("ClubInterJet"); //pax.InterJetClubCode = lclubInterJetTextBox.Text; pax.DateOfBirth = this.CurrentUserControl.DateOfBirth; return(pax); }
public void SetPassanger(InterJetPassanger pax) { this.Handler.SetPassanger(pax); }
/// <summary> /// Sets the name of the passanger. /// </summary> /// <param name="pax">The pax.</param> private void SetPassangerName(InterJetPassanger pax) { Label nameLabel = this.GetLabelByName("paxNameLabel"); nameLabel.Text = pax.FullName; }
/// <summary> /// Sets the passanger. /// </summary> /// <param name="pax">The pax.</param> public void SetPassanger(InterJetPassanger pax) { this.SetPassangerName(pax); }