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> /// Gets the configure telephones. /// </summary> /// <returns></returns> public List <VolarisContactTelephone> GetConfigureTelephones() { var configuredTelephoneParameter = ParameterBL.GetParameterValue("VolarisConfiguredTelephones"); var telephones = new List <VolarisContactTelephone>(); if (configuredTelephoneParameter != null && !string.IsNullOrEmpty(configuredTelephoneParameter.Values)) { var phonesStrings = configuredTelephoneParameter.Values.Split('|'); foreach (var phoneString in phonesStrings) { if (!string.IsNullOrEmpty(phoneString)) { var phone = phoneString.Split('-'); if (phone.Length == 2) { var email = new VolarisContactTelephone() { TelephoneCityCode = phone[0], Telephone = phone[1] }; telephones.Add(email); } } } } return(telephones); }
/// <summary> /// Carga el catalogo de perfiles por codigo y carga la primer pantalla dependiendo si es por flujo /// o por opcion del menu /// </summary> private void InitialProcess() { if (IsReservationFlow) { toolStripDropDownOptionProfiles.Enabled = false; pnlProfiles.TabIndex = 1; toolStripProfileMenu.TabIndex = 2; LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES); } else { string activeProfiles = ParameterBL.GetParameterValue(Resources.Profiles.Constants.ACTIVE_PROFILES).Values; if (Convert.ToBoolean(activeProfiles)) { toolStriptxtSearch.Enabled = true; toolStripTextDK.Enabled = true; ToolStripMenuItemCreateProfile2ndLevel.Enabled = true; ToolStripMenuItemNewProfile.Enabled = true; } else { ToolStripMenuItemCreateProfile2ndLevel.Enabled = false; ToolStripMenuItemNewProfile.Enabled = false; } LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES); } }
//****************************************** private void ucMCO_PTAAccountingLine_Load(object sender, EventArgs e) { ucAvailability.IsInterJetProcess = false; if (!Convert.ToBoolean(ParameterBL.GetParameterValue("AllowDecimalNumbers").Values)) { txtQuantity.CharsIncluded = null; txtBasisFare.Text = "0"; txtBasisFare.CharsIncluded = null; txtTaxe1.Text = "0"; txtTaxe1.CharsIncluded = null; txtTaxe2.Text = "0"; txtTaxe2.CharsIncluded = null; allowDecimal = false; } HideListboxControls(); foreach (Control txt in this.Controls) { if (txt is SmartTextBox && !txt.Enabled) { txt.BackColor = SystemColors.Control; } } rdoMCO.Checked = true; rdoMCO.Focus(); }
/// <summary> /// Handles the DoWork event of the MailerWorker control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param> void MailerWorker_DoWork(object sender, DoWorkEventArgs e) { MyCTS.Entities.Parameter parameter = ParameterBL.GetParameterValue("InterJetConfirmationMails"); if (parameter != null && !string.IsNullOrEmpty(parameter.Values)) { string[] mails = parameter.Values.Split('|'); if (mails.Length > 0) { var htmlGenerator = new InterJetMailContentGenerator { Ticket = (InterJetTicket)e.Argument }; foreach (string mail in mails) { if (!string.IsNullOrEmpty(mail)) { string subject = string.Format( "Reservación de InterJet - {0} - Codigo de Confirmación: {1}", Ticket.Contact.FullName, Ticket.RecordLocator); SendMail(mail, htmlGenerator.GetResplacement(), htmlGenerator.GetHtmlContent(), subject); } } } } }
private void FillList() { var parameter = ParameterBL.GetParameterValue("VolarisMessage"); if (parameter != null && !string.IsNullOrEmpty(parameter.Values)) { messageList = parameter.Values.Split('|').ToList(); } }
private void btnOK_Click(object sender, System.EventArgs e) { InputResponse = this.txtInput.Text; Parameter pass = ParameterBL.GetParameterValue("PasswordProfilesDelete"); if (InputResponse.Equals(pass.Values)) { if (!string.IsNullOrEmpty(firstStarName) && string.IsNullOrEmpty(secondStarName)) { DialogResult result = MessageBox.Show(string.Format("¿DESEAS BORRAR LA ESTRELLA DE PRIMER NIVEL {0}?", firstStarName), Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result.Equals(DialogResult.Yes)) { Delete1stLevelBL.Delete1stLevel(pcc, firstStarName); //Active1stLevelBL.Active1stLevel(pcc, firstStarName); SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, firstStarName, string.Empty, DateTime.Now); CatAllStarsBL.ListAllStars.Clear(); LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES); } } else if (!string.IsNullOrEmpty(firstStarName) && !string.IsNullOrEmpty(secondStarName)) { DialogResult result = MessageBox.Show(string.Format("¿DESEAS BORRAR LA ESTRELLA DE SEGUNDO NIVEL {0}?", secondStarName), Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result.Equals(DialogResult.Yes)) { Delete2ndLevelBL.Delete2ndLevel(secondStarName); //Active2ndLevelBL.Active2ndLevel(pcc, firstStarName, secondStarName); SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, firstStarName, secondStarName, DateTime.Now); bool noSecondStar = true; List <CatAllStars> Star2Count = CatAllStarsBL.GetAll2ndStarDetailed_Profile(ucProfileSearch.star1Info[0].Pccid, ucProfileSearch.star1Info[0].Level1, Login.OrgId); if (Star2Count != null) { foreach (CatAllStars item in Star2Count) { if (item.Active) { noSecondStar = false; break; } } } if (noSecondStar) { Update1stLevelBL.Update1stLevel(pcc, firstStarName, string.Empty, 2); } LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES); } } } else { MessageBox.Show(Resources.Profiles.Constants.PASSWORD_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } this.Close(); }
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); }
private void ActivateCalculateChargeService() { if (this.InvokeRequired) { SenderCallBack scb = new SenderCallBack(ActivateCalculateChargeService); this.Invoke(scb); } else { activateFormOfPaymentCS = ParameterBL.GetParameterValue("ActivateFormOfPaymentCS"); activateOldRemarkCS = ParameterBL.GetParameterValue("ActivateOldRemarkCS"); CalculateChargeService(); } }
public static void ReSendPDFDocumnets(string ticketNumber, string urlVirtuallyThere, string ccMail) { Parameter mailToSend = ParameterBL.GetParameterValue("MailThatSendFeeRule"); Parameter mailPassword = ParameterBL.GetParameterValue("PasswordThatMailToSend"); Parameter displyName = ParameterBL.GetParameterValue("NameSendEmail"); try { BuildElectronicTicketContract ws = new BuildElectronicTicketContract(); ws.SendPDFDocuments(ticketNumber, Login.Mail, ccMail, urlVirtuallyThere, mailToSend.Values, mailPassword.Values, displyName.Values); } catch { } }
/// <summary> /// Gets the agent contact. /// </summary> /// <returns></returns> private InterJetAgentContact GetAgentContact() { Parameter parameter = ParameterBL.GetParameterValue("DireccionCTS"); if (parameter != null) { string[] addresithPI = parameter.Values.Split('|'); string[] names = Login.NombreCompleto.Split(' '); string name = ""; string lastName = ""; if (names.Length >= 3) { name = names[0]; lastName = names[2]; } else { name = names[0]; lastName = names[1]; } return(new InterJetAgentContact { Name = name, LastName = lastName, Email = Login.Mail, Address1 = addresithPI[0], Address2 = addresithPI[1], Address3 = addresithPI[2], City = addresithPI[3], State = addresithPI[4], Country = addresithPI[5], PrimaryTelephone = addresithPI[6], PostalCode = addresithPI[7] }); } return(new InterJetAgentContact()); }
//Establece el estado de los controles private void ucRevisedCharge_Load(object sender, EventArgs e) { ucAvailability.IsInterJetProcess = false; if (!Convert.ToBoolean(ParameterBL.GetParameterValue("AllowDecimalNumbers").Values)) { txtBaseAmount.CharsIncluded = null; txtTax1.CharsIncluded = null; txtTax2.CharsIncluded = null; txtTax3.CharsIncluded = null; } Previousvalues(); lbGeneric.BringToFront(); if (ucTicketsEmissionInstructions.WithCharge) { EnableDisableControls(true); txtBaseAmount.BackColor = Color.White; txtTax1.BackColor = Color.White; txtTax2.BackColor = Color.White; txtTax3.BackColor = Color.White; txtCode1.BackColor = Color.White; txtCode2.BackColor = Color.White; txtCode3.BackColor = Color.White; txtBaseAmount.Focus(); } else if (ucTicketsEmissionInstructions.WithoutCharge) { EnableDisableControls(false); txtBaseAmount.BackColor = SystemColors.Control; txtTax1.BackColor = SystemColors.Control; txtTax2.BackColor = SystemColors.Control; txtTax3.BackColor = SystemColors.Control; txtCode1.BackColor = SystemColors.Control; txtCode2.BackColor = SystemColors.Control; txtCode3.BackColor = SystemColors.Control; txtAirlineTicket.Focus(); } txtAirlineTicke2.BackColor = SystemColors.Control; }
public List <VolarisContactEmail> GetConfiguredEmails() { var configuredEmailParameter = ParameterBL.GetParameterValue("VolarisConfiguredEmail"); var emails = new List <VolarisContactEmail>(); if (configuredEmailParameter != null && !string.IsNullOrEmpty(configuredEmailParameter.Values)) { var emailsStrings = configuredEmailParameter.Values.Split('|'); foreach (var emailString in emailsStrings) { if (!string.IsNullOrEmpty(emailString)) { var email = new VolarisContactEmail() { Email = emailString }; emails.Add(email); } } } return(emails); }
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> /// Agrega una nueva regla de cargo por servicio y sus targets /// correspondientes /// </summary> private void AddTargets() { ListTargetsRules = new List <Targets>(); foreach (Control txt in this.Controls) { if (txt is SmartTextBox && !string.IsNullOrEmpty(txt.Text) && !(txt.TabIndex.Equals(22) || txt.TabIndex.Equals(23) || txt.TabIndex.Equals(17))) { Targets t = new Targets(); t.IDTE = txt.TabIndex; t.Value2 = txt.Text; ListTargetsRules.Add(t); } } if (cmbOriginOfSale.SelectedIndex > 0) { Targets t = new Targets(); t.IDTE = cmbOriginOfSale.TabIndex; t.Value2 = Convert.ToString(cmbOriginOfSale.Text); ListTargetsRules.Add(t); } if (cmbOperativeUnit.SelectedIndex > 0) { Targets t = new Targets(); t.IDTE = 23; t.Value2 = Convert.ToString(cmbOperativeUnit.Text); ListTargetsRules.Add(t); } if (cmbPayForm.SelectedIndex > 0) { Targets t = new Targets(); t.IDTE = cmbPayForm.TabIndex; t.Value2 = Convert.ToString(cmbPayForm.SelectedItem); ListTargetsRules.Add(t); } if (!string.IsNullOrEmpty(txtHora1.Text) && !string.IsNullOrEmpty(txtHora2.Text)) { Targets t1 = new Targets(); t1.IDTE = 22; t1.Value2 = string.Concat(txtHora1.Text, " - ", txtHora2.Text); ListTargetsRules.Add(t1); } if (!string.IsNullOrEmpty(txtBaseFare2.Text) && !string.IsNullOrEmpty(txtBaseFare.Text)) { Targets t17 = new Targets(); t17.IDTE = 17; t17.Value2 = string.Concat(txtBaseFare.Text, " a ", txtBaseFare2.Text); ListTargetsRules.Add(t17); } string corp = string.Empty; string descripcion = string.Empty; string extendDescripcion = string.Empty; string porcentaje = string.Empty; string cantidad = string.Empty; string priority = string.Empty; string fechaInicio = string.Empty; string fechaFin = string.Empty; int numberRule = 0; for (int i = 0; i < ucNewFeeRule.Criterios.Count; i++) { if (ucNewFeeRule.Criterios[i].numberCritery == 1) { corp = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 2) { descripcion = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 3) { extendDescripcion = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 4) { porcentaje = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 5) { cantidad = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 6) { priority = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 7) { fechaInicio = ucNewFeeRule.Criterios[i].criterio; } else if (ucNewFeeRule.Criterios[i].numberCritery == 8) { fechaFin = ucNewFeeRule.Criterios[i].criterio; } } DialogResult yesNo = MessageBox.Show("¿SEGURO QUE DESEA CREAR ESTA NUEVA REGLA PARA EL CORPORATIVO " + corp + "?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (yesNo.Equals(DialogResult.Yes)) { if (!string.IsNullOrEmpty(ucNewFeeRule.Attribute1)) { UpdatePriorityByAttribute1BL.UpdatePriorities(ucNewFeeRule.NewPriority, ucNewFeeRule.Attribute1); } List <SetNewFeeRule> ListNumberRule = new List <SetNewFeeRule>(); ListNumberRule = NewFeeRuleBL.SetNewFeeRule(corp, Convert.ToInt32(priority), descripcion, extendDescripcion, (!string.IsNullOrEmpty(porcentaje)) ? Convert.ToDecimal(porcentaje) : 0, (!string.IsNullOrEmpty(cantidad)) ? Convert.ToDecimal(cantidad) : 0, (ucNewFeeRule.MontoFijo) ? true : false, false, fechaInicio, fechaFin, Login.Agent); if (ListNumberRule.Count > 0) { numberRule = ListNumberRule[0].IDRuleNumber; if (ucDefinitionTargetElements.ListTargetsRules != null) { for (int i = 0; i < ucDefinitionTargetElements.ListTargetsRules.Count; i++) { if (ucDefinitionTargetElements.ListTargetsRules[i].IDTE == 3 || ucDefinitionTargetElements.ListTargetsRules[i].IDTE == 8) { ucDefinitionTargetElements.ListTargetsRules[i].Value2 = BuildDate(ucDefinitionTargetElements.ListTargetsRules[i].Value2); } SetNewTargetFeeRuleBL.AddNewTargetFeeRule(numberRule, ucDefinitionTargetElements.ListTargetsRules[i].IDTE, ucDefinitionTargetElements.ListTargetsRules[i].Value2); } } if (ListTargetsRules != null) { for (int j = 0; j < ListTargetsRules.Count; j++) { SetNewTargetFeeRuleBL.AddNewTargetFeeRule(numberRule, ListTargetsRules[j].IDTE, ListTargetsRules[j].Value2); } } if (!string.IsNullOrEmpty(ucDefinitionTargetElements.LocationDKNotAccepted)) { SetLocationDKNotAcceptedBL.SetLocationDKNotAccepted(numberRule, ucDefinitionTargetElements.LocationDKNotAccepted); } } ucDefinitionTargetElements.PaxNum = 0; ucNewFeeRule.Criterios.Clear(); ucDefinitionTargetElements.ListTargetsRules.Clear(); ucNewFeeRule.listAttribute1.Clear(); ListTargetsRules.Clear(); //GetMailByUser userMail = GetMailByUserBL.GetMail(Login.Agent); Parameter mailToValidate = ParameterBL.GetParameterValue("MailToValidateFeeRule"); Parameter mailToSend = ParameterBL.GetParameterValue("MailThatSendFeeRule"); Parameter mailPassword = ParameterBL.GetParameterValue("PasswordThatMailToSend"); Parameter ccMailToValidate = ParameterBL.GetParameterValue("CC-MailToValidateFeeRule"); Parameter displyName = ParameterBL.GetParameterValue("NameSendEmail"); string body = string.Concat("Solicitud de Activación de Nueva Regla - Cargo por Servicio\n\n", "Número de regla: ", numberRule, "\n", "Nombre: ", descripcion, "\n", "Solicitado por: ", Login.Agent, " (", Login.NombreCompleto, ")", "\n", "Corporativo: ", corp, "\n", "Fecha Sol.: ", Convert.ToString(DateTime.Now).Substring(0, 10), "\n", "Prioridad: ", priority, "\n"); List <GetInformationRuleApplied> listInfoRule = GetInformationRuleAppliedBL.GetInfoRule(numberRule, true); string targets = string.Empty; targets = "Los criterios para aplicación de la regla son los siguientes:\n\n"; targets = string.Concat(targets, " -", "Porcentaje de la Tarifa Base: ".ToUpper().PadRight(35, ' '), (string.IsNullOrEmpty(porcentaje)) ? "0" : porcentaje, "\n\n"); targets = string.Concat(targets, " -", "Cantidad fija: ".ToUpper().PadRight(35, ' '), "$", (string.IsNullOrEmpty(cantidad)) ? "0.00" : Convert.ToDecimal(cantidad).ToString("0.00"), "\n\n"); targets = string.Concat(targets, " -", "Monto: ".ToUpper().PadRight(35, ' '), (ucNewFeeRule.MontoFijo) ? "No Negociable" : "Negociable", "\n\n"); ucNewFeeRule.MontoFijo = false; if (!string.IsNullOrEmpty(fechaInicio)) { targets = string.Concat(targets, " -", "Fecha de Inicio de la Regla: ".ToUpper().PadRight(35, ' '), fechaInicio, "\n\n"); } if (!string.IsNullOrEmpty(fechaFin)) { targets = string.Concat(targets, " -", "Fecha de Expiración de la Regla: ".ToUpper().PadRight(35, ' '), fechaFin, "\n\n"); } for (int i = 0; i < listInfoRule.Count; i++) { targets = string.Concat(targets, " -", string.Concat(listInfoRule[i].Target, ": ").ToUpper().PadRight(35, ' '), listInfoRule[i].Value2, "\n\n"); } if (!string.IsNullOrEmpty(ucDefinitionTargetElements.LocationDKNotAccepted)) { targets = string.Concat(targets, " -", "Location(DK) Excluyente: ".ToUpper().PadRight(35, ' '), ucDefinitionTargetElements.LocationDKNotAccepted, "\n\n"); } ucDefinitionTargetElements.LocationDKNotAccepted = string.Empty; body = string.Concat(body, "\n", targets); body = string.Concat(body, "\nFavor de evaluar dicha regla y activarla si es conveniente."); try { SendMailAync(mailToSend.Values, mailPassword.Values, displyName.Values, mailToValidate.Values, ccMailToValidate.Values, "Nueva regla de cargo por servicio", body); SendMailAync(mailToSend.Values, mailPassword.Values, displyName.Values, Login.Mail, "", "Solucitud Nueva Regla Cargo por Servicio", "Hola " + Login.NombreCompleto + "\n\nMyCTS te da las gracias por haber creado una nueva regla de Cargo por Servicio, " + "te informamos que dicha regla fue creada con éxito con el número de regla " + numberRule + " para el corporativo " + corp + "\n\nUna vez que sea evaluada por la Dirección de Operaciones estará disponible para su uso." + "\n\nGracias"); } catch { } MessageBox.Show("LA REGLA " + numberRule + " DE CARGO POR SERVICIO SE CREO CON EXITO, Y SE ENCUENTRA INACTIVA\n" + "HASTA QUE SEA SUJETA A AUTORIZACIÓN POR LA DIRECIÓN DE OPERACIONES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); if (ucNewFeeRule.LoadUserWelcome) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UC_TICKETEMISSION_CONFIRMATION); } } else { cmbOriginOfSale.Focus(); } }
/// <summary> /// Se envia el comando de acuerdo a los campos ingresados /// </summary> private void CommandsSend() { int row = 0; int col = 0; string sendPCC = string.Empty; string res = string.Empty; bool conected = false; if (rbnBoth.Checked) { sendPCC = string.Concat(sendPCC, "AAA", txtPCC.Text); using (CommandsAPI objCommand = new CommandsAPI()) { res = objCommand.SendReceive(sendPCC); } CommandsQik.searchResponse(res, txtPCC.Text, ref row, ref col); if (row != 0 || col != 0) { conected = true; } else { MessageBox.Show("ERROR EN LA CONEXIÓN CON MySABRE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } if (conected) { string result = string.Empty; string send = string.Empty; string sabre = string.Empty; string authorization = string.Empty; string keywords = string.Empty; string pass = string.Empty; string codeagent = string.Empty; row = 0; col = 0; if (!onlyagent) { send = string.Concat(send, "HB", txtNumberFirm.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(send); } CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; send = string.Empty; send = string.Concat("H/NAM", txtLastName.Text, "/", txtInitial.Text); sabre = "H/DTY6*/"; if (chkDutyCode.Checked) { sabre = string.Concat(sabre, "9"); } authorization = string.Concat(authorization, "H/AUTH BY", txtAuthorization.Text); keywords = "H/UAT/A-24TIME,SUBAAA,PFKAGT,PTRAGT"; if (chkMINIOPR.Checked) { keywords = string.Concat(keywords, ",MINOPR"); } if (chkCreate.Checked) { keywords = string.Concat(keywords, ",CREATE"); } if (chkAccess.Checked) { keywords = string.Concat(keywords, ",ACCESS"); } if (chkCIIMGR.Checked) { keywords = string.Concat(keywords, ",CIIMGR"); } if (chkSUBMGR.Checked) { keywords = string.Concat(keywords, ",SUBMGR"); } if (chkPNRREL.Checked) { keywords = string.Concat(keywords, ",PNRREL"); } if (chkSUBACC.Checked) { keywords = string.Concat(keywords, ",SUBACC"); } if (cmbKeyWord8.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord8.Text); } if (cmbKeyWord9.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord9.Text); } if (cmbKeyWord10.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord10.Text); } if (cmbKeyWord11.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord11.Text); } if (cmbKeyWord12.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord12.Text); } pass = string.Concat(pass, "H/PASS", txtPassCode.Text); codeagent = string.Concat(codeagent, "HH/A", txtCodeAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); objCommand.SendReceive(sabre); objCommand.SendReceive("H/ASO240"); objCommand.SendReceive(authorization); objCommand.SendReceive(keywords); objCommand.SendReceive(pass); result = objCommand.SendReceive(codeagent); } } else { MessageBox.Show("LA FIRMA YA EXISTE, INGRESE AL MODULO DE MODIFICACIONES PARA CAMBIOS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } CommandsQik.searchResponse(result, "IGN", ref row, ref col); } } else { codeagent = string.Concat(codeagent, "HH/A", txtCodeAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(codeagent); } } CommandsQik.searchResponse(result, "DUP", ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show("EL CODIGO DE AGENTE YA EXISTE, INGRESE OTRO!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtCodeAgent.Focus(); onlyagent = true; row = 0; col = 0; } CommandsQik.searchResponse(result, "DONE", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; sabre = string.Empty; sabre = string.Concat("QS/", txtPCC.Text, txtQueue.Text, "/A-", txtCodeAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(sabre); } CommandsQik.searchResponse(result, "ITEM ALREADY IN TABLE", ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show("FIRMA CREADA CORRECTAMENTE, ERROR EN LA ASIGNACIÓN DE LA QUEUE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("FIRMA CREADA Y ASIGNACION A LA QUEUE CON EXITO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } string username = string.Concat(txtInitial.Text, " ", txtLastName.Text); string cc = string.Empty; Parameter copy = ParameterBL.GetParameterValue("MailToCreateFirm"); cc = copy.Values; AddNewUserBL.AddNewUser(username, username.ToLower(), txtEmail.Text.ToLower(), textAgentMail.Text.ToLower(), DateTime.Today.ToString().Substring(0, 10), txtNumberFirm.Text, txtPassCode.Text, txtName.Text.ToLower(), txtCodeAgent.Text, txtQueue.Text, txtPCC.Text, txtTA.Text, "SA"); SendEMail(cc); if (!txtQueue.Text.Equals("152")) { DialogResult yesNo = MessageBox.Show("Este usuario recibirá reporte de productividad semanal?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (yesNo.Equals(DialogResult.Yes)) { SetProductivityMailStatusBL setStatus = new SetProductivityMailStatusBL(); setStatus.SetProductivityMailStatus(txtNumberFirm.Text, txtPCC.Text); } } UpdateStatusAllFirmModulesBL.UpdateStatusTA(txtTA.Text); UpdateStatusAllFirmModulesBL.UpdateStatusQueue(txtQueue.Text); UpdateStatusAllFirmModulesBL.UpdateStatusAgent(txtCodeAgent.Text); UpdateStatusAllFirmModulesBL.UpdateStatusFirm(txtNumberFirm.Text); MessageBox.Show("CUENTA DE MyCTS CREADA EXITOSAMENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); row = 0; col = 0; Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } } } else if (rbnMyCTS.Checked) { try { User usuarioDto = null; User ValidAgentMail = null; usuarioDto = UserBL.GetUser(txtNumberFirm.Text, txtPCC.Text); ValidAgentMail = UserBL.ValidAgentMail(textAgentMail.Text); if (usuarioDto == null) { if (ValidAgentMail == null) { string username = string.Concat(txtInitial.Text, " ", txtLastName.Text); string cc = string.Empty; Parameter copy = ParameterBL.GetParameterValue("MailToCreateFirm"); cc = copy.Values; AddNewUserBL.AddNewUser(username, username.ToLower(), txtEmail.Text.ToLower(), textAgentMail.Text.ToLower(), DateTime.Today.ToString().Substring(0, 10), txtNumberFirm.Text, txtPassCode.Text, txtName.Text.ToLower(), txtCodeAgent.Text, txtQueue.Text, txtPCC.Text, txtTA.Text, "SA"); SendEMail(cc); if (!txtQueue.Text.Equals("152")) { DialogResult yesNo = MessageBox.Show("Este usuario recibirá reporte de productividad semanal?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (yesNo.Equals(DialogResult.Yes)) { SetProductivityMailStatusBL setStatus = new SetProductivityMailStatusBL(); setStatus.SetProductivityMailStatus(txtNumberFirm.Text, txtPCC.Text); } } UpdateStatusAllFirmModulesBL.UpdateStatusTA(txtTA.Text); UpdateStatusAllFirmModulesBL.UpdateStatusQueue(txtQueue.Text); UpdateStatusAllFirmModulesBL.UpdateStatusAgent(txtCodeAgent.Text); UpdateStatusAllFirmModulesBL.UpdateStatusFirm(txtNumberFirm.Text); MessageBox.Show("CUENTA DE MyCTS CREADA EXITOSAMENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else { MessageBox.Show("EL AGENTMAIL YA EXISTE EN MyCTS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("EL USUARIO YA EXISTE EN MyCTS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { } } else if (rbnSabre.Checked) { try { string result = string.Empty; string send = string.Empty; string sabre = string.Empty; string authorization = string.Empty; string keywords = string.Empty; string pass = string.Empty; string codeagent = string.Empty; body = string.Empty; row = 0; col = 0; sendPCC = string.Concat(sendPCC, "AAA", txtPCC.Text); using (CommandsAPI objCommand = new CommandsAPI()) { res = objCommand.SendReceive(sendPCC); } CommandsQik.searchResponse(res, txtPCC.Text, ref row, ref col); if (row != 0 || col != 0) { conected = true; } else { MessageBox.Show("ERROR EN LA CONEXIÓN CON MySABRE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } if (conected) { if (!onlyagent) { send = string.Concat(send, "HB", txtNumberFirm.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(send); } CommandsQik.searchResponse(result, "NEW EMPLOYEE", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; send = string.Empty; send = string.Concat("H/NAM", txtLastName.Text, "/", txtInitial.Text); sabre = "H/DTY6*/"; if (chkDutyCode.Checked) { sabre = string.Concat(sabre, "9"); } authorization = string.Concat(authorization, "H/AUTH BY", txtAuthorization.Text); keywords = "H/UAT/A-24TIME,SUBAAA,PFKAGT,PTRAGT"; if (chkMINIOPR.Checked) { keywords = string.Concat(keywords, ",MINOPR"); } if (chkCreate.Checked) { keywords = string.Concat(keywords, ",CREATE"); } if (chkAccess.Checked) { keywords = string.Concat(keywords, ",ACCESS"); } if (chkCIIMGR.Checked) { keywords = string.Concat(keywords, ",CIIMGR"); } if (chkSUBMGR.Checked) { keywords = string.Concat(keywords, ",SUBMGR"); } if (chkPNRREL.Checked) { keywords = string.Concat(keywords, ",PNRREL"); } if (chkSUBACC.Checked) { keywords = string.Concat(keywords, ",SUBACC"); } if (cmbKeyWord8.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord8.Text); } if (cmbKeyWord9.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord9.Text); } if (cmbKeyWord10.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord10.Text); } if (cmbKeyWord11.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord11.Text); } if (cmbKeyWord12.SelectedIndex > 0) { keywords = string.Concat(keywords, ",", cmbKeyWord12.Text); } pass = string.Concat(pass, "H/PASS", txtPassCode.Text); codeagent = string.Concat(codeagent, "HH/A", txtCodeAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); objCommand.SendReceive(sabre); objCommand.SendReceive("H/ASO240"); objCommand.SendReceive(authorization); objCommand.SendReceive(keywords); objCommand.SendReceive(pass); result = objCommand.SendReceive(codeagent); } } else { MessageBox.Show("LA FIRMA YA EXISTE, INGRESE AL MODULO DE MODIFICACIONES PARA CAMBIOS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive("I"); } //CommandsQik.searchResponse(result, "IGN", ref row, ref col); } } else { codeagent = string.Concat(codeagent, "HH/A", txtCodeAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(codeagent); } } CommandsQik.searchResponse(result, "DUP", ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show("EL CODIGO DE AGENTE YA EXISTE, INGRESE OTRO!", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); txtCodeAgent.Focus(); onlyagent = true; row = 0; col = 0; } CommandsQik.searchResponse(result, "DONE", ref row, ref col); if (row != 0 || col != 0) { row = 0; col = 0; sabre = string.Empty; sabre = string.Concat("QS/", txtPCC.Text, txtQueue.Text, "/A-", txtCodeAgent.Text); using (CommandsAPI objCommand = new CommandsAPI()) { result = objCommand.SendReceive(sabre); } CommandsQik.searchResponse(result, "ITEM ALREADY IN TABLE", ref row, ref col); if (row != 0 || col != 0) { MessageBox.Show("FIRMA CREADA CORRECTAMENTE, ERROR EN LA ASIGNACIÓN DE LA QUEUE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("FIRMA CREADA Y ASIGNACION A LA QUEUE CON EXITO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } catch { } } }
private void LoadControl() { //Carga el nombre del Splash en caso de que ocurra un //error para registrarlo en el log Common.LogApplicationItem.UserControlName = "Splash"; #region Datos Usuario User usuarioDto = m_userDto; string password = m_password; Login.Firm = usuarioDto.Firm; Login.passWord = password; Login.PCC = usuarioDto.PCC; Login.TA = usuarioDto.TA; Login.UserId = usuarioDto.UserId; Login.Queue = usuarioDto.Queue; Login.Mail = usuarioDto.UserMail; Login.NombreCompleto = usuarioDto.FamilyName; Login.IsMySabreBlocked = usuarioDto.IsMySabreBlocked; Login.Agent = usuarioDto.Agent; Login.IsFramework35Installed = usuarioDto.IsFramework35Installed; Login.ProfileAllAccess = usuarioDto.ProfileAllAccess; Login.ApplicationName = usuarioDto.ApplicationName; Login.OrgId = usuarioDto.OrgId; UserBL.OrgIdBL = usuarioDto.OrgId; Login.Supervisor = usuarioDto.Supervisor; Login.UpgradeStatus = usuarioDto.UpgradeStatus; //Crear perfil de properties de mySABRE por default #endregion if (Login.UpgradeStatus.Equals(0) && Login.ByParameters) { MessageBox.Show("Acción Cancelada. Ejecutar la aplicación MyCTS que se encuentra en el escritorio."); CloseApp(); } else if (Login.UpgradeStatus.Equals(0) && !Login.ByParameters) { GlobalConstants.PATH_SABRE_USER = string.Format(ConfigurationManager.AppSettings["PATH_MYSABRE_USER"] + "{0}", Login.Firm); GlobalConstants.PATH_SABRE_COMPILED = ConfigurationManager.AppSettings["PATH_MYSABRE_COMPILED"]; } else if (Login.UpgradeStatus.Equals(2) && !Login.ByParameters) { bool exists = File.Exists(Path.Combine(ConfigurationManager.AppSettings["PATH_SABRERED_USER"], @"Profiles\3L64_1571\mysabre.exe")); if (!exists) { MessageBox.Show("Su usuario no puede trabajar con la versión instalada en este equipo, se empezara a actualizar a MyCTS2"); Login.UpgradeStatus = 1; UpdateSRW(); } } GlobalConstants.PATH_SABRE_USER = ConfigurationManager.AppSettings["PATH_SABRERED_USER"]; GlobalConstants.PATH_SABRE_COMPILED = ConfigurationManager.AppSettings["PATH_SABRERED_COMPILED"]; try { SendMessages("Inicializando . . ."); Parameters.ServerDateTime = MyCTS.Services.Contracts.Productivity.GetCurrentDateTime(); Parameters.LocalDateTime = DateTime.Now; //Verifica que el usuario tenga framework 3.5 instalado if (usuarioDto.InstallFramework35) { SilentInstaller.CheckFrameworkVersion(); } DeleteInitialFiles(); GlobalConstants.FilesDBList = CatalogsBL.GetCatalogsFileNames(); try { MyCTSAPI.EnabledBrowser(true); } catch {} // Actualizar a SRW UpdateSRW(); //Tiempos de respuesta del API para comandos manuales y comandos extendidos try { Parameters.CurrentTimeAPINormal = ParameterBL.GetParameterValue("CurrentTimeAPINormal").Values; Parameters.CurrentTimeAPIExtended = ParameterBL.GetParameterValue("CurrentTimeAPIExtended").Values; } catch { Parameters.CurrentTimeAPINormal = "29"; Parameters.CurrentTimeAPIExtended = "240"; } Parameters.TimeExtendedAPI = false; } catch { } #region Verificando configuración . . . string[] driversPath = new string[] { "c:\\", "d:\\" }; string strPath = string.Empty; string strPathTurbo = string.Empty; string strTA = null; try { SendMessages("Verificando configuración . . ."); if (string.IsNullOrEmpty(usuarioDto.TA)) { Login.IsFirstTime = true; foreach (string myDrive in driversPath) { //Obtener la TA de cada maquina. strPath = myDrive + Resources.Constants.PATH_TA_FILE; strTA = GetTAUserMachine(strPath); usuarioDto.TA = strTA; if (!string.IsNullOrEmpty(strTA)) { break; } } } //Update la TA UserBL.UpdateUser(usuarioDto.ApplicationId, usuarioDto.UserId, usuarioDto.UserName, usuarioDto.LoweredUserName, usuarioDto.UserMail, DateTime.Now, usuarioDto.Firm, password, usuarioDto.FamilyName, usuarioDto.Agent, usuarioDto.Queue, usuarioDto.PCC, usuarioDto.TA); //Obtiene el profile del usuario. Profile profileDto = m_userDto.ProfileUser; //Cambiar el nombre del archivo de TurboSABRE if (profileDto != null) { string bannerText = Common.GetProfileElement("BANNER", profileDto.PropertyNames, profileDto.PropertyValuesString); if (string.IsNullOrEmpty(bannerText)) { bannerText = Resources.Constants.BANNER_TEXT; } Login.BannerText = bannerText; Login.UserProfile = profileDto; if (!profileDto.LastUpdatedDate.Equals(DateTime.MinValue)) { foreach (string myDrive in driversPath) { //Obtener la TA de cada maquina. strPathTurbo = myDrive + Resources.Constants.PATH_TURBO_FILE; ChangeTurboSABREFile(strPathTurbo); } } } } catch (Exception ex) { Common.AddMessageToLog(ex); MessageBox.Show("No ha sido posible verificar la información del perfil, por favor contacte con el área de soporte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); CloseApp(); } #endregion ActualizaVersionDeMyCTS(); #region Creando datos del perfil . . . SendMessages("Cargando datos del perfil . . ."); try { SetSettingsUser(); } catch (Exception ex) { Common.AddMessageToLog(ex); MessageBox.Show("No ha sido posible copiar los archivos de configuración, por favor contacte con el área de soporte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); CloseApp(); } #endregion #region Cargando archivos de inicio . . . SendMessages("Cargando archivos de inicio . . ."); try { LoadMissingCatalogs(); } catch (Exception ex) { Common.AddMessageToLog(ex); MessageBox.Show("No ha sido posible descargar la información, por favor contacte con el área de soporte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); CloseApp(); } #endregion //Obtiene la contraseña para poder ingresar comandos de forma manual Parameter parameter = ParameterBL.GetParameterValue("ManualCommands"); Parameters.PasswordManualCommands = (parameter != null) ? parameter.Values : string.Empty; parameter = ParameterBL.GetParameterValue("SecondsLogs"); Parameters.SecondsLogs = (parameter != null) ? parameter.Values : "60000"; parameter = ParameterBL.GetParameterValue("NumCommandsToInsertLogs"); Parameters.NumCommandsToInsertLogs = (parameter != null) ? parameter.Values : "15"; CloseThisWin(); }
/// <summary> /// Elimina los remarks contables dentro del record menos .S*MX /// </summary> private void RemoveRemarks() { Parameter param = ParameterBL.GetParameterValue("RecoverCTSRemarks"); 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; if (param.Values.Equals("A")) { if (lines.Contains("</") && lines.Contains("-")) { getCTSQcValues(lines); } } } }
private void ucQualitiesByPax_Load(object sender, EventArgs e) { VolarisSession.Clean(); ucAvailability.IsInterJetProcess = false; string attribute = string.Empty; bool cfeRemark = Convert.ToBoolean(ParameterBL.GetParameterValue("ActivateRemarkToCFE").Values); if (!ucEndReservation.isFlowHotel) { attribute = ucFirstValidations.Attribute1.Substring(3, 3); } else { attribute = ucQCHotels.Attribute1.Substring(3, 3); } if (attribute.Equals("990")) { showDescription(false); } else { showDescription(true); } if (ucEndReservation.isFlowHotel) { if (ucQCHotels.Attribute1.Equals("CFE100") && cfeRemark && !ucRemarkToCFE.Status) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UCREMARKTOCFE); return; } else { ucRemarkToCFE.Status = false; } } else { if (ucFirstValidations.Attribute1.Equals("CFE100") && cfeRemark && !ucRemarkToCFE.Status) { Loader.AddToPanel(Loader.Zone.Middle, this, Resources.TicketEmission.Constants.UCREMARKTOCFE); return; } else { ucRemarkToCFE.Status = false; } } dayTime = DateTime.Now; ucFormPayment.C28 = string.Empty; LoadCreditCardTypeOption(); rdoYes.Checked = true; rdoYes.Focus(); ucAllQualityControls.originOfSale.Clear(); ucAllQualityControls.ListBussinesUnit.Clear(); numberone = string.Empty; numbertwo = string.Empty; numberthree = string.Empty; numberfour = string.Empty; passengers = string.Empty; pax = 0; sabreAnswer = string.Empty; if (string.IsNullOrEmpty(sabreconcat)) { commandSend(); bucleFindEndScroll(); } }
/// <summary> /// Obtiene la factura de un boleto en formato PDF y la guarda en /// archivos temporales del usuario /// </summary> private void GetInvoice() { linkInvoice = string.Empty; indexList.Clear(); GridViewFacturas.Visible = false; lblInfoFacturas.Visible = false; indexList = GetLinkByTktBL.GetLinkByTkt(txtInvoice.Text, Login.OrgId); if (indexList.Count > 0) { if (!string.IsNullOrEmpty(indexList[0].LinkInvoice) && indexList.Count == 1) { linkInvoice = indexList[0].LinkInvoice; Microsoft.VisualBasic.Devices.Computer MyComputer = new Microsoft.VisualBasic.Devices.Computer(); string fileName = string.Empty; fileName = MyComputer.FileSystem.SpecialDirectories.Temp; fileName = fileName + string.Format("\\TempFile_{0}.pdf", Guid.NewGuid().ToString()); if (DownloadFile(linkInvoice, fileName)) { try { Process.Start(fileName); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } catch { MessageBox.Show("NO CUENTA CON EL PROGRAMA CORRECTO PARA ABRIR ESTE ARCHIVO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } } } else if (string.IsNullOrEmpty(indexList[0].LinkInvoice)) { CommandsAPI2.send_MessageToEmulator("BUSCANDO FACTURA, FAVOR DE ESPERAR................."); Parameter timeOut = ParameterBL.GetParameterValue("TimeOutInvoice"); int time = Convert.ToInt32(timeOut.Values); AddLinksInvoicesPerTicketBL.AddLinksInvoicesPerTicket(txtInvoice.Text, time); indexList.Clear(); indexList = GetLinkByTktBL.GetLinkByTkt(txtInvoice.Text, Login.OrgId); if (string.IsNullOrEmpty(indexList[0].LinkInvoice)) { MessageBox.Show("LA INTERFASE AUN NO HA PROCESADO SU FACTURA, FAVOR DE VERIFICARLO MAS TARDE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else if (!string.IsNullOrEmpty(indexList[0].LinkInvoice) && indexList.Count == 1) { linkInvoice = indexList[0].LinkInvoice; Microsoft.VisualBasic.Devices.Computer MyComputer = new Microsoft.VisualBasic.Devices.Computer(); string fileName = string.Empty; fileName = MyComputer.FileSystem.SpecialDirectories.Temp; fileName = fileName + string.Format("\\TempFile_{0}.pdf", Guid.NewGuid().ToString()); if (DownloadFile(linkInvoice, fileName)) { try { Process.Start(fileName); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } catch { MessageBox.Show("NO CUENTA CON EL PROGRAMA CORRECTO PARA ABRIR ESTE ARCHIVO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } } } else if (!string.IsNullOrEmpty(indexList[0].LinkInvoice) && indexList.Count > 1) { GridViewFacturas.Visible = true; GridViewFacturas.Rows.Clear(); int index = 0; int index2 = 0; for (int i = 0; i < indexList.Count; i++) { index = indexList[i].LinkInvoice.LastIndexOf("."); index2 = indexList[i].LinkInvoice.LastIndexOf("/"); GridViewFacturas.Rows.Add(indexList[i].LinkInvoice.Substring(54, (index - index2 - 1)), indexList[i].DescriptionType); } GridViewFacturas.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; lblInfoFacturas.Visible = true; } } else if (!string.IsNullOrEmpty(indexList[0].LinkInvoice) && indexList.Count > 1) { GridViewFacturas.Visible = true; GridViewFacturas.Rows.Clear(); int index = 0; int index2 = 0; for (int i = 0; i < indexList.Count; i++) { index = indexList[i].LinkInvoice.LastIndexOf("."); index2 = indexList[i].LinkInvoice.LastIndexOf("/"); GridViewFacturas.Rows.Add(indexList[i].LinkInvoice.Substring(54, (index - index2 - 1)), indexList[i].DescriptionType); } GridViewFacturas.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; lblInfoFacturas.Visible = true; } } else { MessageBox.Show("EL NÚMERO DE BOLETO NO EXISTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } }
public static void CreateFilesPDF(List <string> tickets) { Parameter mailToSend = ParameterBL.GetParameterValue("MailThatSendFeeRule"); Parameter mailPassword = ParameterBL.GetParameterValue("PasswordThatMailToSend"); Parameter displyName = ParameterBL.GetParameterValue("NameSendEmail"); string[] tiketsArray = new string[tickets.Count]; string[] virtuallyThere = new string[tickets.Count]; List <GetLinkByTkt> indexList = null; for (int j = 0; j < tickets.Count; j++) { tiketsArray[j] = tickets[j]; indexList = new List <GetLinkByTkt>(); indexList = GetLinkByTktBL.GetLinkByTkt(tickets[j].Substring(3, 10), Login.OrgId); if (indexList.Count > 0) { virtuallyThere[j] = indexList[0].LinkVirtuallyThere; } else { virtuallyThere[j] = "http://www.google.com.mx"; } } if (tickets.Count > 0) { try { string mail = Login.Mail; if (!string.IsNullOrEmpty(ucSendTicketPrinter.TempCCMail)) { mail = string.Concat(mail, ";", ucSendTicketPrinter.TempCCMail); ucSendTicketPrinter.TempCCMail = string.Empty; } if (ucFirstValidations.Attribute1 != null) { if (ucFirstValidations.Attribute1.Equals(Resources.TicketEmission.Constants.ATTRIBUTE1_CFE100)) { BuildElectronicTicketCFEContract ws = new BuildElectronicTicketCFEContract(); ws.SendInfoToBuilPDF(tiketsArray, virtuallyThere, ucTicketsEmissionInstructions.Airline, mailToSend.Values, mailPassword.Values, mail, displyName.Values); } else { BuildElectronicTicketContract ws = new BuildElectronicTicketContract(); ws.SendInfoToBuilPDF(tiketsArray, virtuallyThere, ucTicketsEmissionInstructions.Airline, mailToSend.Values, mailPassword.Values, mail, displyName.Values); } } else { if (!string.IsNullOrEmpty(ucSendTicketPrinter.DK)) { GetAttribute1 attribute1 = GetAttribute1BL.GetAttribute(ucSendTicketPrinter.DK, Login.OrgId); if (attribute1.Attribute1.Equals(Resources.TicketEmission.Constants.ATTRIBUTE1_CFE100)) { BuildElectronicTicketCFEContract ws = new BuildElectronicTicketCFEContract(); ws.SendInfoToBuilPDF(tiketsArray, virtuallyThere, ucTicketsEmissionInstructions.Airline, mailToSend.Values, mailPassword.Values, mail, displyName.Values); } else { BuildElectronicTicketContract ws = new BuildElectronicTicketContract(); ws.SendInfoToBuilPDF(tiketsArray, virtuallyThere, ucTicketsEmissionInstructions.Airline, mailToSend.Values, mailPassword.Values, mail, displyName.Values); } ucSendTicketPrinter.DK = string.Empty; } else { BuildElectronicTicketContract ws = new BuildElectronicTicketContract(); ws.SendInfoToBuilPDF(tiketsArray, virtuallyThere, ucTicketsEmissionInstructions.Airline, mailToSend.Values, mailPassword.Values, mail, displyName.Values); } } } catch { } } }
void _WebServiceWorker_DoWork(object sender, DoWorkEventArgs e) { var request = (AvailabilityRequest)e.Argument; string activeFlag = ParameterBL.GetParameterValue("ActiveVolarisFlow").Values; if (!string.IsNullOrEmpty(activeFlag)) { if (activeFlag.Equals("Active") || activeFlag.Equals("All") || activeFlag.Contains(Login.Agent)) { Service = new LowFareAvailabilityService() { AvailabilityRequest = request, AvailabilityServices = new List <IAvailabilitySearchable>() { new VolarisAvailability(), new InterJetAvailability() }, DepartureServices = new List <IAvailabilitySearchable>() { new VolarisAvailability(), new InterJetAvailability() }, OnNewServiceCall = OnNewServiceCallDelegate, }; } else { Service = new LowFareAvailabilityService() { AvailabilityRequest = request, AvailabilityServices = new List <IAvailabilitySearchable>() { new InterJetAvailability() }, DepartureServices = new List <IAvailabilitySearchable>() { new InterJetAvailability() }, OnNewServiceCall = OnNewServiceCallDelegate, }; } } else { Service = new LowFareAvailabilityService() { AvailabilityRequest = request, AvailabilityServices = new List <IAvailabilitySearchable>() { new InterJetAvailability() }, DepartureServices = new List <IAvailabilitySearchable>() { new InterJetAvailability() }, OnNewServiceCall = OnNewServiceCallDelegate, }; } lock (thisLock) { var flights = Service.Call(); e.Result = flights; } }
public static bool ValidateTestingUsers(OrigenTipoCargo FaseActual) { string sFaseActual = String.Empty; switch (FaseActual) { case OrigenTipoCargo.FlujoAereo: sFaseActual = "A"; break; case OrigenTipoCargo.BajoCosto: sFaseActual = "C"; break; case OrigenTipoCargo.Independiente: sFaseActual = "B"; break; case OrigenTipoCargo.Hoteles: sFaseActual = "H"; break; case OrigenTipoCargo.Autos: sFaseActual = "D"; break; } // Si tiene marcado como all ya no valida string[] sFaseValida = ParameterBL.GetParameterValue("ActivePhaseServicesFee").Values.Split('|'); for (int i = 0; i < sFaseValida.Length; i++) { if (sFaseActual == sFaseValida[i]) { break; } if (i == sFaseValida.Length - 1) { return(false); } } if (ParameterBL.GetParameterValue("ActiveServicesFee").Values == "All") { return(true); } else { if (FaseActual == OrigenTipoCargo.BajoCosto) { DKActual = DKActualBajoCosto; } else { RecuperarDK(); } string[] sDKValido = ParameterBL.GetParameterValue("ActiveDKServicesFee").Values.Split('|'); for (int i = 0; i < sDKValido.Length; i++) { if (DKActual == sDKValido[i]) { string[] sUsuarioValido = ParameterBL.GetParameterValue("ActiveServicesFee").Values.Split('|'); for (int j = 0; j < sUsuarioValido.Length; j++) { // y si es este usuario if (ConfigurationManager.AppSettings["DatosContacto"].Split('|')[1] == sUsuarioValido[j]) { return(true); } } } } } return(false); }
public void OpenConnection() { if (this.IsConnected) { return; } try { Parameter parameterFirm = ParameterBL.GetParameterValue("FirmWS"); Parameter parameterPassword = ParameterBL.GetParameterValue("PasswordWS"); Parameter parameterPCC = ParameterBL.GetParameterValue("PCCWS"); string username = parameterFirm.Values; string password = parameterPassword.Values; string domain = "DEFAULT"; this.IPcc = parameterPCC.Values; this.ConversationId = "TestSession"; DateTime dt = DateTime.UtcNow; string tstamp = dt.ToString("s") + "Z"; serviceOpen.MessageHeader msgHeader = GetOpenMessageHeader(); serviceOpen.Security security = new serviceOpen.Security(); serviceOpen.SecurityUsernameToken securityUserToken = new serviceOpen.SecurityUsernameToken(); securityUserToken.Username = username; securityUserToken.Password = password; securityUserToken.Organization = this.IPcc; securityUserToken.Domain = domain; security.UsernameToken = securityUserToken; serviceOpen.SessionCreateRQ req = new serviceOpen.SessionCreateRQ(); serviceOpen.SessionCreateRQPOS pos = new serviceOpen.SessionCreateRQPOS(); serviceOpen.SessionCreateRQPOSSource source = new serviceOpen.SessionCreateRQPOSSource(); source.PseudoCityCode = this.IPcc; pos.Source = source; req.POS = pos; serviceOpen.SessionCreateRQService serviceObj = new serviceOpen.SessionCreateRQService(); serviceObj.MessageHeaderValue = msgHeader; serviceObj.SecurityValue = security; serviceOpen.SessionCreateRS resp = serviceObj.SessionCreateRQ(req); // Send the request if (resp.Errors != null && resp.Errors.Error != null) { string x = "Error : " + resp.Errors.Error.ErrorInfo.Message; } else { msgHeader = serviceObj.MessageHeaderValue; security = serviceObj.SecurityValue; this.ConversationId = msgHeader.ConversationId; // ConversationId to a string this.SecurityToken = security.BinarySecurityToken; // BinarySecurityToken to a string this.DateReference = DateTime.Now; this.isConnected = true; } } catch { this.isConnected = false; } }
private void btnActivation_Click(object sender, EventArgs e) { DialogResult yesNo = MessageBox.Show("¿SEGURO QUE DESEA ACTIVAR LA REGLA " + txtRuleNumber.Text + " PARA EL CORPORATIVO " + attribute1 + "?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (yesNo.Equals(DialogResult.Yes)) { ActivationFeeRuleBL.ActivationFeeRule(Convert.ToInt32(txtRuleNumber.Text)); try { List <GetMailByUser> mailAndUserList = GetMailByUserBL.GetMailAndUser(agent); string info = string.Concat("Hola ", mailAndUserList[0].FamilyName, "\n\n", "MyCTS te informa que la regla de cargo por servicio número ", txtRuleNumber.Text, " ya se encuentra activa para el corporativo ", corp, "\n\n", "Te recordamos que los criterios para su aplicación son los siguientes:", "\n\n"); info = string.Concat(info, " -", "PORCENTAJE DE LA TARIFA BASE: ".ToUpper().PadRight(35, ' '), listInformationRule[0].DefaultFee, "\n\n"); info = string.Concat(info, " -", "Cantidad Fija:".ToUpper().PadRight(35, ' '), "$", listInformationRule[0].DefaultMount.ToString("0.00"), "\n\n"); info = string.Concat(info, " -", "Monto: ".ToUpper().PadRight(35, ' '), (listInformationRule[0].Mandatory) ? "No Negociable" : "Negociable", "\n\n"); if (listInfoFeeRule[aux].StartDate != Types.DateNullValue) { info = string.Concat(info, " -", "Inicio de regla: ".ToUpper().PadRight(35, ' '), listInfoFeeRule[aux].StartDate.ToString("dd-MM-yyyy"), "\n\n"); } if (listInfoFeeRule[aux].ExpirationDate != Types.DateNullValue) { info = string.Concat(info, " -", "Fin de regla: ".ToUpper().PadRight(35, ' '), listInfoFeeRule[aux].ExpirationDate.ToString("dd-MM-yyyy"), "\n\n"); } if (!string.IsNullOrEmpty(listInformationRule[0].Value2) && !string.IsNullOrEmpty(listInformationRule[0].Target)) { for (int i = 0; i < listInformationRule.Count; i++) { info = string.Concat(info, " -", string.Concat( listInformationRule[i].Target, ": ").ToUpper().PadRight(35, ' '), listInformationRule[i].Value2, "\n\n"); } } if (listLocationDK.Count > 0) { string locationDKNotAccepted = string.Empty; for (int j = 0; j < listLocationDK.Count; j++) { locationDKNotAccepted = string.Concat(locationDKNotAccepted, listLocationDK[j].LocationDK, ", "); } locationDKNotAccepted = locationDKNotAccepted.Trim().TrimEnd(new char[] { ',' }); info = string.Concat(info, " -", "Location(DK) Excluyente:".ToUpper().PadRight(35, ' '), locationDKNotAccepted, "\n"); } info = string.Concat(info, "\n\n", "Gracias por haber creado esta regla"); Parameter mailToSend = ParameterBL.GetParameterValue("MailThatSendFeeRule"); Parameter mailPassword = ParameterBL.GetParameterValue("PasswordThatMailToSend"); Parameter displyName = ParameterBL.GetParameterValue("NameSendEmail"); MailProvider ws = new MailProvider(); ws.SendEmail2(mailToSend.Values, mailPassword.Values, displyName.Values, mailAndUserList[0].UserMail, null, "Activación de Regla Cargo por Servicio", info); } catch { } MessageBox.Show("LA REGLA " + txtRuleNumber.Text + " QUEDO ACTIVA PARA EL CORPORATIVO " + attribute1, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information); Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME); } else { btnClear.Focus(); } }
/// <summary> /// Envia comando para desplegar los numeros de boletos generados /// </summary> private void SendValidationTicketCommand() { TktNumber = new List <string>(); PaxName = new List <string>(); LinkVT = new List <string>(); sabreAnswer = string.Empty; sabreConcat = string.Empty; string emitedPCC = string.Empty; string command = Resources.TicketEmission.Constants.COMMANDS_AST_T; using (CommandsAPI objCommands = new CommandsAPI()) { sabreAnswer = objCommands.SendReceive(command); } //return; sabreConcat = sabreAnswer; SearchTKT(); sabreConcat = sabreConcat.Replace('‡', '\n'); string[] numbersOfTkt = sabreConcat.Split(new char[] { '\n' }); foreach (string tkt in numbersOfTkt) { if (tkt.Length > 30 && ValidateRegularExpression.ValidateThirteenNumbers(tkt.Substring(7, 13)) && tkt.Substring(4, 2) != "TV") { emitedPCC = recoverEmitedPCC(tkt); TktNumber.Add(tkt.Substring(7, 13)); if (tkt.Substring(20, 1) == "/") { PaxName.Add(tkt.Substring(27, 7).Trim()); } else { PaxName.Add(tkt.Substring(24, 7).Trim()); } } } sabreAnswer = string.Empty; sabreConcat = string.Empty; //********************************************************************** string recordLocalizator = ucFirstValidations.LocatorRecord; if (string.IsNullOrEmpty(recordLocalizator)) { recordLocalizator = ucTicketEmissionBuildCommand.RecordLocator; } Parameter activateTicketPrinter = ParameterBL.GetParameterValue("ActivateTicketPrinter"); if (Convert.ToBoolean(activateTicketPrinter.Values)) { List <string> listTicketsByPNR = GetTicketsByPNRBL.GetTKTByPNR(recordLocalizator); for (int j = 0; j < TktNumber.Count; j++) { if (!listTicketsByPNR.Contains(TktNumber[j].Substring(3, 10))) { listNewTickets.Add(TktNumber[j]); } } } //************************************************************************** for (int i = 0; i < TktNumber.Count; i++) { string[] names = PaxName[i].Split(new char[] { '/' }); LinkVT.Add(string.Concat("https://services.tripcase.com/new/eticketPrint.html?pnr=", recordLocalizator, "&hostID=1W&ETTOT=1&ETNBR1=", TktNumber[i], "&pcc=", emitedPCC, "&action=printEticket")); AddDetailsTktsLinksBL.AddDetailsTktsLinks(Login.Agent, recordLocalizator, TktNumber[i].Substring(3, 10), PaxName[i], LinkVT[i], DateTime.Now); } //*********************************************** if (Convert.ToBoolean(activateTicketPrinter.Values)) { GetInfoTicketDelegate(listNewTickets); } //*********************************************** }
private void toolStripButtonEinvoice_Click(object sender, EventArgs e) { string url = ParameterBL.GetParameterValue("eInvoicedButtonURL").Values; System.Diagnostics.Process.Start(url); }