private void txtIATA_TextChanged(object sender, EventArgs e) { if (txtIATA.Text.Length == 9) { IATA iata = GetAllFirmModulesBL.GetIATA(txtIATA.Text); if (!string.IsNullOrEmpty(iata.Code)) { txtIATA.Text = iata.Code; txtIATA.Enabled = true; txtOffice.Text = iata.Office; txtPCC.Text = iata.Pcc; txtOffice.Focus(); } else { MessageBox.Show("El número de IATA no existe, debe ser dado de alta", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtIATA.Text = string.Empty; txtOffice.Text = string.Empty; txtPCC.Text = string.Empty; txtIATA.Enabled = true; txtIATA.Focus(); } } }
/// <summary> /// Handles the TextChanged event of the txtTA control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The event<see cref="System.EventArgs"/> instance containing the event data.</param> private void txtTA_TextChanged(object sender, EventArgs e) { if (txtTA.Text.Length == 6) { TA ta = GetAllFirmModulesBL.GetTA(txtTA.Text); if (!string.IsNullOrEmpty(ta.Code)) { txtTA.Text = ta.Code; cmbType.Text = ta.Type; txtPCC.Text = ta.Pcc; cmbType.Focus(); } else { MessageBox.Show("El número de TA no existe, debe ser dado de alta", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtTA.Text = string.Empty; cmbType.Text = string.Empty; txtPCC.Text = string.Empty; cmbType.Focus(); } } }