private void InitialValidations() { try { if (this.Parameters != null) { if (this.Parameters.Length.Equals(1)) { lblTA.Text = this.Parameters[0]; BannerImageList.Clear(); lblStateConection.Text = "No Conectado"; lblStateConection.ForeColor = Color.Red; string sabreAnswer = string.Empty; string ta = string.Empty; string send = "‡J"; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } CommandsQik.CopyResponse(sabreAnswer, ref ta, 1, 21, 6); SetTABL.SetTa(Login.Firm, ta); } else if (this.Parameters.Length.Equals(3)) { lblTA.Text = this.Parameters[0]; lblBienvenido.Text = this.Parameters[1]; lblInformacion.Text = this.Parameters[2]; lblStateConection.Visible = false; } } else { if (string.IsNullOrEmpty(activeBanner)) { activeBanner = ParameterBL.GetParameterValue("ActiveBanner").Values; } if (Convert.ToBoolean(activeBanner)) { try { if (BannerImageList != null) { if (BannerImageList.Count.Equals(0)) { BannerImageList = GetBannerImageBL.GetBannerImageList("1"); } if (BannerImageList.Count > 0) { SetDinamicImages(); } } } catch { } } } } catch { } }
/// <summary> /// crea la rutina para eliminar los remarks contables de las diferentes respuestas /// de Mysabre /// </summary> public static void Remarks() { string ren = string.Empty; string ren1 = string.Empty; string five = Resources.TicketEmission.Constants.COMMANDS_FIVE; int lenght = 0; Sabre = string.Empty; string[] sabreAnswerInfo = sabreConcat.Split(new char[] { '\n' }); lenght = sabreAnswerInfo.Length; for (int i = lenght; i >= 2; i--) { CommandsQik.CopyResponse(sabreConcat, ref ren, i, 4, 2); if (ren == Resources.TicketEmission.Constants.COMMADNS_DOT_SLASH) { CommandsQik.CopyResponse(sabreConcat, ref ren1, i, 1, 3); ren1 = ren1.Trim(); Sabre = string.Concat(Sabre, five, ren1, Resources.TicketEmission.Constants.AT, "Σ"); } } if (!string.IsNullOrEmpty(Sabre)) { send = string.Empty; Sabre = Sabre.TrimEnd(new char[] { 'Σ' }); send = Sabre; using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } } }
private void RecuperarPNR() { if (String.IsNullOrEmpty(recLoc)) { using (CommandsAPI objCommand = new CommandsAPI()) { string recordLocalizador = string.Empty; string sabreAnswer = objCommand.SendReceive(ChargesPerService.PreguntasASabre.VERIFICAR_RESERVA); CommandsQik.CopyResponse(sabreAnswer, ref recordLocalizador, 1, 1, 6); recLoc = recordLocalizador; } } }
private void ucPlaceRecordQueue_Load(object sender, EventArgs e) { string sabreAnswer = String.Empty; string QueueBritish = ParameterBL.GetParameterValue("QueueBritish").Values; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(QueueBritish); CommandsQik.CopyResponse(sabreAnswer, ref ucFirstValidations.dk, 1, 19, 6); } Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); }
/// <summary> /// En esta funcion extrae el DK, primero se manda un comando /// despues se buscada una frase y si la encuentra copia el DK /// pero por el momento tampoco se usa /// </summary> private void DK() { send = Resources.TicketEmission.Constants.COMMANDS_AST_PDK; using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(send, 0, 0); } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.CUSTOMER_NUMBER, ref row, ref col, 1, 2, 1, 64); if (row != 0 || col != 0) { dk = string.Empty; CommandsQik.CopyResponse(result, ref dk, row, 19, 6); } }
private bool ValidaExistenciaPNRActivo() { bool ExistePNR = true; using (CommandsAPI objCommand = new CommandsAPI()) { string sabreAnswer = objCommand.SendReceive(ChargesPerService.PreguntasASabre.VERIFICAR_RESERVA); CommandsQik.CopyResponse(sabreAnswer, ref recLoc, 1, 1, 6); char[] separadores = { '\n' }; string[] respuesta = sabreAnswer.Split(separadores, StringSplitOptions.RemoveEmptyEntries); if (respuesta != null && respuesta.Length > 0 && respuesta[0] == "NO DATA") { ExistePNR = false; } } return(ExistePNR); }
private void GetLastDateToPurchase() { string sabreAnswer = string.Empty; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive("WPNCS", 0, 0); } int row = 0; int col = 0; CommandsQik.searchResponse(sabreAnswer, "LAST DAY TO PURCHASE", ref row, ref col); if (row > 0) { CommandsQik.CopyResponse(sabreAnswer, ref lastDateToPurcahse, row, 47, 5); } }
public static void err_accountinginformation(string result) { Answer = result; Status = false; int row = 0; int col = 0; CommandsQik.searchResponse(result, Resources.ErrorMessages.TOTAL, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.TOTAL, 14); total = string.Empty; CommandsQik.CopyResponse(result, ref total, 2, 47, 14); Status = true; row = 0; col = 0; return; } }
private void RecoverRemarksValues(string line) { foreach (ListItem remarkNum in ClientRemarkNumber) { if (customRemark.RmrkType != null) { string value = string.Empty; string temp = (!string.IsNullOrEmpty(customRemark.RmrkPaxIdentyfier)) ? customRemark.RmrkPaxIdentyfier : customRemark.RmrkValueIdentyfier; string remark = string.Concat(".", customRemark.RmrkInitialLabel, customRemark.RmrkIdentyfier, remarkNum.Value, temp); int row = 0; int col = 0; CommandsQik.searchResponse(line, remark, ref row, ref col, 1, 1, 1, 20); if (row > 0) { CommandsQik.CopyResponse(line, ref value, 1, 1, line.Length); string remarkValue = string.Empty; if (!string.IsNullOrEmpty(customRemark.RmrkValueIdentyfier)) { remark = value.Replace(customRemark.RmrkValueIdentyfier, "|"); string[] values = remark.Split(new char[] { '|' }); if (values.Length > 2) { for (int i = 1; i < values.Length; i++) { remarkNum.Text3 = string.Concat(remarkNum.Text3, values[i]); } } else if (values.Length == 2) { remarkNum.Text3 = values[1]; } } } } } }
/// <summary> /// Calcula el número de pasajeros en el record /// </summary> private void passengerNumbers() { string passenger = string.Empty; string infant = string.Empty; int row = 0; int col = 0; bool findPaxNumber = false; sabreconcat = sabreconcat.Replace("‡", "\n"); string[] answerBlock = sabreconcat.Split(new char[] { '?' }); foreach (string sabreResult in answerBlock) { if (!string.IsNullOrEmpty(sabreResult)) { if (!findPaxNumber) { CommandsQik.searchResponse(sabreResult, Resources.TicketEmission.ValitationLabels.NBR_IN_PARTY, ref row, ref col); if (row != 0 || col != 0) { findPaxNumber = true; CommandsQik.CopyResponse(sabreResult, ref passenger, row, 15, 20); passenger = passenger.Trim(); } } row = 0; col = 0; CommandsQik.searchResponse(sabreResult, Resources.TicketEmission.ValitationLabels.PLUS_INFANTS, ref row, ref col); if (row != 0 || col != 0) { CommandsQik.CopyResponse(sabreResult, ref infant, row, 15, 20); infant = infant.Trim(); break; } else { infant = Resources.TicketEmission.Constants.COMMANDS_ZERO; } } } pax = Convert.ToInt32(infant) + Convert.ToInt32(passenger); }
public static string GetRecordLocalizer() { valueReceived = string.Empty; p6 = false; using (CommandsAPI objCommand = new CommandsAPI()) { if (ucEndReservation.EndReservation) { result = objCommand.SendReceive(Resources.Constants.COMMANDS_AST_P6); } else { result = objCommand.SendReceive(Resources.Constants.COMMANDS_AST_P6, 0, 0); } } APIResponseP6(); if (p6) { CommandsQik.CopyResponse(result, ref valueReceived, 2, 27, 7); valueReceived = valueReceived.Trim(); if (string.IsNullOrEmpty(valueReceived)) { CommandsQik.CopyResponse(result, ref valueReceived, 3, 27, 7); valueReceived = valueReceived.Trim(); } } if (!string.IsNullOrEmpty(valueReceived) && ValidateRegularExpression.ValidatePNR(valueReceived) && valueReceived.Length == 6) { PNR = valueReceived; } else { PNR = string.Empty; } return(PNR); }
/// <summary> /// Valida la existencia de fases IV en el record y despliega la lista de estas al usuario /// </summary> private void FullPhaseIVList() { int row = 0; int col = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.TKT_LIST, ref row, ref col); if (row != 0 || col != 0) { string[] sabreAnswerLines = sabreAnswer.Split(new char[] { '\n' }); for (int i = 1; i < sabreAnswerLines.Length; i++) { string number = string.Empty; string maskInfo = string.Empty; if (!string.IsNullOrEmpty(sabreAnswerLines[i])) { CommandsQik.CopyResponse(sabreAnswerLines[i], ref maskInfo, 1, 4, 20); CommandsQik.CopyResponse(sabreAnswerLines[i], ref number, 1, 1, 2); number = number.Trim(); dgvSelectMask.Rows.Add(number, maskInfo); } } dgvSelectMask.Focus(); } else { masknumber = string.Empty; if (ucMenuReservations.phaseIV) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_PHASEIV_CALCULATION_LINE); } else { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_PHASEIV_CALCULATION_LINE_RWD); } } }
/// <summary> /// Esta funcion se encarga de buscar y copiar el número de boleto que va a ser /// cancelado /// </summary> private void CopyTKTVoid() { int lenght = 0; string[] sabreAnswerInfo = sabreConcat.Split(new char[] { '\n' }); lenght = sabreAnswerInfo.Length - 1; for (int i = lenght; i >= 1; i--) { CommandsQik.searchResponse(sabreAnswerInfo[i], txtNumberLine.Text, ref row, ref col, 1, 1, 1, 4); if (row != 0 || col != 0) { while (row != 0 || col != 0) { CommandsQik.CopyResponse(sabreAnswerInfo[i], ref tktvoid, row, 8, 13); col = 0; row = 0; tickets[++cont] = tktvoid; } break; } } }
private void toolStripButtonQueues_Click(object sender, EventArgs e) { string messageQueue = ParameterBL.GetParameterValue("MessageQueue").Values; string numQueue = Login.Queue; string sabreAnswer = string.Empty; string commandQueue = string.Format("QC/{0}", numQueue); using (CommandsAPI command = new CommandsAPI()) { sabreAnswer = command.SendReceive(commandQueue, 0, 0); } if (string.IsNullOrEmpty(sabreAnswer) | sabreAnswer.Equals("NOTHING")) { return; } int row = 0; int col = 0; string result = string.Empty; try { CommandsQik.searchResponse(sabreAnswer, "HAS", ref row, ref col, 2); col += 4; CommandsQik.CopyResponse(sabreAnswer, ref result, row, col, 9); int queues = 0; Int32.TryParse(result, out queues); if (queues > 0) { lblQueue.Text = string.Format(messageQueue, Login.Queue, queues); } } catch { } }
/// <summary> /// Verfifica los impuestos aplicables a la emision de boleto en curso, paso 6 /// </summary> private void Taxes_StepSix() { int row = 0; int col = 0; send = Resources.TicketEmission.Constants.COMMANDS_TXN_AST_MX; using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } //TaxCode1 CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.ONE, ref row, ref col); if (row != 0 || col != 0) { CommandsQik.CopyResponse(result, ref TaxCode1, row, 7, 2); txtTax1.Text = TaxCode1; row++; col = 0; //TaxCode2 CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.TWO, ref row, ref col); if (row != row - 1 || col != 0) { CommandsQik.CopyResponse(result, ref TaxCode2, row, 7, 2); txtTax2.Text = TaxCode2; row++; col = 0; //TaxCode3 CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.THREE, ref row, ref col); if (row != row - 1 || col != 0) { CommandsQik.CopyResponse(result, ref TaxCode3, row, 7, 2); txtTax3.Text = TaxCode3; row++; col = 0; //TaxCode4 CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.FOUR, ref row, ref col); if (row != row - 1 || col != 0) { CommandsQik.CopyResponse(result, ref TaxCode4, row, 7, 2); txtTax4.Text = TaxCode4; row++; col = 0; //TaxCode5 CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.FIVE, ref row, ref col); if (row != row - 1 || col != 0) { CommandsQik.CopyResponse(result, ref TaxCode5, row, 7, 2); txtTax5.Text = TaxCode5; row++; col = 0; //TaxCode6 CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.SIX, ref row, ref col); if (row != row - 1 || col != 0) { CommandsQik.CopyResponse(result, ref TaxCode6, row, 7, 2); txtTax6.Text = TaxCode6; } } } } } } }
/// <summary> /// Función que construye cada linea por PNR /// </summary> private void buildPNRLines() { string lineToWrite = string.Empty; string temp = string.Empty; string pnrBlock = string.Empty; int counter = 1; //redim(counter); counter++; pnrBlock = pnrBlockArray[0]; //Copia TICKET CommandsQik.CopyResponse(pnrBlock, ref temp, 1, 1, 11); lineToWrite = temp; temp = string.Empty; //copia COMMISSION AGENT CommandsQik.CopyResponse(pnrBlock, ref temp, 1, 18, 33); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //copia TICKET CommandsQik.CopyResponse(pnrBlock, ref temp, 1, 54, 6); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //copia NUMBER CommandsQik.CopyResponse(pnrBlock, ref temp, 2, 1, 18); lineToWrite = string.Concat(lineToWrite, " ", temp); temp = string.Empty; //copia AMOUNT CommandsQik.CopyResponse(pnrBlock, ref temp, 2, 20, 9); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //copia SINE CommandsQik.CopyResponse(pnrBlock, ref temp, 2, 32, 5); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //copia TIME CommandsQik.CopyResponse(pnrBlock, ref temp, 2, 37, 10); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //copia CURR CommandsQik.CopyResponse(pnrBlock, ref temp, 2, 47, 7); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //copia AMOUNT CommandsQik.CopyResponse(pnrBlock, ref temp, 2, 54, 8); lineToWrite = string.Concat(lineToWrite, temp); temp = string.Empty; //pnrlinesToWrite = lineToWrite; for (int i = 0; i < pnrBlockArray.Count; i++) { string[] linesToConCat = pnrBlockArray[i].Split(new char[] { '\n' }); if (linesToConCat.Length < 3) { if (i == pnrBlockArray.Count - 1) { if (!string.IsNullOrEmpty(pnrlinesToWrite)) { if (linesToConCat.Length > 1) { pnrlinesToWrite = string.Concat(pnrlinesToWrite, "\n", linesToConCat[0], "\n", linesToConCat[1]); } } else { if (linesToConCat.Length > 1) { pnrlinesToWrite = string.Concat(pnrlinesToWrite, "\n", linesToConCat[0], "\n", linesToConCat[1]); } } } else if (string.IsNullOrEmpty(pnrlinesToWrite)) { pnrlinesToWrite = string.Concat(linesToConCat[0].Remove(47, 16), linesToConCat[1]); } else if (!linesToConCat[0].Contains(" ")) { pnrlinesToWrite = string.Concat(pnrlinesToWrite, "\n", linesToConCat[0].Remove(47, 16), linesToConCat[1]); } else { pnrlinesToWrite = string.Concat(pnrlinesToWrite, "\n", linesToConCat[0]); } } else { pnrlinesToWrite = string.Concat(pnrlinesToWrite, "\n", linesToConCat[0].Remove(47, 16), linesToConCat[1]); } } }
public static void err_definepassengertype(string result) { Answer = result; Status = false; Name2 = false; Name3 = false; Name4 = false; Name5 = false; Name6 = false; Name7 = false; Name8 = false; Name9 = false; int row = 0; int col = 0; CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_ONE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.NO_LEVEL_ONE, 5); Status = true; namesend1 = string.Empty; CommandsQik.CopyResponse(result, ref namesend1, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_TWO, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_TWO, 5); Name2 = true; namesend2 = string.Empty; CommandsQik.CopyResponse(result, ref namesend2, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_THREE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_THREE, 5); Name3 = true; namesend3 = string.Empty; CommandsQik.CopyResponse(result, ref namesend3, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_FOUR, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_FOUR, 5); Name4 = true; namesend4 = string.Empty; CommandsQik.CopyResponse(result, ref namesend4, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_FIVE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_FIVE, 5); Name5 = true; namesend5 = string.Empty; CommandsQik.CopyResponse(result, ref namesend5, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_SIX, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_SIX, 5); Name6 = true; namesend6 = string.Empty; CommandsQik.CopyResponse(result, ref namesend6, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_SEVEN, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_SEVEN, 5); Name7 = true; namesend7 = string.Empty; CommandsQik.CopyResponse(result, ref namesend7, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_EIGHT, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_EIGHT, 5); Name8 = true; namesend8 = string.Empty; CommandsQik.CopyResponse(result, ref namesend8, row, 1, 100); row = 0; col = 0; } CommandsQik.searchResponse(result, Resources.ErrorMessages.POSITION_NINE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.POSITION_NINE, 5); Name9 = true; namesend9 = string.Empty; CommandsQik.CopyResponse(result, ref namesend9, row, 1, 100); row = 0; col = 0; } }
/// <summary> /// Generación de código de autorización a remark contable /// </summary> private void GeneratingAccountableRemark() { string active = activeStepsCorporativeQC.CorporativeQualityControls[0].RemarkContableAuthorization; if (active.Equals(Resources.TicketEmission.Constants.ACTIVE)) { string send = string.Empty; string sabreAnswer = string.Empty; string tempChar = string.Empty; int row = 0; int col = 0; send = Resources.TicketEmission.Constants.COMMANDS_AST_P5; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.DOT_W, ref row, ref col, 1, 18, 4, 7); if (row != 0 || col != 0) { tempChar = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref tempChar, row, 5, 10); } else { using (CommandsAPI objCommand = new CommandsAPI()) { send = Resources.TicketEmission.Constants.COMMANDS_MD; sabreAnswer = objCommand.SendReceive(send); } row = 0; col = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.NOTHING_TO_SCROLL, ref row, ref col); if (row != 0 || col != 0) { } else { CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.DOT_W, ref row, ref col, 1, 18, 4, 5); if (row != 0 || col != 0) { tempChar = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref tempChar, row, 5, 10); } } } if (!string.IsNullOrEmpty(tempChar)) { tempChar.Trim(); send = string.Concat(Resources.TicketEmission.Constants.COMMANDS_5_DOT, tempChar); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } } //UC = "billigAddress";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UCBILLINGADRESS); } else { //UC = "billigAddress";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UCBILLINGADRESS); } }
/// <summary> /// Se manda un commando y se busca la Base fare y si se encontro /// se empiza a copiar los datos necesarios para armar el comando /// de la tárifa más económica disponible /// </summary> private void Validation_wpnc() { string remarkcmefa = activeStepsCorporativeQC.CorporativeQualityControls[0].RemarkCMEFA; string remarkcmefna = activeStepsCorporativeQC.CorporativeQualityControls[0].RemarkCMEFNA; string result = string.Empty; string sabre = remarkcmefna; string contactSabrecs = string.Empty; string contactSabrec = string.Empty; Answer = result; BaseFare = false; int row = 0; int col = 0; string send = string.Empty; send = Resources.TicketEmission.Constants.COMMANDS_WPNC; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col); if (row != 0 || col != 0) { BaseFare = true; row = 0; col = 0; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.TOTAL, ref row, ref col, 1, 4, 30, 64); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNC_CI, row, 47, 14); temp_WPNC_CI = temp_WPNC_CI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPNC_CI = temp_WPNC_CI.Trim(); rate_ConImp_Low_D = temp_WPNC_CI; col = 0; row = 0; } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.EQUIV_AMT, ref row, ref col); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNC_SI, row, 19, 14); temp_WPNC_SI = temp_WPNC_SI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPNC_SI = temp_WPNC_SI.Trim(); rate_SinImp_Low_D = temp_WPNC_SI; col = 0; row = 0; BaseFare = false; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col, 1, 4, 1, 20); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNC_SI, row, 5, 14); temp_WPNC_SI = temp_WPNC_SI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPNC_SI = temp_WPNC_SI.Trim(); rate_SinImp_Low_D = temp_WPNC_SI; col = 0; row = 0; } } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.ADT, ref row, ref col, 5, 7, 1, 4); if (row != 0 || col != 0) { CommandsQik.CopyResponse(result, ref book_fare_Low_D, row, 9, 30); col = 0; row = 0; } } else { string hourscad; string hour; string day; string month; DateTime time = DateTime.Now; hour = time.ToString("hh:mm"); hourscad = Convert.ToString(hour); hour = Regex.Replace(hourscad, @"[^\w\.@¥-]", ""); day = time.ToString("dd"); month = time.ToString("MMM", new System.Globalization.CultureInfo("en-US")).ToUpper(); send = Resources.TicketEmission.Constants.COMMANDS_5H_NO_DETERMINO_TARIFA_MAS_BAJA_DISPONIBLE_WPNC_AST + hour + Resources.TicketEmission.Constants.AST + day + month; rate_ConImp_Low_D = "0"; rate_SinImp_Low_D = "0"; using (CommandsAPI objCommands = new CommandsAPI()) { objCommands.SendReceive(send); } } if (!string.IsNullOrEmpty(rate_ConImp_Low_ND)) { //5.S*LF contactSabrecs = rate_ConImp_Low_ND + Resources.TicketEmission.Constants.INDENT + rate_SinImp_Low_ND + Resources.TicketEmission.Constants.INDENT + book_fare_Low_ND + Resources.TicketEmission.Constants.COMMANDS_TARIFA_MAS_ECONOMICA_NO_DISPONIBLE; } if (!string.IsNullOrEmpty(rate_ConImp_Low_D)) { //5.S*LC contactSabrec = remarkcmefa + rate_ConImp_Low_D + Resources.TicketEmission.Constants.INDENT + rate_SinImp_Low_D + Resources.TicketEmission.Constants.INDENT + book_fare_Low_D + Resources.TicketEmission.Constants.COMMANDS_TARIFA_MAS_ECONOMICA_DISPONIBLE; } #region ===== Se manejaba con ICAVV ====== //if ((!string.IsNullOrEmpty(contactSabrecs)) && (!string.IsNullOrEmpty(contactSabrec))) //{ // send = sabre + contactSabrecs + Resources.TicketEmission.Constants.END_ITEM + contactSabrec; // using (CommandsAPI objCommands = new CommandsAPI()) // { // objCommands.SendReceive(send); // } //} //if (string.IsNullOrEmpty(contactSabrecs) && (!string.IsNullOrEmpty(contactSabrec))) //{ // send = sabre + contactSabrec; // using (CommandsAPI objCommands = new CommandsAPI()) // { // objCommands.SendReceive(send); // } //} //if ((!string.IsNullOrEmpty(contactSabrecs)) && (string.IsNullOrEmpty(contactSabrec))) //{ // send = contactSabrecs; // using (CommandsAPI objCommands = new CommandsAPI()) // { // objCommands.SendReceive(send); // } //} #endregion }
/// <summary> /// Genera los remarks de clases disponibles para el itinerario /// </summary> private void RemarksClass() { string active = activeStepsCorporativeQC.CorporativeQualityControls[0].RemarksAvailableClasses; send = string.Empty; sabreAnswer = string.Empty; row = 0; col = 0; send = Resources.TicketEmission.Constants.COMMANDS_AST_IAB; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.ITINERARY, ref row, ref col); if (row != 0 || col != 0) { ItineraryStart = 1; sabreAnswerInfo = sabreAnswer.Split(new char[] { '\n' }); sabreAnswerLong = sabreAnswerInfo.LongLength; } if (ItineraryStart == 1 && active.Equals(Resources.TicketEmission.Constants.ACTIVE))//Start Itinerary { sabreAnswerLong = sabreAnswerLong - 1; readItinerary: row = row + 1; if (row <= sabreAnswerLong)//Verify Long { col = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.ARUNK, ref row, ref col, row, row); if (col > 0) { goto readItinerary; } else { try { remInfo = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref remInfo, row, 1, 100); try { remInfoID = remInfo.Substring(0, 2); } catch { remInfoID = remInfo.Substring(1, 2); } remInfoLenght = remInfo.Length - 2; remInfoContent = remInfo.Substring(2, remInfoLenght); TableSegments.Add(remInfoID, remInfoContent); goto readItinerary; } catch { goto readItinerary; } } }// end Very1 else { TableSegmentsRows = TableSegments.Count; copyRow = 0; copyClass: copyRow = copyRow + 1; if (copyRow <= TableSegmentsRows)//CopyStart { TableSegmentsRowNumber = TableSegments.GetKey(copyRow - 1); TableSegmentsRowContent = TableSegments.GetValues(copyRow - 1); String sTableSegmentsLineTemp = string.Format("{0}", TableSegmentsRowContent); TableSegmentsLine = string.Format("{0}", TableSegmentsRowContent); TableSegmentsLine.Trim(); TableSegmentsLine = TableSegmentsLine.Replace("¡ ", String.Empty); TableSegmentsLine = TableSegmentsLine.Replace("¡", String.Empty); flightAirline = TableSegmentsLine.Substring(1, 2); flightAirline.Trim(); flightNumber = TableSegmentsLine.Substring(3, 4); flightNumber.Trim(); bookingClass = TableSegmentsLine.Substring(7, 1); //Se cambia el 8 por el 7... bookingClass.Trim(); date = TableSegmentsLine.Substring(9, 5); date.Trim(); cpa = TableSegmentsLine.Substring(17, 7); cpa.Trim(); sabre = Resources.TicketEmission.Constants.ONE + flightAirline.Trim() + flightNumber.Trim() + Resources.TicketEmission.Constants.SLASH + date.Trim() + cpa.Trim(); send = string.Empty; sabreAnswer = string.Empty; row = 0; col = 0; send = sabre.Trim(); using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.Constants.CROSS_LORAINE, ref row, ref col); if (row == 0) { responseAvailability = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref responseAvailability, 1, 1, 70); sabre = string.Empty; responseAvailability = responseAvailability.Replace(".", "").Trim(); responseAvailability = responseAvailability.Trim(); sabre = Resources.TicketEmission.Constants.COMMANDS_S + TableSegmentsRowNumber.Trim() + " " + "CLASE VENDIDA - " + bookingClass; tableClassSold.Add(TableSegmentsRowNumber.Trim(), sabre); tableClassAvailable.Add(copyRow.ToString(), responseAvailability); contador = Convert.ToInt32(TableSegmentsRowNumber.Trim()); goto copyClass; } else { contador = contador + 1; sabre = string.Empty; sabre = Resources.TicketEmission.Constants.COMMANDS_S + contador + " " + "CLASE VENDIDA - " + bookingClass; tableClassSold.Add(TableSegmentsRowNumber.Trim(), sabre); tableClassAvailable.Add(copyRow.ToString(), Resources.TicketEmission.Constants.NO_HAY_DISPONIBILIDAD_SEGEMENTO); goto copyClass; } //else //{ // goto copyClass; //} } else { sabre = string.Empty; sabreConcaten = string.Empty; rowRemark = 0; buildRemarks: rowRemark = rowRemark + 1; sabreConcaten = sabreConcaten + sabre; if (rowRemark <= tableClassSold.Count) { sabre = string.Format("{0}", tableClassSold.GetValues(rowRemark - 1)); sabre = Resources.TicketEmission.Constants.COMMANDS_FIVE_CROSSLORAINE + sabre + Resources.TicketEmission.Constants.ENDIT + Resources.TicketEmission.Constants.COMMANDS_FIVE_CROSS_LORAINE_S + string.Format("{0}", tableClassSold.GetKey(rowRemark - 1)) + " " + string.Format("{0}", tableClassAvailable.GetValues(rowRemark - 1)); int lastEndit = sabre.IndexOf('Σ', 30); if ((sabre.Length - lastEndit) > 70) { sabre = sabre.Insert(lastEndit + 70, Resources.TicketEmission.Constants.ENDIT + Resources.TicketEmission.Constants.COMMANDS_FIVE_CROSS_LORAINE_S + tableClassSold.GetKey(rowRemark - 1) + " "); } if (rowRemark > 1) { sabre = Resources.TicketEmission.Constants.ENDIT + sabre; } goto buildRemarks; } else { send = string.Empty; sabreAnswer = string.Empty; row = 0; col = 0; send = sabreConcaten; if (!string.IsNullOrEmpty(send)) { using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } } //UC = "generatingAccountableRemark";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_GENERATING_ACCOUNTABLE_REMARK); } } } //end Very2 } //End Start Itinerary else { //UC = "generatingAccountableRemark";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_GENERATING_ACCOUNTABLE_REMARK); } }//End RemarksClass
/// <summary> /// Se extrae la etiqueta que va aser usada /// tambien extraemos los comparativos de la clase bussines /// Se manda un commando y se busca una etiqueta y se sique mandando el comando pero con /// los diferentes comparativos de clases bussines hasta encontrar esa etiqueta /// Cuando la encuentra se arma el commando /// </summary> private void Validation_wpoc_bussines() { string remarkcbnsf = activeStepsCorporativeQC.CorporativeQualityControls[0].RemarkCBnsF; string result = string.Empty; string sabre = remarkcbnsf; string temp_WPOCB_CI = string.Empty; string temp_WPOCB_SI = string.Empty; string book_fare_busi = string.Empty; Answer = result; BaseFare = false; int row = 0; int col = 0; int attemptsClass = 0; string send = string.Empty; string classComparativeBusiness1 = ucFirstValidations.CorporativeQualityControls[0].ClassComparativeBusiness1; string classComparativeBusiness2 = ucFirstValidations.CorporativeQualityControls[0].ClassComparativeBusiness2; string classComparativeBusiness3 = ucFirstValidations.CorporativeQualityControls[0].ClassComparativeBusiness3; string classComparativeBusiness4 = ucFirstValidations.CorporativeQualityControls[0].ClassComparativeBusiness4; while (attemptsClass < 5) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col); if (row != 0 || col != 0) { BaseFare = true; row = 0; col = 0; break; } attemptsClass += 1; if (!BaseFare && attemptsClass == 1) { send = Resources.TicketEmission.Constants.COMMANDS_WPOC_B + classComparativeBusiness1; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; } if (!BaseFare && attemptsClass == 2) { send = Resources.TicketEmission.Constants.COMMANDS_WPOC_B + classComparativeBusiness2; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; } else if (!BaseFare && attemptsClass == 3) { send = Resources.TicketEmission.Constants.COMMANDS_WPOC_B + classComparativeBusiness3; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; } else if (!BaseFare && attemptsClass == 4) { send = Resources.TicketEmission.Constants.COMMANDS_WPOC_B + classComparativeBusiness4; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; } } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.TOTAL, ref row, ref col, 1, 4, 30, 64); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPOCB_CI, row, 47, 14); temp_WPOCB_CI = temp_WPOCB_CI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPOCB_CI = temp_WPOCB_CI.Trim(); rate_ConImp_Busi = temp_WPOCB_CI; col = 0; row = 0; } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.EQUIV_AMT, ref row, ref col); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPOCB_SI, row, 19, 14); temp_WPOCB_SI = temp_WPOCB_SI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPOCB_SI = temp_WPOCB_SI.Trim(); rate_SinImp_Busi = temp_WPOCB_SI; col = 0; row = 0; BaseFare = false; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col, 1, 4, 1, 20); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPOCB_SI, row, 5, 14); temp_WPOCB_SI = temp_WPOCB_SI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPOCB_SI = temp_WPOCB_SI.Trim(); rate_SinImp_Busi = temp_WPOCB_SI; col = 0; row = 0; } } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.ADT, ref row, ref col, 5, 7, 1, 4); if (row != 0 || col != 0) { CommandsQik.CopyResponse(result, ref book_fare_busi, row, 9, 30); col = 0; row = 0; //sabre 5.S*FB send = sabre + rate_ConImp_Busi + Resources.TicketEmission.Constants.INDENT + rate_SinImp_Busi + Resources.TicketEmission.Constants.INDENT + book_fare_busi + Resources.TicketEmission.Constants.COMMANDS_TARIFA_BASE_BUSINESS; //using (CommandsAPI objCommands = new CommandsAPI()) //{ // objCommands.SendReceive(send); //} } } else if (!BaseFare && attemptsClass == 5) { string hourscad; string hour; string day; string month; DateTime time = DateTime.Now; hour = time.ToString("hh:mm"); hourscad = Convert.ToString(hour); hour = Regex.Replace(hourscad, @"[^\w\.@¥-]", ""); day = time.ToString("dd"); month = time.ToString("MMM", new System.Globalization.CultureInfo("en-US")).ToUpper(); send = Resources.TicketEmission.Constants.COMMANDS_5H_NO_DETERMINO_TARIFA_BUSINESS_AST + hour + Resources.TicketEmission.Constants.AST + day + month; rate_ConImp_Busi = "0"; rate_SinImp_Busi = "0"; using (CommandsAPI objCommands = new CommandsAPI()) { objCommands.SendReceive(send); } } }
/// <summary> /// Elimina los remarks contables dentro del record menos .S*MX /// </summary> private void RemoveRemarks() { string line = string.Empty; row = 0; col = 0; sabreAnswer = sabreAnswer.Replace(" ‡ ", " \n "); string[] sabreAnswerInfo = sabreAnswer.Split(new char[] { '\n' }); List <string> temp = new List <string>(); for (int i = 1; i < sabreAnswerInfo.Length; i++) { int lastItem = i + 1; if (!lastItem.Equals(sabreAnswerInfo.Length)) { if (!string.IsNullOrEmpty(sabreAnswerInfo[i]) && !sabreAnswerInfo[i].StartsWith(" ") && sabreAnswerInfo[i + 1].StartsWith(" ")) { if (sabreAnswerInfo[lastItem].StartsWith(" ")) { string clearSpaces = sabreAnswerInfo[lastItem].TrimStart(new char[] { ' ' }); string fullRemark = string.Concat(sabreAnswerInfo[i], clearSpaces); temp.Add(fullRemark); } } else { if (!string.IsNullOrEmpty(sabreAnswerInfo[i]) && !sabreAnswerInfo[i].StartsWith(" ")) { temp.Add(sabreAnswerInfo[i]); } } } else { if (!string.IsNullOrEmpty(sabreAnswerInfo[i]) && !sabreAnswerInfo[i].StartsWith(" ")) { temp.Add(sabreAnswerInfo[i]); } } } foreach (string lines in temp)//Inicio linea1 { CommandsQik.searchResponse(lines, ".</C30", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor C30Flag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".</C44", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor C44Flag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".S*MX", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor SMXFlag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".CC-", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor //Asignacion de valores CC- CCLine = string.Empty; CommandsQik.CopyResponse(lines, ref CCLine, 1, 1, lines.Length); CCLine = CCLine.Trim(); char[] sep = { '-' }; string[] arr = CCLine.Split(sep); //C3 = arr[1]; //C2 = arr[2]; //C1 = arr[3]; //C24 = arr[4]; CCLine = string.Empty; //Fin asignacion de valores CC- CCFlag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".CD-", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor //Asignacion de valores CD- CDLine = string.Empty; CommandsQik.CopyResponse(lines, ref CDLine, 1, 1, lines.Length); CDLine = CDLine.Trim(); char[] sep1 = { '-' }; string[] arr1 = CDLine.Split(sep1); //C9 = arr1[1]; //C31 = arr1[2]; //C4 = arr1[3]; //C32 = arr1[4]; CDLine = string.Empty; //Fin asignacion de valores CD- CDFlag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".CE-", ref row, ref col, 1, 1, 1, lines.Length); if (row > 0) { //Encontro valor //Asignacion de valores CE- CELine = string.Empty; CommandsQik.CopyResponse(lines, ref CELine, 1, 1, lines.Length); CELine = CELine.Trim(); char[] sep2 = { '-' }; string[] arr2 = CELine.Split(sep2); //C5 = arr2[1]; //C6 = arr2[2]; //C7 = arr2[3]; //C8 = arr2[4]; CELine = string.Empty; //Fin asignacion de valores CD- CEFlag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".CF-", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor //Asignacion de valores CF- CFLine = string.Empty; CommandsQik.CopyResponse(lines, ref CFLine, 1, 1, lines.Length); CFLine = CFLine.Trim(); char[] sep3 = { '-' }; string[] arr3 = CFLine.Split(sep3); //C33 = arr3[1]; //C34 = arr3[2]; //C35 = arr3[3]; //C36 = arr3[4]; CFLine = string.Empty; //Fin asignacion de valores CF- CFFlag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".CG-", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor //Asignacion de valores CG- CGLine = string.Empty; CommandsQik.CopyResponse(lines, ref CGLine, 1, 1, lines.Length); CGLine = CGLine.Trim(); char[] sep4 = { '-' }; string[] arr4 = CGLine.Split(sep4); //C37 = arr4[1]; //C38 = arr4[2]; //C39 = arr4[3]; //C40 = arr4[4]; CGLine = string.Empty; //Fin asignacion de valores CG- CGFlag = 1; row = 0; col = 0; } CommandsQik.searchResponse(lines, ".CH-", ref row, ref col, 1, 1, 1, 20); if (row > 0) { //Encontro valor //Asignacion de valores CH- CHLine = string.Empty; CommandsQik.CopyResponse(lines, ref CHLine, 1, 1, lines.Length); CHLine = CHLine.Trim(); char[] sep5 = { '-' }; string[] arr5 = CHLine.Split(sep5); //C41 = arr5[1]; //C42 = arr5[2]; //C45 = arr5[3]; //C46 = arr5[4]; CHLine = string.Empty; //Fin asignacion de valores CH- CHFlag = 1; row = 0; col = 0; } RecoverRemarksValues(lines); if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 1 && CDFlag == 0 && CEFlag == 0 && CFFlag == 0 && CGFlag == 0 && CHFlag == 0) { line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } else if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 0 && CDFlag == 1 && CEFlag == 0 && CFFlag == 0 && CGFlag == 0 && CHFlag == 0) { line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } else if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 0 && CDFlag == 0 && CEFlag == 1 && CFFlag == 0 && CGFlag == 0 && CHFlag == 0) { line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } else if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 0 && CDFlag == 0 && CEFlag == 0 && CFFlag == 1 && CGFlag == 0 && CHFlag == 0) { line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } else if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 0 && CDFlag == 0 && CEFlag == 0 && CFFlag == 0 && CGFlag == 1 && CHFlag == 0) { line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } else if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 0 && CDFlag == 0 && CEFlag == 0 && CFFlag == 0 && CGFlag == 0 && CHFlag == 1) { line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } else if (C30Flag == 0 && C44Flag == 0 && SMXFlag == 0 && CCFlag == 0 && CDFlag == 0 && CEFlag == 0 && CFFlag == 0 && CGFlag == 0 && CHFlag == 0) { CommandsQik.searchResponse(lines, "..", ref row, ref col, 1, 1, 1, 6); if (row > 0) { row = 0; col = 0; line = string.Empty; CommandsQik.CopyResponse(lines, ref line, 1, 1, 3); line = line.Trim(); remarkNumber.Add(line); row = 0; col = 0; } } C30Flag = 0; C44Flag = 0; SMXFlag = 0; CCFlag = 0; CDFlag = 0; CEFlag = 0; CFFlag = 0; CGFlag = 0; CHFlag = 0; CDFlag = 0; } }
/// <summary> /// Se manda un commando y se busca la Base fare y si se encontro /// se empiza a copiar los datos necesarios para armar el comando /// de la tárifa más baja no disponible /// </summary> private void Validation_wpncs() { Answer = result; BaseFare = false; int row = 0; int col = 0; send = Resources.TicketEmission.Constants.COMMANDS_WPNCS; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommands = new CommandsAPI()) { result = objCommands.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col); if (row != 0 || col != 0) { BaseFare = true; row = 0; col = 0; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.TOTAL, ref row, ref col, 1, 4, 30, 64); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNCS_CI, row, 47, 14); temp_WPNCS_CI = temp_WPNCS_CI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPNCS_CI = temp_WPNCS_CI.Trim(); rate_ConImp_Low_ND = temp_WPNCS_CI; col = 0; row = 0; } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.EQUIV_AMT, ref row, ref col); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNCS_SI, row, 19, 14); temp_WPNCS_SI = temp_WPNCS_SI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPNCS_SI = temp_WPNCS_SI.Trim(); rate_SinImp_Low_ND = temp_WPNCS_SI; col = 0; row = 0; BaseFare = false; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col, 1, 4, 1, 20); if (row != 0 || col != 0) { row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNCS_SI, row, 5, 14); temp_WPNCS_SI = temp_WPNCS_SI.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); temp_WPNCS_SI = temp_WPNCS_SI.Trim(); rate_SinImp_Low_ND = temp_WPNCS_SI; col = 0; row = 0; } } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.ADT, ref row, ref col, 5, 7, 1, 4); if (row != 0 || col != 0) { CommandsQik.CopyResponse(result, ref book_fare_Low_ND, row, 9, 30); col = 0; row = 0; } } else { string hourscad; string hour; string day; string month; DateTime time = DateTime.Now; hour = time.ToString("hh:mm"); hourscad = Convert.ToString(hour); hour = Regex.Replace(hourscad, @"[^\w\.@¥-]", ""); day = time.ToString("dd"); month = time.ToString("MMM", new System.Globalization.CultureInfo("en-US")).ToUpper(); send = Resources.TicketEmission.Constants.COMMANDS_5H_NO_DETERMINO_TARIFA_MAS_BAJA_NO_DISPONIBLE_WPNCS_AST + hour + Resources.TicketEmission.Constants.AST + day + month; rate_ConImp_Low_ND = "0"; rate_SinImp_Low_ND = "0"; using (CommandsAPI objCommands = new CommandsAPI()) { objCommands.SendReceive(send); } } }
private void ucHotelChargeService_Load(object sender, EventArgs e) { ChargesPerService.DKActual = string.Empty; CargaAnios(); CargarMeses(); LoadFormPaymentCodes(); string nameSecondLevel = string.Empty; string level1 = string.Empty; if (string.IsNullOrEmpty(ucFirstValidations.LocatorRecord)) { using (CommandsAPI objCommand = new CommandsAPI()) { string sabreAnswer = objCommand.SendReceive(ChargesPerService.PreguntasASabre.VERIFICAR_RESERVA); CommandsQik.CopyResponse(sabreAnswer, ref nameSecondLevel, 2, 5, 50); CommandsQik.CopyResponse(objCommand.SendReceive("*PDK"), ref level1, 1, 18, 50); CommandsQik.CopyResponse(sabreAnswer, ref recLoc, 1, 1, 6); char[] separadores = { '\n' }; string[] respuesta = sabreAnswer.Split(separadores, StringSplitOptions.RemoveEmptyEntries); } } //First Level List <Entities.InterJetProfileCreditCard> lstFirst = new InterJetProfileBL().GetProfileCreditCard(level1.Trim()); string[] name = nameSecondLevel.Split('2'); string fName = string.Empty; fName = name[0].Replace(" ", string.Empty); //Second Level Entities.InterJetProfile profile = new InterJetProfileBL().GetProfile(fName, level1.Trim()); if (profile != null) { profile.CreditCards = profile.CreditCards != null ? profile.CreditCards : new Entities.InterJetProfileCreditCards(); profile.CreditCards.Add(lstFirst); } else { profile = new Entities.InterJetProfile() { CreditCards = new Entities.InterJetProfileCreditCards() }; profile.CreditCards.Add(lstFirst); } if (profile.CreditCards.HasCards) { using (var form = new MyCTS.Presentation.Reservations.Availability.InterJet.frmInterJetProfileCreditCards()) { form.SetProfile(profile); form.StartPosition = FormStartPosition.CenterScreen; form.ShowDialog(); form.Activate(); form.Focus(); var card = form.Handler.SelectedCreditCardCard.FullProtectedCard; if (card.StartsWith("AX") || card.StartsWith("VI") || card.StartsWith("CA") || card.StartsWith("MC") || card.StartsWith("TP")) { cmbTypeCard.SelectedIndex = card.StartsWith("AX") ? cmbTypeCard.FindString("AX - TC AMEX") : card.StartsWith("VI") ? cmbTypeCard.FindString("VI - TC VISA") : (card.StartsWith("CA") || card.StartsWith("MC")) ? cmbTypeCard.FindString("CA - TC MASTERCARD") : card.StartsWith("TP") ? cmbTypeCard.FindString("TP") : 0; //Número de Tarjeta. txtNumberCardCTS.Text = form.Handler.SelectedCreditCardCard.CreditCardNumber; txtNumberCardCTS.PasswordChar = '·'; txtNumberCardCTS.Font = new Font("Symbol", 9F, FontStyle.Regular); //Fecha de Expiración. cmbMesVencimiento.SelectedIndex = DateTime.Parse(form.Handler.SelectedCreditCardCard.ExpirationDate.ToShortDateString()).Month - 1; cmbAnioVencimiento.SelectedIndex = cmbAnioVencimiento.FindStringExact(DateTime.Parse(form.Handler.SelectedCreditCardCard.ExpirationDate.ToShortDateString()).Year.ToString()); //CVV dato con mascara. txtDigitoSeguridad.Text = new string(Common.toDecrypt(form.Handler.SelectedCreditCardCard.CVV).Where(char.IsDigit).ToArray()); //Nombre del titular. txtNombreTarjetahabiente.Text = form.Handler.SelectedCreditCardCard.titular; //creditCard = true; } //SetSelectedCreditCardFromProfile(form.SelectedCreditCardCard); } } }
public static void validation_wpncs(string result) { Answer = result; BaseFare = false; int row = 0; int col = 0; string send = string.Empty; send = Resources.TicketEmission.Constants.COMMANDS_WPNCS; using (CommandsAPI objCommands = new CommandsAPI()) { objCommands.SendReceive(send); } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col); if (row != 0 || col != 0) { BaseFare = true; row = 0; col = 0; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.TOTAL, ref row, ref col, 1, 4, 30, 64); if (row != 0 || col != 0) { string temp_WPNCS_CI = string.Empty; string rate_ConImp_Low_ND = string.Empty; row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNCS_CI, row, 47, 14); rate_ConImp_Low_ND = (temp_WPNCS_CI.Substring(0, 4));//verificar que quite MXN col = 0; row = 0; } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.EQUIV_AMT, ref row, ref col, 1, 4, 30, 64); if (row != 0 || col != 0) { string temp_WPNCS_SI = string.Empty; string rate_SinImp_Low_ND = string.Empty; row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNCS_SI, row, 19, 14); rate_SinImp_Low_ND = (temp_WPNCS_SI.Substring(0, 4));//verificar que quite MXN col = 0; row = 0; BaseFare = false; } if (BaseFare) { CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col, 1, 4, 1, 20); if (row != 0 || col != 0) { string temp_WPNCS_SI = string.Empty; string rate_SinImp_Low_ND = string.Empty; row = row + 1; CommandsQik.CopyResponse(result, ref temp_WPNCS_SI, row, 5, 14); rate_SinImp_Low_ND = (temp_WPNCS_SI.Substring(0, 4));//verificar que quite MXN col = 0; row = 0; } } CommandsQik.searchResponse(result, Resources.TicketEmission.ValitationLabels.ADT, ref row, ref col, 5, 7, 1, 4); if (row != 0 || col != 0) { string book_fare_Low_ND = string.Empty; row = row + 1; CommandsQik.CopyResponse(result, ref book_fare_Low_ND, row, 9, 30); col = 0; row = 0; } } else { int hours; string hourscad; string hour; string day; string month; DateTime time = DateTime.Now; hours = time.Hour; hourscad = Convert.ToString(hours); hour = Regex.Replace(hourscad, @"[^\w\.@¥-]", ""); day = time.ToString("dd", new System.Globalization.CultureInfo("en-US")).ToUpper(); month = time.ToString("MMM", new System.Globalization.CultureInfo("en-US")).ToUpper(); send = Resources.TicketEmission.Constants.COMMANDS_5H_NO_DETERMINO_TARIFA_MAS_BAJA_NO_DISPONIBLE_WPNCS_AST + hours + Resources.TicketEmission.Constants.AST + day + Resources.TicketEmission.Constants.SLASH + month; using (CommandsAPI objCommands = new CommandsAPI()) { objCommands.SendReceive(send); } } }
public static void err_boletagedataandreceived(string result) { Answer = result; status = false; BoletageReceived = false; IA = false; int row = 0; int col = 0; CommandsQik.searchResponse(result, Resources.ErrorMessages.PAC_VEFIFY_CORRECT_NBR, ref row, ref col); if (row != 0 || col != 0) { BoletageReceived = true; row = 0; col = 0; return; } //********** BoletageDataAndReceived **************** // if (ucBoletageDateAndReceived.PQ) { CommandsQik.searchResponse(result, Resources.ErrorMessages.LAST_DAY_TO_PURCHASE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.LAST_DAY_TO_PURCHASE, 8); status = true; fecha = string.Empty; CommandsQik.CopyResponse(result, ref fecha, row, 22, 5); row = 0; col = 0; return; } } else if (ucBoletageDateAndReceived.WP) { CommandsQik.searchResponse(result, Resources.ErrorMessages.LAST_DAY_TO_PURCHASE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.LAST_DAY_TO_PURCHASE, 8); status = true; fecha = string.Empty; CommandsQik.CopyResponse(result, ref fecha, row, 47, 5); row = 0; col = 0; return; } } CommandsQik.searchResponse(result, Resources.ErrorMessages.NO_ITIN, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.NO_ITIN, 8); CustomUserMsg = userErrorMessage.CusErrMsgUserMsg; status = false; row = 0; col = 0; return; } CommandsQik.searchResponse(result, Resources.ErrorMessages.ONE, ref row, ref col); if (row != 0 || col != 0) { SabreErrorMsg userErrorMessage = SabreErrorMsgBL.GetSabreErrorMsg(Resources.ErrorMessages.ONE, 8); CustomUserMsg = userErrorMessage.CusErrMsgUserMsg; fecha = string.Empty; CommandsQik.CopyResponse(result, ref fecha, row, 12, 5); IA = true; row = 0; col = 0; return; } }
//Analiza el comando enviado, para crear la etiqueta de Quality Controls C80 private void EvaluateCommand() { string seg = string.Empty; string res = string.Empty; string itinerary = string.Empty; string bysegment = string.Empty; string commandSegment = string.Empty; string konnect = string.Empty; int lenght = 0; int resplenght = 0; int lenghtcommand = 0; int aux = 0; int row = 0; int col = 0; int row1 = 0; int col1 = 0; int i = 0; int j = 0; if (command.Contains("‡DPE")) { command = command.Replace("‡DPE", "‡DPB"); } else if (!command.Contains("‡DPB")) { command = string.Concat(command, "‡DPB"); } //Obtiene segmentos if (command.Contains("‡S")) { char[] charCommand = command.ToCharArray(); for (int x = 0; x <= charCommand.Length; x++) { int y = x + 1; if (charCommand[x] == '‡' & charCommand[x + 1] == 'S') { x++; while (x < charCommand.Length) { if (charCommand[x] != '‡') { segment = string.Concat(segment, charCommand[x]); x++; } else { break; } } break; } } } //Creación de la etiqueta C80 if (!string.IsNullOrEmpty(segment)) { segment = segment.Replace('-', '/'); bysegment = segment.Replace('S', ' ').Trim(); newlabel = string.Concat("5.</C80*"); seg = string.Concat("*IA"); using (CommandsAPI2 objCommand = new CommandsAPI2()) { res = objCommand.SendReceive(seg, 0, 0); } string[] segments1 = bysegment.Split(new char[] { '/' }); for (int a = 0; a < segments1.Length; a++) { col = 0; row = 0; CommandsQik.searchResponse(segments1[a], "-", ref row, ref col); if (col != 0 || row != 0) { int num1 = 0; int num2 = 0; string[] seg1 = segments1[a].Split(new char[] { '-' }); string replace = string.Empty; string bysegment2 = string.Empty; num1 = Convert.ToInt32(seg1[0]); num2 = Convert.ToInt32(seg1[1]); for (int f = num1; f <= num2; f++) { bysegment2 = string.Concat(bysegment2, f.ToString(), "/"); } bysegment2 = bysegment2.Remove(bysegment2.Length - 1, 1); replace = string.Concat(num1.ToString(), "-", num2.ToString()); bysegment = bysegment.Replace(replace, bysegment2); } } string[] segments = bysegment.Split(new char[] { '/' }); lenght = segments.Length - 1; string[] resp = res.Split(new char[] { '\n' }); resplenght = resp.Length; for (i = 0; i <= lenght; i++) { aux = 0; for (j = 1; j < resplenght; j++) { j = aux + 1; col = 0; row = 0; col1 = 0; row1 = 0; CommandsQik.searchResponse(resp[j], "ARNK", ref row, ref col); if (row == 0 || col == 0) { col = 0; row = 0; col1 = 0; row1 = 0; CommandsQik.searchResponse(resp[j], segments[i], ref row, ref col, 1, 3, 1, 3); if (row != 0 || col != 0) { CommandsQik.CopyResponse(resp[j], ref itinerary, row, 19, 8); itinerary = itinerary.Replace("*", "").Trim(); commandSegment = string.Concat(commandSegment, itinerary.Substring(0, 3), ".", itinerary.Substring(3, 3), "."); aux = j; break; } } aux = j; } } if (!string.IsNullOrEmpty(commandSegment)) { commandSegment = commandSegment.Remove(commandSegment.Length - 1); if (commandSegment.Length > 7) { string[] commands = commandSegment.Split(new char[] { '.' }); lenghtcommand = commands.Length - 1; for (int z = 0; z <= lenghtcommand - 1; z++) { if (commands[z] == commands[z + 1]) { commands[z] = string.Empty; } } commandSegment = string.Empty; for (int a = 0; a <= lenghtcommand; a++) { if (!string.IsNullOrEmpty(commands[a])) { commandSegment = string.Concat(commandSegment, commands[a].Trim(), "."); } } commandSegment = commandSegment.Remove(commandSegment.Length - 1); } newlabel = string.Concat(newlabel, commandSegment, "/>"); c80 = newlabel; } } }
/// <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> /// Valida la respuesta de mySabre cuando aparece la respuesta *PAC /// </summary> private void APIResponseDIN() { string result = string.Empty; string recordLocator = string.Empty; ERR_TicketsEmission.err_ticketsEmission(sabreAnswer); if (ERR_TicketsEmission.Status == false) { ERR_TicketsEmission.ok_ticketsEmission(sabreAnswer); if (ERR_TicketsEmission.StatusOk == true) { int row = 0; int col = 0; if (sabreAnswer.Contains(Resources.TicketEmission.ValitationLabels.ETR_MESSAGE_PROCESSED) || sabreAnswer.Contains(Resources.TicketEmission.ValitationLabels.ETR_EXCHANGE_PROCESSED)) { CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_ISSUE); } CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.INVOICED, ref row, ref col); if (row != 0 || col != 0) { int rowMessage = row - 2; recordLocator = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref recordLocator, rowMessage + 1, 9, 6); } Common.BeginManualCommandsTransactions(); try { //CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_ISSUE); AddRecordsContainerBL.AddRecordsContainer(recordLocator, Login.Agent, true); send = string.Empty; send = string.Concat(Resources.TicketEmission.Constants.AST, recordLocator); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } QueueAgent(); send = string.Empty; MyCTSAPI.SendReservationLog(Login.Firm, Login.PCC, recordLocator, 1); send = string.Concat(Resources.TicketEmission.Constants.AST, recordLocator); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } SendValidationTicketCommand(); } catch { } //Common.EndManualCommandsTransactions(); ExecEndCommandTransaction(); //System.Threading.Thread.Sleep(1000); ClearValues(); if (ucTicketEmissionBuildCommand.emiting) { SetCSCLog(); ucTicketEmissionBuildCommand.emiting = false; } } else { MessageBox.Show("OCURRIO UN ERROR AL IMPRIMIR FACTURA. VERIFIQUE RESPUESTAS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); if (ucTicketEmissionBuildCommand.emiting) { SetCSCLog(); ucTicketEmissionBuildCommand.emiting = false; } //UC = "sendTicketInvoice"; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_SEND_TICKET_INVOICE); } } else if (ERR_TicketsEmission.StatusSendCommand == true) { sabreAnswer = string.Empty; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } ERR_TicketsEmission.ok_ticketsEmission(sabreAnswer); if (ERR_TicketsEmission.StatusOk == true) { int row = 0; int col = 0; if (sabreAnswer.Contains(Resources.TicketEmission.ValitationLabels.ETR_MESSAGE_PROCESSED) || sabreAnswer.Contains(Resources.TicketEmission.ValitationLabels.ETR_EXCHANGE_PROCESSED)) { CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_ISSUE); } CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.INVOICED, ref row, ref col); if (row != 0 || col != 0) { int rowMessage = row - 2; recordLocator = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref recordLocator, rowMessage + 1, 9, 6); } Common.BeginManualCommandsTransactions(); try { //CommandsAPI2.send_MessageToEmulator(Resources.TicketEmission.Constants.MESSAGE_ISSUE); AddRecordsContainerBL.AddRecordsContainer(recordLocator, Login.Agent, true); send = string.Empty; send = string.Concat(Resources.TicketEmission.Constants.AST, recordLocator); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } QueueAgent(); send = string.Empty; MyCTSAPI.SendReservationLog(Login.Firm, Login.PCC, recordLocator, 1); send = string.Concat(Resources.TicketEmission.Constants.AST, recordLocator); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } SendValidationTicketCommand(); if (ucTicketEmissionBuildCommand.emiting) { SetCSCLog(); ucTicketEmissionBuildCommand.emiting = false; } } catch { } } //Common.EndManualCommandsTransactions(); ExecEndCommandTransaction(); //System.Threading.Thread.Sleep(1000); ClearValues(); } else { MessageBox.Show("OCURRIO UN ERROR AL IMPRIMIR FACTURA. VERIFIQUE RESPUESTAS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); if (ucTicketEmissionBuildCommand.emiting) { SetCSCLog(); ucTicketEmissionBuildCommand.emiting = false; } //UC = "sendTicketInvoice";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_SEND_TICKET_INVOICE); } }
/// <summary> /// >Obtención de la tarifa vendida con o sin impuestos y /// asignacion de valores a variables estaticas /// </summary> private void RatingActualFare() { farewithtaxessold = string.Empty; farewithouttaxessold = string.Empty; string active = activeStepsCorporativeQC.CorporativeQualityControls[0].CuotingActualFare; string send = string.Empty; string sabreAnswer = string.Empty; int row = 0; int col = 0; if (active.Equals(Resources.TicketEmission.Constants.ACTIVE)) { send = Resources.TicketEmission.Constants.COMMANDS_WP; MyCTS.Presentation.Parameters.TimeExtendedAPI = true; try { using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } } catch { } MyCTS.Presentation.Parameters.TimeExtendedAPI = false; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col); if (row != 0 || col != 0) { CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.TOTAL, ref row, ref col, 1, 4, 30, 64); if (row != 0 || col != 0) { row = row + 1; tempFareWithTaxes = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref tempFareWithTaxes, row, 47, 14); tempFareWithTaxes = tempFareWithTaxes.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); tempFareWithTaxes = tempFareWithTaxes.Trim(); farewithtaxessold = tempFareWithTaxes; row = 0; col = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.EQUIV_AMT, ref row, ref col, 1, 4, 15, 40); if (row != 0 || col != 0) { row = row + 1; tempFareWithoutTaxes = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref tempFareWithoutTaxes, row, 19, 14); tempFareWithoutTaxes = tempFareWithoutTaxes.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); tempFareWithoutTaxes = tempFareWithoutTaxes.Trim(); farewithouttaxessold = tempFareWithoutTaxes; internationalflight = true; } else { CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.BASE_FARE, ref row, ref col, 1, 4, 1, 20); if (row != 0 || col != 0) { row = row + 1; tempFareWithoutTaxes = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref tempFareWithoutTaxes, row, 5, 14); tempFareWithoutTaxes = tempFareWithoutTaxes.Replace(Resources.TicketEmission.Constants.MXN, Resources.TicketEmission.Constants.SPACE); tempFareWithoutTaxes = tempFareWithoutTaxes.Trim(); farewithouttaxessold = tempFareWithoutTaxes; internationalflight = false; } } row = 0; col = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.ADT, ref row, ref col, 5, 7, 1, 4); if (row != 0 || col != 0) { farebasissold = string.Empty; CommandsQik.CopyResponse(sabreAnswer, ref farebasissold, row, 9, 30); } } //UC = "comparisonRates";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_COMPARISON_RATES); } else { send = Resources.TicketEmission.Constants.COMMANDS_AST_PQ; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } row = 0; col = 0; CommandsQik.searchResponse(sabreAnswer, Resources.TicketEmission.ValitationLabels.PRICE_QUOTE_RECORD_DETAILS, ref row, ref col); if (row != 0 || col != 0) { send = Resources.TicketEmission.Constants.COMMANDS_5H_NO_SE_PUDO_CALC_TARIFA_AUTO; using (CommandsAPI objCommand = new CommandsAPI()) { sabreAnswer = objCommand.SendReceive(send); } //UC = "comparisonRates";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_COMPARISON_RATES); } else { MessageBox.Show(Resources.TicketEmission.Tickets.NO_CALC_TARIFA_VENDIDA_RECOTIZA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning); //UC = "welcome";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } } } else { //UC = "comparisonRates";// Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_COMPARISON_RATES); } }