private void creditCardNumberTextBox_Leave(object sender, EventArgs e) { string sNumberCardCTS = creditCardNumberTextBox.Text; if (!string.IsNullOrEmpty(sNumberCardCTS)) { WsMyCTS wsServ = new WsMyCTS(); string creditCard = wsServ.GetCreditCardNumberCTS(sNumberCardCTS); //string creditCard = GetCreditCardNumberBL.GetCreditCardNumber(sNumberCardCTS); if (ctsCheckBox.Checked == true) { if (string.IsNullOrEmpty(creditCard)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta perteneciente a CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); creditCardNumberTextBox.Text = string.Empty; } } else if (clientCheckBox.Checked == true) { if (!string.IsNullOrEmpty(creditCard)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta diferente a una de CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); creditCardNumberTextBox.Text = string.Empty; } } } }
/// <summary> /// Connects to back up server. /// </summary> /// <param name="reservation">The reservation.</param> private void ConnectToBackUpServer(VolarisReservation reservation) { try { WsMyCTS wsServ = new WsMyCTS(); //var oracleConnection = new OracleConnection(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = wsServ.GetAttribute(UserDK, LogOrId); //Services.MyCTSOracleConnectionDev.GetAttribute1 integraAttribute = oracleConnection.GetAttribute1Dev(UserDK, LogOrId); if (integraAttribute != null) { SetCustomerAttributes(reservation, UserDK, integraAttribute.Status, integraAttribute.Status_Site, integraAttribute.Attribute1); } else { SetCustomerAttributes(reservation, UserDK, string.Empty, string.Empty, string.Empty); } } catch (Exception exe) { SetCustomerAttributes(reservation, UserDK, string.Empty, string.Empty, string.Empty); } }
public static void loadQualityControlsList() { //Obtiene el DK (Attribute1) para validar los Qualities WsMyCTS wsServ = new WsMyCTS(); corporativequalitycontrols = wsServ.GetCorporativeQualityControls(ucFirstValidations.Attribute1).ToList(); }
public static void loadQualityControlsHotelsList(string Attribute1) { //Obtiene el DK (Attribute1) para validar los Qualities... WsMyCTS wsServ = new WsMyCTS(); corporativequalitycontrols = wsServ.GetCorporativeQualityControls(Attribute1).ToList(); //corporativequalitycontrols = CatCorporativeQualityControlsBL.GetCorporativeQualityControls(Attribute1); }
private bool ValidarTarjetaCTS(string sNumberCardCTS, TextBox txtGenerico) { try { WsMyCTS wsServ = new WsMyCTS(); BuildElectronicTicketContract getDK = new BuildElectronicTicketContract(); GetInfoPassengerByPNR getPNR = new GetInfoPassengerByPNR(); var respuesta = getPNR.GetInfoPassengerPNR(recLoc); ucFirstValidations.DK = respuesta.CustomerIdentifier; MyCTS.Services.ValidateDKsAndCreditCards.ClientCreditCard clientCreditCard = wsServ.GetClientCreditCardNumber(sNumberCardCTS, ucFirstValidations.DK); if (string.IsNullOrEmpty(sNumberCardCTS)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta. Ingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtGenerico.Text = string.Empty; return(false); } if (!string.IsNullOrEmpty(sNumberCardCTS)) { string creditCard = wsServ.GetCreditCardNumberCTS(txtNumberCardCTS.Text); if (!string.IsNullOrEmpty(creditCard)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta diferente a una de CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtGenerico.Text = string.Empty; return(false); } if (string.IsNullOrEmpty(creditCard)) { string clientCreditCardNumber = wsServ.GetClientCreditCardNumberATT(txtNumberCardCTS.Text); if (string.IsNullOrEmpty(clientCreditCardNumber)) { if (ValidateCreditCardNumber) { // No hace nada } } else if (clientCreditCard.CreditCardNumber != txtNumberCardCTS.Text) { MessageBox.Show("El número de tarjeta ingresado pertenece a un cliente diferente, ingrese un número de tarjeta válido", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Focus(); return(false); } } } } catch (Exception ex) { this.Focus(); MessageBox.Show("Error al validar tarjeta. Reintente"); txtGenerico.Text = string.Empty; return(false); } return(true); }
private void creditCardTextBox_Leave(object sender, EventArgs e) { try { string sNumberCardCTS = creditCardTextBox.EditValue.ToString(); if (!string.IsNullOrEmpty(sNumberCardCTS)) { WsMyCTS wsServ = new WsMyCTS(); string creditCard = wsServ.GetCreditCardNumberCTS(sNumberCardCTS); if (ctsCheckBox.Checked == true) { if (string.IsNullOrEmpty(creditCard)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta perteneciente a CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); creditCardTextBox.EditValue = string.Empty; } } else if (clientCheckBox.Checked == true) { if (!string.IsNullOrEmpty(creditCard)) { MyCTS.Services.ValidateDKsAndCreditCards.ClientCreditCard clientCreditCard = wsServ.GetClientCreditCardNumber(creditCardTextBox.Text, ucFirstValidations.dk); if (clientCreditCard.CreditCardNumber != null) { if (clientCreditCard.CreditCardNumber != creditCardTextBox.Text && clientCreditCard.Client != ucFirstValidations.dk) { MessageBox.Show("El número de tarjeta ingresado pertenece a un cliente diferente, ingrese un número de tarjeta válido", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); creditCardTextBox.Focus(); } else if (ValidateCreditCardNumber) { } } else { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta diferente a una de CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); creditCardTextBox.EditValue = string.Empty; } } } } } catch (Exception ex) { this.Focus(); MessageBox.Show("Error al validar tarjeta. Reintente"); creditCardTextBox.EditValue = string.Empty; } }
private void txtNumberCard_Leave(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtNumberCard.Text)) { WsMyCTS wsServ = new WsMyCTS(); string creditCard = wsServ.GetCreditCardNumberCTS(txtNumberCard.Text); //string creditCard = GetCreditCardNumberBL.GetCreditCardNumber(txtNumberCard.Text); if (!string.IsNullOrEmpty(creditCard)) { MessageBox.Show("Debes ingresar un número de tarjeta diferente a una de CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCard.Text = string.Empty; } } }
/// <summary> /// Connects to production server. /// </summary> /// <param name="reservation">The reservation.</param> private void ConnectToProductionServer(VolarisReservation reservation) { WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = wsServ.GetAttribute(UserDK, LogOrId); if (integraAttribute != null) { SetCustomerAttributes(reservation, UserDK, integraAttribute.Status, integraAttribute.Status_Site, integraAttribute.Attribute1); } else { SetCustomerAttributes(reservation, UserDK, string.Empty, string.Empty, string.Empty); } }
/// <summary> /// Busca si el DK ingresado ya se encuentra en algún perfil guardado /// </summary> private Boolean ExistDkInProfiles(string customerDk) { WsMyCTS wsServ = new WsMyCTS(); var listProfiles = wsServ.GetStar1ByDk(customerDk).ToList(); //var listProfiles = GetStar1ProfileByDkBL.GetStar1ByDk(customerDk); if (listProfiles.Count > 0) { string prefiles = ""; foreach (var prefil in listProfiles) { prefiles = prefiles + " * " + prefil.Level1 + "\n"; } MessageBox.Show("Este DK no puede ser utilizado en la creación del perfil\n" + "debido a que ya pertenece a los siguientes perfiles:\n\n" + prefiles, "Validación DK", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return(true); } return(false); }
/// <summary> /// Busca si existe el DK /// </summary> /// private Boolean ExistLocationInformation() { string location = txtDK.Text; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation star1InfoByLocation = null; MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation star1InfoByLocation1 = null; //OracleConnection GetProfile = new OracleConnection(); //MyCTS.Services.MyCTSOracleConnection.Cat1stStarInfoByLocation star1InfoByLocation = null; //MyCTS.Services.MyCTSOracleConnectionDev.Cat1stStarInfoByLocation star1InfoByLocation1 = null; try { star1InfoByLocation = wsServ.Get1stStarInfoByLocation(location); return(true); } catch { star1InfoByLocation = wsServ.Get1stStarInfoByLocation(location); return(true); } return(false); }
public static bool ValidarTarjetaCTS(string sNumeroTarjeta) { try { if (string.IsNullOrEmpty(sNumeroTarjeta)) { return(false); } WsMyCTS wsServ = new WsMyCTS(); string creditCard = wsServ.GetCreditCardNumberCTS(sNumeroTarjeta); if (string.IsNullOrEmpty(creditCard)) { return(false); } } catch (Exception ex) { MessageBox.Show("Error al validar tarjeta. Reintente"); } return(true); }
private void creditCardCombo_SelectedIndexChanged(object sender, EventArgs e) { FormOfPayment form = creditCardCombo.SelectedItem as FormOfPayment; if (form != null) { Font nvaFuente = new Font("Tahoma", 8.25F); creditCardTextBox.Text = String.Empty; creditCardTextBox.Properties.PasswordChar = new char(); creditCardTextBox.Font = nvaFuente; if (form.Type == GenericFormOfPayment.Cash) { this.EnabledCreditCardFieldsCash(false); } else if (form.Type == GenericFormOfPayment.Transfer || form.Type == GenericFormOfPayment.Check) { this.EnabledCreditCardFieldsCheckAndTransfer(false); WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetTranferCheckNumber data = new MyCTS.Services.ValidateDKsAndCreditCards.GetTranferCheckNumber(); data = wsServ.GetTranferCheckNumberMyCTS(ucFirstValidations.Attribute1); creditCardTextBox.Text = data.ct_banc_cbr; Font nvaFuentePassword = new Font("Symbol", 9F); creditCardTextBox.Properties.PasswordChar = '·'; creditCardTextBox.Font = nvaFuentePassword; creditCardTextBox.Focus(); } else { this.EnabledCreditCardFieldsCash(true); Font nvaFuentePassword = new Font("Symbol", 9F); creditCardTextBox.Properties.PasswordChar = '·'; creditCardTextBox.Font = nvaFuentePassword; } creditCardTextBox.Focus(); } }
/// <summary> /// Carga informacion a la mascarilla por Location /// </summary> private Boolean ExistAndLoadLocationInformation() { string send = "*PDK"; string res = string.Empty; string location = string.Empty; using (CommandsAPI objCommand = new CommandsAPI()) { res = objCommand.SendReceive(send); } if (res.Trim() != "‡NO PSGR DATA‡") { location = res.Substring(18, 6); } WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation star1InfoByLocation = null; try { star1InfoByLocation = wsServ.GetProfileInfo(location); } catch { } if (star1InfoByLocation != null) { if (!string.IsNullOrEmpty(star1InfoByLocation.CustomerName)) { string customer = star1InfoByLocation.CustomerName.ToString(); customer = customer.Replace("(", ""); customer = customer.Replace(")", ""); txtSocialReason.Text = customer.Replace(',', ' '); } if (!string.IsNullOrEmpty(star1InfoByLocation.Address1)) { txtStreet.Text = star1InfoByLocation.Address1.Replace(',', ' '); } ; if (!string.IsNullOrEmpty(star1InfoByLocation.Address2)) { star1InfoByLocation.Address2 = star1InfoByLocation.Address2.Replace("#", ""); star1InfoByLocation.Address2 = star1InfoByLocation.Address2.TrimStart().Replace(',', ' ');; txtNumberExt.Text = star1InfoByLocation.Address2; } if (!string.IsNullOrEmpty(star1InfoByLocation.Address3)) { star1InfoByLocation.Address3 = star1InfoByLocation.Address3.Replace("#", ""); star1InfoByLocation.Address3 = star1InfoByLocation.Address3.TrimStart().Replace(',', ' '); txtNumberInt.Text = star1InfoByLocation.Address3; } if (!string.IsNullOrEmpty(star1InfoByLocation.Address4)) { txtColony.Text = star1InfoByLocation.Address4; } if (star1InfoByLocation.Address4 == "") { txtColony.Enabled = true; } if (!string.IsNullOrEmpty(star1InfoByLocation.Municipality)) { txtDelegation.Text = star1InfoByLocation.Municipality.Replace(',', ' '); } if (!string.IsNullOrEmpty(star1InfoByLocation.PostalCode)) { txtCP.Text = star1InfoByLocation.PostalCode; } if (!string.IsNullOrEmpty(star1InfoByLocation.City)) { txtCity.Text = star1InfoByLocation.City.Replace(',', ' '); } if (!string.IsNullOrEmpty(star1InfoByLocation.State)) { txtState.Text = star1InfoByLocation.State.Replace(',', ' '); } if (!string.IsNullOrEmpty(star1InfoByLocation.RFC)) { bool IsRFC = ValidateRegularExpression.ValidateRFCFormat(star1InfoByLocation.RFC); if (IsRFC) { if (star1InfoByLocation.RFC.Length.Equals(13)) { txtRFC1.Text = star1InfoByLocation.RFC.Substring(0, 4); txtRFC2.Text = star1InfoByLocation.RFC.Substring(4, 6); txtRFC3.Text = star1InfoByLocation.RFC.Substring(10, 3); } else if (star1InfoByLocation.RFC.Length.Equals(12)) { txtRFC1.Text = star1InfoByLocation.RFC.Substring(0, 3); txtRFC2.Text = star1InfoByLocation.RFC.Substring(3, 6); txtRFC3.Text = star1InfoByLocation.RFC.Substring(9, 3); } } } return(true); } return(true); }
private void HideAndShowCaptureControls(int iCurrentPaxNumberMenosUno, ListItem item) { txtNumberCardCTS.PasswordChar = new char(); switch (item.Value) { case "CASH": txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Visible = false; lblCardNumberCTS.Visible = false; txtDigitoSeguridad.Visible = false; cmbMesVencimiento.Visible = false; cmbAnioVencimiento.Visible = false; txtNombreTarjetahabiente.Visible = false; lblDigitoSeguridad.Visible = false; lblMesVencimiento.Visible = false; lblAnioVencimiento.Visible = false; lblNombreTarjetahabiente.Visible = false; break; case "CH": case "TR": case "TP": switch (item.Value) { case "TP": lblCardNumberCTS.Text = "Número de tarjeta"; txtNumberCardCTS.MaxLength = 16; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; default: lblCardNumberCTS.Text = "Número de cuenta"; txtNumberCardCTS.MaxLength = 4; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; } lblCardNumberCTS.Visible = true; if (item.Value != "TP") { if (string.IsNullOrEmpty(ChargesPerService.DKActual)) { ChargesPerService.RecuperarDK(); } WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetTranferCheckNumber data = new MyCTS.Services.ValidateDKsAndCreditCards.GetTranferCheckNumber(); data = wsServ.GetTranferCheckNumberMyCTS(ChargesPerService.DKActual); txtNumberCardCTS.Text = data.ct_banc_cbr; } else { txtNumberCardCTS.Text = String.Empty; } txtNumberCardCTS.Visible = true; txtDigitoSeguridad.Visible = false; cmbMesVencimiento.Visible = false; cmbAnioVencimiento.Visible = false; txtNombreTarjetahabiente.Visible = false; lblDigitoSeguridad.Visible = false; lblMesVencimiento.Visible = false; lblAnioVencimiento.Visible = false; lblNombreTarjetahabiente.Visible = false; break; default: lblCardNumberCTS.Text = "Número de tarjeta"; txtNumberCardCTS.Visible = true; lblCardNumberCTS.Visible = true; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); txtDigitoSeguridad.Visible = true; cmbMesVencimiento.Visible = true; cmbAnioVencimiento.Visible = true; txtNombreTarjetahabiente.Visible = true; lblDigitoSeguridad.Visible = true; lblMesVencimiento.Visible = true; lblAnioVencimiento.Visible = true; lblNombreTarjetahabiente.Visible = true; btnAccept.Text = "Aplicar cargo en línea"; switch (((ListItem)cmbTypeCard.SelectedItem).Value) { case "AX": txtNumberCardCTS.MaxLength = 16; txtDigitoSeguridad.MaxLength = 4; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; default: txtNumberCardCTS.MaxLength = 16; txtDigitoSeguridad.MaxLength = 3; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); break; } break; } }
private void ValidacionFormasDePago() { switch (cmbTypeCard.Text) { case "TR - TRANSFERENCIA": case "CASH - EFECTIVO": case "CH - CHEQUE": DeterminaValidacionGeneracionCargo(); break; case "TP - TC UATP": ///Validación para la FoP TP - TC UATP para que al validar las tarjetas, no valide ///todos los campos existentes en la plantilla aunque esten ocultos. Para cualquier ///otro caso se validan todos los campos en la plantilla. if (ValidateCreditCardNumber) { } break; default: if ((string.IsNullOrEmpty(cmbTypeCard.Text) || string.IsNullOrEmpty(txtDigitoSeguridad.Text) || string.IsNullOrEmpty(txtNombreTarjetahabiente.Text) || string.IsNullOrEmpty(cmbTypeCard.Text) || string.IsNullOrEmpty(cmbMesVencimiento.Text) || string.IsNullOrEmpty(cmbAnioVencimiento.Text) || string.IsNullOrEmpty(cmbTypeCard.Text))) { MessageBox.Show("¡Debes ingresar todos los campos!"); return; } //Se validan las fechas ingresadas por el usuario. No deben ser menor a los de la fecha actual int cmboFecYear = Convert.ToInt32(DateTime.Now.Year); int cmboFecMes = Convert.ToInt32(DateTime.Now.Month); int cmbFecYear = Convert.ToInt32(cmbAnioVencimiento.Text); if (cmbTypeCard.Text == "- Selecciona Forma de Pago -") { MessageBox.Show("¡Ingrese la Forma de Pago!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } cmbFecMes = seleccionaMes(); if (cmbFecYear < cmboFecYear) { MessageBox.Show("¡Datos de vigencia de la tarjeta invalido, verifica el año!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); cmbAnioVencimiento.Focus(); return; } if (cmbFecMes < cmboFecMes & cmboFecYear == cmbFecYear) { MessageBox.Show("¡Datos de vigencia de la tarjeta invalido, verifica el mes!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); cmbMesVencimiento.Focus(); return; } if (string.IsNullOrEmpty(txtNumberCardCTS.Text)) { MessageBox.Show("Debes ingresar un número de tarjeta. Ingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Focus(); return; } ChargesPerService.RecuperarDK(); WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.ClientCreditCard clientCreditCard = wsServ.GetClientCreditCardNumber(txtNumberCardCTS.Text, ChargesPerService.DKActual); string creditCard = wsServ.GetCreditCardNumberCTS(txtNumberCardCTS.Text); if (!string.IsNullOrEmpty(creditCard)) { this.Focus(); MessageBox.Show("Debes ingresar un número de tarjeta diferente a una de CTS. Reingrese", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Focus(); return; } string clientCreditCardNumber = wsServ.GetClientCreditCardNumberATT(txtNumberCardCTS.Text); if (string.IsNullOrEmpty(clientCreditCardNumber)) { if (ValidateCreditCardNumber) { // No hace nada } } else { if (clientCreditCard.CreditCardNumber != txtNumberCardCTS.Text) { MessageBox.Show("El número de tarjeta ingresado pertenece a un cliente diferente, ingrese un número de tarjeta válido", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtNumberCardCTS.Text = string.Empty; txtNumberCardCTS.Focus(); return; } } if (txtNumberCardCTS.Text == clientCreditCard.CreditCardNumber & ChargesPerService.DKActual == clientCreditCard.Client) { DeterminaValidacionGeneracionCargo(); } break; } if (!VerificarCargoPrevio()) { Pagar(); } else { MessageBox.Show("Ya cuenta con un intento de cargo por servicio previo para hoteles, no es posible realizar un nuevo cargo por servicio para hoteles mediante la interfaz", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
//Button Accept /// <summary> /// Se realizan las validaciones despues de que el usuario ingresa datos, /// se mandan los comandos y termina el proceso llamando a otro User Control /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAccept_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtDK.Text)) { MessageBox.Show(Resources.Reservations.REQUIERE_INGRESAR_DK, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtDK.Focus(); } else if (txtDK.Text.Length != 6) { MessageBox.Show(Resources.Reservations.EL_DK_DEBE_SER_6_CARACTERES, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtDK.Focus(); } else { CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.ESPERE_FAVOR_VALIDANDO_DK_INTEGRA)); statusNoExistDK = false; statusInactive = false; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = null; MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute1 = null; try { try { integraAttribute = wsServ.GetAttribute(txtDK.Text, Login.OrgId); } catch (Exception ex) { integraAttribute = wsServ.GetAttribute(txtDK.Text, Login.OrgId); } } catch (Exception ex) { MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 AttributeBackup = wsServ.GetAttribute(txtDK.Text, Login.OrgId); if (AttributeBackup != null) { if (!string.IsNullOrEmpty(AttributeBackup.Attribute1.ToString()) && (AttributeBackup.Attribute1.Contains(Resources.Reservations.MESSAGE_NO))) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(AttributeBackup.Attribute1.ToString()) && AttributeBackup.Attribute1.Contains(Resources.Reservations.MESSAGE_INACTIVO)) { statusInactive = true; } } } if (integraAttribute != null) { if (!string.IsNullOrEmpty(integraAttribute.Attribute1) && integraAttribute.Status.Contains("NO EXISTE LOCATION") || integraAttribute.Status_Site.Contains("NO EXISTE LOCATION")) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(integraAttribute.Attribute1) && integraAttribute.Status.Contains("INACTIVO") || integraAttribute.Status_Site.Contains("INACTIVO")) { statusInactive = true; } else { MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1 tempAttribute = new MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1(); tempAttribute = wsServ.SetQCGetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); Attribute1 = tempAttribute.Attribute1; } } else if (integraAttribute1 != null) { if (!string.IsNullOrEmpty(integraAttribute1.Attribute1) && (integraAttribute1.Status.Contains(Resources.Reservations.MESSAGE_NO)) || (integraAttribute1.Status_Site.Contains(Resources.Reservations.MESSAGE_NO))) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(integraAttribute1.Attribute1) && integraAttribute1.Status.Contains("INACTIVO") || integraAttribute1.Status_Site.Contains("INACTIVO")) { statusInactive = true; } else { MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1 tempAttribute = new MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1(); tempAttribute = wsServ.SetQCGetAttribute(integraAttribute1.Attribute1, integraAttribute1.Status, integraAttribute1.Status_Site); Attribute1 = tempAttribute.Attribute1; } } if (integraAttribute != null || integraAttribute1 != null) { if (IsValidateBusinessRules) { if (ucAvailability.IsInterJetProcess || VolarisSession.IsVolarisProcess) { if (integraAttribute != null) { ucFirstValidations.Attribute1 = integraAttribute.Attribute1; } else { } ChargesPerService.DKActualBajoCosto = txtDK.Text; ucFirstValidations.DK = txtDK.Text; activeStepsCorporativeQC.CorporativeQualityControls = null; activeStepsCorporativeQC.loadQualityControlsList(); ucFirstValidations.CorporativeQualityControls = activeStepsCorporativeQC.CorporativeQualityControls; if (VolarisSession.IsVolarisProcess) { VolarisSession.DK = txtDK.Text; if (!string.IsNullOrEmpty(Description1.Text)) { builtExtendedDescription(); } Loader.AddToPanel(Loader.Zone.Middle, this, "ucVolarisPaymentFormFormulario"); } else if (ucAvailability.IsInterJetProcess) { ucAllQualityControls.globalPaxNumber = this.TotalPassangerInterJet; ucQualitiesByPax.Pax = this.TotalPassangerInterJet; LogProductivity.LogTransaction(Login.Agent, "6-Desplego Captura de DK--InterJet"); this.SetPassangerNumberRecord(); builtExtendedDescription();//verificar si se manda //Loader.AddToPanelWithParameters(Loader.Zone.Middle, this, "ucInterJetPaymentForm", // this.Parameter, null); Loader.AddToPanelWithParameters(Loader.Zone.Middle, this, "ucSeatAllocation", this.Parameter, null); } } else { CommandsSend(); if (this.Parameters == null && !ucBoletageReceived.errorER) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else if (ucBoletageReceived.errorER) { DkClient = true; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCBOLETAGE_RECEIVED); } else { DkClient = true; string[] sendInfo = new string[] { optionSelected }; Loader.AddToPanelWithParameters(Loader.Zone.Middle, this, Resources.Constants.UCENDRESERVATION, sendInfo); } } } } else { MessageBox.Show(Resources.Reservations.NO_EXISTE_LOCATIONDK_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
/// <summary> /// Borra lineas contables /// </summary> private void CancelAccountingLine() { bool IsValid = false; int[] ordertickets = new int[cont + 1]; DK(); CommandsAPI2.send_MessageToEmulator(string.Concat("ESPERE POR FAVOR VALIDANDO DK")); string numTickets = string.Empty; List <string> sendxmltkvoidList = new List <string>(); string ticketsSub = string.Empty; for (int k = 1; k <= cont; k++) { numTickets = "00"; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = null; MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute1 = null; MyCTS.Entities.SetQCByAttribute1 Attribute1 = null; if (!string.IsNullOrEmpty(dk)) { try { try { integraAttribute = wsServ.GetAttribute(dk, Login.OrgId); } catch { integraAttribute = wsServ.GetAttribute(dk, Login.OrgId); } } catch { IsValid = LocationValidationBackup(); } } if (integraAttribute != null) { IsValid = true; if (!string.IsNullOrEmpty(integraAttribute.Attribute1.ToString()) && (integraAttribute.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_NO_EXISTE_LOCATION))) { MessageBox.Show(Resources.TicketEmission.Tickets.NO_LOCATION_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (!string.IsNullOrEmpty(integraAttribute.Attribute1.ToString()) && integraAttribute.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_INACTIVE)) { MessageBox.Show(Resources.TicketEmission.Tickets.NUM_CLIENTE_O_LOCATION_INACTIVO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { Attribute1 = SetQCByAttribute1BL.GetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); } } if (integraAttribute1 != null) { IsValid = true; if (!string.IsNullOrEmpty(integraAttribute1.Attribute1.ToString()) && (integraAttribute1.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_NO_EXISTE_LOCATION))) { MessageBox.Show(Resources.TicketEmission.Tickets.NO_LOCATION_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (!string.IsNullOrEmpty(integraAttribute1.Attribute1.ToString()) && integraAttribute1.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_INACTIVE)) { MessageBox.Show(Resources.TicketEmission.Tickets.NUM_CLIENTE_O_LOCATION_INACTIVO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { Attribute1 = SetQCByAttribute1BL.GetAttribute(integraAttribute1.Attribute1, integraAttribute1.Status, integraAttribute1.Status_Site); } } if (IsValid) { List <LabelXMLRemarks> listXMLRemarks = LabelXMLRemarksBL.GetLabelXMLRemarks(integraAttribute.Attribute1.ToString(), "Cancellation", tickets[k]); if (listXMLRemarks.Count > 0) { xlmtktvoid = listXMLRemarks[0].XMLFutureLabel; while (!string.IsNullOrEmpty(xlmtktvoid)) { sendxmltkvoidList.Add(xlmtktvoid); break; } } } } foreach (string xmltkvoid in sendxmltkvoidList) { using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(xmltkvoid); } } using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive("5H-.</TK CNL MYCTS/>"); } countTicket = 1; }
/// <summary> /// Obtención de record localizador, >DK y carga de quality controls para /// Corporativo /// </summary> private bool GetLocatorRecord() { bool IsValid = true; send = string.Empty; sabreAnswer = string.Empty; send = Resources.TicketEmission.Constants.COMMANDS_AST_A; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } sabreAnswer = sabreAnswer.Replace("‡", "\n"); string[] sabreAnswerInfo = sabreAnswer.Split(new char[] { '\n' }); if (sabreAnswerInfo[0].Length > 6) { locatorrecord = string.Empty; } else { locatorrecord = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref locatorrecord, 1, 1, 6); } //locatorrecord = "hola";//solo para pruebas sin cerrar record if (string.IsNullOrEmpty(locatorrecord)) { MessageBox.Show(Resources.TicketEmission.Tickets.RECORD_NO_CERRADO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } //pccbussinesunit = string.Empty; //CommandsQik.CopyResponse(sabreAnswer, ref pccbussinesunit, 2, 1, 4); //send = string.Empty; //sabreAnswer = string.Empty; //send = Resources.TicketEmission.Constants.COMMANDS_AST_PDK; //using (CommandsAPI objCommand = new CommandsAPI()) //{ // sabreAnswer = objCommand.SendReceive(send); //} //col = 0; //row = 0; //CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.CUSTOMER_NUMBER, ref row, ref col, 1, 2, 1, 64); //if (row != 0 || col != 0) //{ // dk = string.Empty; // CommandsQik.CopyResponse(sabreAnswer, ref dk, row, 19, 6); //} ////CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_LOCATION_VALIDATION); //CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_QUALITY_CONTROL_VALIDATION); dk = ucEndReservation.dK; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = null; MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute1 = null; MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1 Attribute1 = null; if (!string.IsNullOrEmpty(dk)) { try { try { integraAttribute = wsServ.GetAttribute(dk, Login.OrgId); } catch { integraAttribute = wsServ.GetAttribute(dk, Login.OrgId); } } catch { IsValid = LocationValidationBackup(); } } if (integraAttribute != null) { if (!string.IsNullOrEmpty(integraAttribute.Attribute1.ToString()) && (integraAttribute.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_NO_EXISTE_LOCATION))) { MessageBox.Show(Resources.TicketEmission.Tickets.NO_LOCATION_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (!string.IsNullOrEmpty(integraAttribute.Attribute1.ToString()) && integraAttribute.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_INACTIVE)) { MessageBox.Show(Resources.TicketEmission.Tickets.NUM_CLIENTE_O_LOCATION_INACTIVO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { Attribute1 = wsServ.SetQCGetAttribute(integraAttribute.Location, integraAttribute.Status, integraAttribute.Status_Site); //Attribute1 = SetQCByAttribute1BL.GetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); attribute1 = Attribute1.Attribute1.ToString(); activeStepsCorporativeQC.CorporativeQualityControls = null; activeStepsCorporativeQC.loadQualityControlsList(); CorporativeQualityControls = activeStepsCorporativeQC.CorporativeQualityControls; } } else if (integraAttribute1 != null) { if (!string.IsNullOrEmpty(integraAttribute1.Attribute1.ToString()) && (integraAttribute1.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_NO_EXISTE_LOCATION))) { MessageBox.Show(Resources.TicketEmission.Tickets.NO_LOCATION_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (!string.IsNullOrEmpty(integraAttribute1.Attribute1.ToString()) && integraAttribute1.Attribute1.Contains(Resources.TicketEmission.Constants.MESSAGE_INACTIVE)) { MessageBox.Show(Resources.TicketEmission.Tickets.NUM_CLIENTE_O_LOCATION_INACTIVO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { attribute1 = wsServ.SetQCGetAttribute(integraAttribute1.Location, integraAttribute1.Status, integraAttribute1.Status_Site).ToString(); //Attribute1 = SetQCByAttribute1BL.GetAttribute(integraAttribute1.Attribute1, integraAttribute1.Status, integraAttribute1.Status_Site); attribute1 = Attribute1.Attribute1.ToString(); activeStepsCorporativeQC.CorporativeQualityControls = null; activeStepsCorporativeQC.loadQualityControlsList(); CorporativeQualityControls = activeStepsCorporativeQC.CorporativeQualityControls; } } else { IsValid = LocationValidationBackup(); } return(IsValid); }
/// <summary> /// Validaciones y envio de comandos /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAccept_Click(object sender, EventArgs e) { #region ====== Validation of predictive ==== CommandsAPI2.send_MessageToEmulator(string.Concat(Resources.Reservations.ESPERE_FAVOR_VALIDANDO_DK_INTEGRA)); statusNoExistDK = false; statusInactive = false; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = null; MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute1 = null; //OracleConnection OracleConnection = new OracleConnection(); //MyCTS.Services.MyCTSOracleConnection.GetAttribute1 integraAttribute = null; //MyCTS.Services.MyCTSOracleConnectionDev.GetAttribute1 integraAttribute1 = null; try { try { integraAttribute = wsServ.GetAttribute(txtDK.Text, Login.OrgId); //integraAttribute = OracleConnection.GetAttribute1(txtDK.Text, Login.OrgId); } catch { integraAttribute = wsServ.GetAttribute(txtDK.Text, Login.OrgId); //integraAttribute1 = OracleConnection.GetAttribute1Dev(txtDK.Text, Login.OrgId); } } catch { MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 AttributeBackup = wsServ.GetAttribute(txtDK.Text, Login.OrgId); //GetAndSetAttributeBackup AttributeBackup = GetAndSetAttributeBackupBL.GetAttribute(txtDK.Text, Login.OrgId); if (AttributeBackup != null) { if (!string.IsNullOrEmpty(AttributeBackup.Attribute1.ToString()) && (AttributeBackup.Attribute1.Contains(Resources.Reservations.MESSAGE_NO))) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(AttributeBackup.Attribute1.ToString()) && AttributeBackup.Attribute1.Contains(Resources.Reservations.MESSAGE_INACTIVO)) { statusInactive = true; } } } if (integraAttribute != null) { if (!string.IsNullOrEmpty(integraAttribute.Attribute1) && (integraAttribute.Attribute1.Contains(Resources.Reservations.MESSAGE_NO))) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(integraAttribute.Attribute1) && integraAttribute.Attribute1.Contains(Resources.Reservations.MESSAGE_INACTIVO)) { statusInactive = true; } else { MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1 tempAttribute = new MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1(); tempAttribute = wsServ.SetQCGetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); Attribute1 = tempAttribute.Attribute1; //SetQCByAttribute1 tempAttribute = new SetQCByAttribute1(); //tempAttribute = SetQCByAttribute1BL.GetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); //Attribute1 = tempAttribute.Attribute1; } } else if (integraAttribute1 != null) { if (!string.IsNullOrEmpty(integraAttribute1.Attribute1) && (integraAttribute1.Attribute1.Contains(Resources.Reservations.MESSAGE_NO))) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(integraAttribute1.Attribute1) && integraAttribute1.Attribute1.Contains(Resources.Reservations.MESSAGE_INACTIVO)) { statusInactive = true; } else { MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1 tempAttribute = new MyCTS.Services.ValidateDKsAndCreditCards.SetQCByAttribute1(); tempAttribute = wsServ.SetQCGetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); Attribute1 = tempAttribute.Attribute1; //SetQCByAttribute1 tempAttribute = new SetQCByAttribute1(); //tempAttribute = SetQCByAttribute1BL.GetAttribute(integraAttribute1.Attribute1, integraAttribute1.Status, integraAttribute1.Status_Site); //Attribute1 = tempAttribute.Attribute1; } } else { MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 AttributeBackup = wsServ.GetAttribute(txtDK.Text, Login.OrgId); //GetAndSetAttributeBackup AttributeBackup = GetAndSetAttributeBackupBL.GetAttribute(txtDK.Text, Login.OrgId); if (AttributeBackup != null) { if (!string.IsNullOrEmpty(AttributeBackup.Attribute1.ToString()) && (AttributeBackup.Attribute1.Contains(Resources.Reservations.MESSAGE_NO))) { statusNoExistDK = true; } else if (!string.IsNullOrEmpty(AttributeBackup.Attribute1.ToString()) && AttributeBackup.Attribute1.Contains(Resources.Reservations.MESSAGE_INACTIVO)) { statusInactive = true; } } } List <CatAirlines> airList = CatAirlinesBL.GetAirlines(txtAirline.Text); if (airList.Count.Equals(0)) { statusValidateAir = true; } else { statusValidateAir = false; } List <AirPortCityCountry> airPortList = AirPortCityCountryBL.GetAirPortCityCountry(txtOriginCity.Text); if (airPortList.Count.Equals(0)) { statusValidateAirPort = true; } else { statusValidateAirPort = false; } #endregion if (IsValidateBusinessRules) { CommandsSend(); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } }
/// <summary> /// Valiada que el corporativo sea valido /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCorp_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtAttribute1.Text)) { MessageBox.Show("DEBE INGRESAR EL CORPORATIVO AL QUE SE LE APLICARA LA REGLA DE CARGO POR SERVICIO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtAttribute1.Focus(); } else { //string[] locationDK = null; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetOnlyAttribute1[] locationDK = null; try { locationDK = wsServ.GetLocationByAttribute1(txtAttribute1.Text); } catch { CommandsAPI2.send_MessageToEmulator("VALIDANDO CORPORATIVO, FAVOR DE ESPERAR........"); listAttribute1 = new List <MyCTS.Entities.GetOnlyAttribute1>(); listAttribute1 = GetOnlyAttribute1BL.GetAttribute1(txtAttribute1.Text); } if ((locationDK != null && locationDK.Length > 0) || (listAttribute1 != null && listAttribute1.Count > 0)) { if (listAttribute1 == null || listAttribute1.Count.Equals(0)) { listAttribute1 = new List <MyCTS.Entities.GetOnlyAttribute1>(); for (int i = 0; i < locationDK.Length; i++) { MyCTS.Entities.GetOnlyAttribute1 objAttribute1 = new MyCTS.Entities.GetOnlyAttribute1(); objAttribute1.LocationDK = locationDK[i].LocationDK; listAttribute1.Add(objAttribute1); } } listInfoFeeRule = GetInfoFeeRuleByAttribute1BL.GetInfoFeeRule(txtAttribute1.Text, 0, Login.OrgId); if (listInfoFeeRule.Count > 0) { //mostrar info de lo que contenga la lista string info = string.Empty; info = string.Concat("El corporativo ", txtAttribute1.Text, " cuenta con las siguientes reglas:"); for (int i = 0; i < listInfoFeeRule.Count; i++) { info = string.Concat(info, "\n"); info = string.Concat(info, "\n", "Regla: ", listInfoFeeRule[i].RuleNumber); info = string.Concat(info, "\n", "Nombre: ", listInfoFeeRule[i].Description); info = string.Concat(info, "\n", "Prioridad: ", listInfoFeeRule[i].Priority); info = string.Concat(info, "\n", "% De Tarifa Base: ", listInfoFeeRule[i].DefaultFee); info = string.Concat(info, "\n", "Cantidad Fija: ", listInfoFeeRule[i].DefaultMount.ToString("0.00")); info = string.Concat(info, "\n", "Monto: ", (listInfoFeeRule[i].Mandatory) ? "No Negociable" : "Negociable"); info = string.Concat(info, "\n", "Status: ", (listInfoFeeRule[i].ActivationSatate == true) ? "Activa" : "Inactiva"); if (listInfoFeeRule[i].StartDate != Types.DateNullValue) { info = string.Concat(info, "\n", "Inicio de regla: ", Convert.ToString(listInfoFeeRule[i].StartDate).Substring(0, 10)); } if (listInfoFeeRule[i].ExpirationDate != Types.DateNullValue) { info = string.Concat(info, "\n", "Fin de regla: ", Convert.ToString(listInfoFeeRule[i].ExpirationDate).Substring(0, 10)); } } infoattribute1 = info; string[] infoList = info.Split(new char[] { '\n' }); if (possition == true) { foreach (Control txt in this.Controls) { if (!(txt.TabIndex.Equals(0) || txt.TabIndex.Equals(1) || txt.Name == "btnCorp" || txt.Name == "txtInfoRuleByAttribute1")) { txt.Location = new Point(txt.Location.X, txt.Location.Y + 100); } } } possition = false; txtInfoRuleByAttribute1.Lines = infoList; ShowContols(true); txtDescription.Focus(); } else { if (possition == false) { foreach (Control txt in this.Controls) { if (!(txt.TabIndex.Equals(0) || txt.TabIndex.Equals(1) || txt.Name == "btnCorp" || txt.Name == "txtInfoRuleByAttribute1")) { txt.Location = new Point(txt.Location.X, txt.Location.Y - 100); } } } possition = true; ShowContols(true); txtInfoRuleByAttribute1.Visible = false; txtDescription.Focus(); } } else { MessageBox.Show("EL CORPORATIVO NO EXISTE EN INTEGRA", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtAttribute1.Focus(); ShowContols(false); } } }
/// <summary> /// Carga informacion a la mascarilla por Location si falla el metodo principal /// </summary> private Boolean ExistLoadLocationInfoBackup() { string location = txtDK.Text; WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation starFirstInfoByLocation; starFirstInfoByLocation = wsServ.Get1stStarInfoByLocation(location); //MyCTS.Entities.Cat1stStarInfoByLocation starFirstInfoByLocation = Cat1stStarInfoByLocationBL.Get1stStarInfoByLocation(location); if (starFirstInfoByLocation != null) { if (!string.IsNullOrEmpty(starFirstInfoByLocation.CustomerName)) { string customer = starFirstInfoByLocation.CustomerName.ToString(); customer = customer.Replace("(", ""); customer = customer.Replace(")", ""); txtEnterpriseName.Text = customer; txtSocialReason.Text = customer; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.MainPhone) && !starFirstInfoByLocation.MainPhone.Equals("()")) { string phone = starFirstInfoByLocation.MainPhone.Trim(new char[] { '(', ')' }); phone = phone.TrimEnd(); phone = phone.TrimStart(); txtPhone.Text = phone; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address1)) { txtStreet.Text = starFirstInfoByLocation.Address1; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address2)) { starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.Replace("#", ""); starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.TrimStart(); txtNumberExt.Text = starFirstInfoByLocation.Address2; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address3)) { starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.Replace("#", ""); starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.TrimStart(); txtNumberInt.Text = starFirstInfoByLocation.Address3; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address4)) { txtColony.Text = starFirstInfoByLocation.Address4; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.Municipality)) { txtDelorMunicipality.Text = starFirstInfoByLocation.Municipality; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.PostalCode)) { txtPostalCode.Text = starFirstInfoByLocation.PostalCode; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.City)) { txtCity.Text = starFirstInfoByLocation.City; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.State)) { txtState.Text = starFirstInfoByLocation.State; } if (!string.IsNullOrEmpty(starFirstInfoByLocation.RFC)) { bool IsRFC = ValidateRegularExpression.ValidateRFCFormat(starFirstInfoByLocation.RFC); if (IsRFC) { if (starFirstInfoByLocation.RFC.Length.Equals(13)) { txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 4); txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(4, 6); txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(10, 3); } else if (starFirstInfoByLocation.RFC.Length.Equals(12)) { txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 3); txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(3, 6); txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(9, 3); } } } return(true); } else { MessageBox.Show("El DK ingresado no existe", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } }
/// <summary> /// Obtención de record localizador, >DK y carga de quality controls para /// Corporativo /// </summary> private bool GetLocatorRecord() { bool IsValid = true; send = string.Empty; sabreAnswer = string.Empty; send = Resources.TicketEmission.Constants.COMMANDS_AST_A; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } sabreAnswer = sabreAnswer.Replace("", "\n"); string[] sabreAnswerInfo = sabreAnswer.Split(new char[] { '\n' }); if (sabreAnswerInfo[0].Length > 6) { locatorrecord = string.Empty; } else { locatorrecord = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref locatorrecord, 1, 1, 6); } send = Resources.TicketEmission.Constants.AST + locatorrecord; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.WARNING, ref row, ref col, 2, 3, 1, 64); string[] sabreAnswerWar = sabreAnswer.Split('\n'); if (sabreAnswerWar[0] == Resources.TicketEmission.ValitationLabels.WARNING) { MessageBox.Show(Resources.TicketEmission.Tickets.WARNING___PNR_MODIFICATION_IN_PROGRESS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (sabreAnswerWar[0] == Resources.TicketEmission.ValitationLabels.PNR_IGNORED_AND_REDISPLAYED) { MessageBox.Show(Resources.TicketEmission.Tickets.WARNING___PNR_MODIFICATION_IN_PROGRESS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (sabreAnswerWar[0] == Resources.TicketEmission.ValitationLabels.SIMULTANEOUS_CHANGES) { MessageBox.Show(Resources.TicketEmission.Tickets.WARNING___PNR_MODIFICATION_IN_PROGRESS, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { //locatorrecord = "hola";//solo para pruebas sin cerrar record if (string.IsNullOrEmpty(locatorrecord)) { MessageBox.Show(Resources.TicketEmission.Tickets.RECORD_NO_CERRADO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } send = string.Empty; sabreAnswer = string.Empty; send = Resources.TicketEmission.Constants.COMMANDS_AST_PDK; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } col = 0; row = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.CUSTOMER_NUMBER, ref row, ref col, 1, 2, 1, 64); if (row != 0 || col != 0) { dk = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref dk, row, 19, 6); } CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_QUALITY_CONTROL_VALIDATION); WsMyCTS wsServ = new WsMyCTS(); MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute = null; MyCTS.Services.ValidateDKsAndCreditCards.GetAttribute1 integraAttribute1 = null; MyCTS.Entities.SetQCByAttribute1 Attribute1 = null; if (!string.IsNullOrEmpty(dk)) { try { try { integraAttribute = wsServ.GetAttribute(dk, Login.OrgId); } catch { integraAttribute = wsServ.GetAttribute(dk, Login.OrgId); } } catch { IsValid = LocationValidationBackup(); } } if (integraAttribute != null) { if (!string.IsNullOrEmpty(integraAttribute.Attribute1.ToString()) && (integraAttribute.Attribute1.Contains("NO EXISTE LOCATION"))) { MessageBox.Show(Resources.TicketEmission.Tickets.NO_LOCATION_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (!string.IsNullOrEmpty(integraAttribute.Attribute1.ToString()) && integraAttribute.Attribute1.Contains("INACTIVO")) { MessageBox.Show(Resources.TicketEmission.Tickets.NUM_CLIENTE_O_LOCATION_INACTIVO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { Attribute1 = SetQCByAttribute1BL.GetAttribute(integraAttribute.Attribute1, integraAttribute.Status, integraAttribute.Status_Site); attribute1 = Attribute1.Attribute1.ToString(); activeStepsCorporativeQC.CorporativeQualityControls = null; activeStepsCorporativeQC.loadQualityControlsList(); CorporativeQualityControls = activeStepsCorporativeQC.CorporativeQualityControls; } } else if (integraAttribute1 != null) { if (!string.IsNullOrEmpty(integraAttribute1.Attribute1.ToString()) && (integraAttribute.Attribute1.Contains("NO EXISTE LOCATION"))) { MessageBox.Show(Resources.TicketEmission.Tickets.NO_LOCATION_INTEGRA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else if (!string.IsNullOrEmpty(integraAttribute1.Attribute1.ToString()) && integraAttribute.Attribute1.Contains("INACTIVO")) { MessageBox.Show(Resources.TicketEmission.Tickets.NUM_CLIENTE_O_LOCATION_INACTIVO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); IsValid = false; } else { Attribute1 = SetQCByAttribute1BL.GetAttribute(integraAttribute1.Attribute1, integraAttribute1.Status, integraAttribute1.Status_Site); attribute1 = Attribute1.Attribute1.ToString(); activeStepsCorporativeQC.CorporativeQualityControls = null; activeStepsCorporativeQC.loadQualityControlsList(); CorporativeQualityControls = activeStepsCorporativeQC.CorporativeQualityControls; } } else { IsValid = LocationValidationBackup(); } } return(IsValid); }
/// <summary> /// Gets the credit cards. /// </summary> public static void GetCreditCards() { //va hacia el web services string[] fullNames; if (nameProfile.Contains("2")) { fullNames = NameProfile.Split('2'); fullNames = fullNames[0].Split('/'); } else { fullNames = NameProfile.Split('/'); } if (string.IsNullOrEmpty(ucFormPayment.secondLevel)) { ucFormPayment.secondLevel = NameProfile; } WsMyCTS wsServ = new WsMyCTS(); string[] templistCardsSecondLevel = null; templistCardsSecondLevel = wsServ.GetCreditCardsSecondLevel(fullNames[1], fullNames[0], DK); var listCardsFirstLevel = wsServ.GetCreditCardsFirstLevel(DK); string cc = string.Empty; var listCardsSecondLevel = templistCardsSecondLevel; var listCardsSecondLevelTemp = new List <string>(); var listCardsFirstLevelTemp = new List <string>(); foreach (string creditCard in listCardsSecondLevel) { //string[] items = creditCard.Split(new string[] { "*#*" }, System.StringSplitOptions.RemoveEmptyEntries); string[] items = creditCard.Split(new string[] { "*#*" }, System.StringSplitOptions.None); if (items.Length > 0) { if (!string.IsNullOrEmpty(items[0])) { cc = string.Concat(items[0], "-", items[1], " ", items[2], "/", items[3], "^", items.Length > 14 ? items[14] : "HTLsqvtsOdE=", "^", (items.Length > 4) ? items[4] : string.Empty); //cc = string.Concat(items[0], "-", items[1], " ", items[2], "/", items[3]);// " ", items[14], "-" + items[4]); //if (items.Length > 4) listCardsSecondLevelTemp.Add(cc); items = null; } } } foreach (string creditCard in listCardsFirstLevel.Where(s => (!String.IsNullOrEmpty(s))).ToArray()) { string[] items = creditCard.Split(new string[] { "*#*" }, System.StringSplitOptions.None); if (!items[0].Equals("*") && !string.IsNullOrEmpty(items[0].ToString())) { var typeOfServ = (items.Length == 4) ? items[3].Split('*') : null; cc = items[0].Replace('*', '-'); if (typeOfServ != null) { listCardsFirstLevelTemp.Add(string.Concat(cc, " ", items[1], "^", items[2] + " " + ((typeOfServ.Length == 4) ? ((typeOfServ[0] == "Y") ? "AIR" : "") + "^" + ((typeOfServ[1] == "Y") ? "CAR" : "") + "^" + ((typeOfServ[0] == "Y") ? "HTL" : "") + "^" + typeOfServ[3] : " "))); } else { listCardsFirstLevelTemp.Add(string.Concat(cc, " ", items[1], "^", items[2])); } } } CreditCardsFirstLevel = listCardsFirstLevelTemp; CreditCardsSecondLevel = listCardsSecondLevelTemp; }