private void ucGetDIX_Load(object sender, EventArgs e)
        {
            ucAvailability.IsInterJetProcess = false;
            txtPNR.Focus();
            string send        = "*A";
            string sabreAnswer = string.Empty;
            string pnr         = string.Empty;

            using (CommandsAPI objCommand = new CommandsAPI())
            {
                sabreAnswer = objCommand.SendReceive(send);
            }
            string resultAux = sabreAnswer.Replace("‡", "\n");

            string[] sabreAnswerInfo = resultAux.Split(new char[] { '\n' });
            int      row             = 0;
            int      col             = 0;

            CommandsQik.searchResponse(sabreAnswer, "NO DATA", ref row, ref col);
            if (row != 0 && col >= 0)
            {
                MessageBox.Show("NO EXISTE RECORD PRESENTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }

            else if (sabreAnswerInfo.Length > 0 && sabreAnswerInfo[0].Length == 6 && ValidateRegularExpression.ValidatePNR(sabreAnswerInfo[0]))
            {
                CommandsAPI2.send_MessageToEmulator("CTP EDITS IN PROGRESS....PLEASE WAIT....\n" +
                                                    "OK " + sabreAnswerInfo[0] + "\nEXPORT I AND I IN PROGRESS");
                txtPNR.Text = sabreAnswerInfo[0];
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive("I", 0, 0);
                }
                GetInformationDIX();
            }
            else
            {
                MessageBox.Show("IGNORE Y RECUPERE EL RECORD", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
        }
        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);
        }
Ejemplo n.º 3
0
        private void CommandsER()
        {
            send = Resources.Constants.COMMANDS_ER;
            using (CommandsAPI objCommand = new CommandsAPI())
            {
                result = objCommand.SendReceive(send);
            }
            string resultAux = result.Replace("‡", "\n");

            string[] sabreAnswerInfo = resultAux.Split(new char[] { '\n' });
            if (sabreAnswerInfo.Length > 0 && sabreAnswerInfo[0].Length == 6 && ValidateRegularExpression.ValidatePNR(sabreAnswerInfo[0]))
            {
                GetValuesWebServices(sabreAnswerInfo[0]);
            }
            APIResponseER();
            if (!errorER)
            {
                using (CommandsAPI objCommand = new CommandsAPI())
                {
                    objCommand.SendReceive(Resources.Constants.COMMANDS_AST_P6);
                }
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
        }
        /// <summary>
        /// Regenera el boleto cuando no fue encontrado en la BD
        /// </summary>
        private void RegenarateInvoice()
        {
            string        ticket         = string.Empty;
            string        paxName        = string.Empty;
            string        linkVT         = string.Empty;
            List <string> listNewTickets = null;
            string        emitedPCC      = string.Empty;

            sabreAnswer = string.Empty;
            sabreConcat = string.Empty;
            string command = string.Concat("*TKT", txtNumberTicket.Text.Substring(3, 10));

            using (CommandsAPI objCommands = new CommandsAPI())
            {
                sabreAnswer = objCommands.SendReceive(command);
            }
            string[] sabreAnswerInfo = sabreAnswer.Split(new char[] { '\n' });
            int      row             = 0;
            int      col             = 0;

            CommandsQik.searchResponse(sabreAnswer, "UNABLE TO FIND TICKET NUMBER", ref row, ref col);
            if (row != 0 && col >= 0)
            {
                MessageBox.Show("EL NÚMERO DE BOLETO NO FUE ENCONTRADO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
            else if (sabreAnswerInfo.Length > 0 && sabreAnswerInfo[0].Length == 6 && ValidateRegularExpression.ValidatePNR(sabreAnswerInfo[0]))
            {
                command = "*T";
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    sabreAnswer = objCommands.SendReceive(command);
                }
                sabreConcat = sabreAnswer;
                SearchTKT();

                command = "*PDK";
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    sabreAnswer = objCommands.SendReceive(command);
                }
                DK = sabreAnswer.Substring(18, 6);
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    objCommands.SendReceive("I");
                }
                sabreConcat = sabreConcat.Replace('‡', '\n');
                string[] numbersOfTkt = sabreConcat.Split(new char[] { '\n' });
                foreach (string tkt in numbersOfTkt)
                {
                    emitedPCC = recoverEmitedPCC(tkt);
                    int index = tkt.IndexOf(txtNumberTicket.Text);
                    if (index >= 0)
                    {
                        if (tkt.Length > 30 &&
                            ValidateRegularExpression.ValidateThirteenNumbers(tkt.Substring(index, 13)) &&
                            !tkt.Contains("TV")
                            )
                        //&& tkt.Substring(index, 13) == txtNumberTicket.Text)
                        {
                            ticket = tkt.Substring(index, 13);
                            string   value = tkt.Substring(index, tkt.Length - index);
                            string[] data  = value.Split(new char[] { ' ' });

                            if (data[1].Contains("/"))
                            {
                                paxName = data[1];
                                // else
                                //    paxName = tkt.Substring(24, 7).Trim();
                            }
                            else
                            {
                                paxName = string.Format("{0} {1}", data[1], data[2]);
                            }
                            break;
                        }
                    }
                }
                if (!string.IsNullOrEmpty(ticket) && !string.IsNullOrEmpty(paxName))
                {
                    string airline = GetAirlineCodeByNumIDBL.GetAirlineCode(ticket.Substring(0, 3));
                    if (string.IsNullOrEmpty(airline) || airline.Equals("NOTHING"))
                    {
                        MessageBox.Show("ERROR EN CÓDIGO DE AEROLÍNEA, FAVOR DE REPORTARLO A SISTEMAS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                    }
                    else
                    {
                        string[] names = paxName.Split(new char[] { '/' });
                        linkVT = string.Concat("https://services.tripcase.com/new/eticketPrint.html?pnr=", sabreAnswerInfo[0], "&hostID=1W&ETTOT=1&ETNBR1=", ticket, "&pcc=", emitedPCC, "&action=printEticket");

                        //linkVT = string.Concat("https://www.virtuallythere.com/new/eTicketReceiptPrint.html?pnr=", sabreAnswerInfo[0], "&pcc=3L64&language=1&name=",
                        //    names[0], "&host=1W&agent=AFM&ETNBR1=", ticket, "&ETNME1=", names[0], "/", names[1].Substring(0, 1), " &ETDTE1=4DEC&ETISS1=3L64*AJV&ETTOT=1");
                        if (addTicketInBD)
                        {
                            AddDetailsTktsLinksBL.AddDetailsTktsLinks(Login.Agent, sabreAnswerInfo[0], ticket.Substring(3, 10), paxName, linkVT, DateTime.Now);
                        }
                        ucTicketsEmissionInstructions.Airline = airline;
                        listNewTickets = new List <string>();
                        listNewTickets.Add(txtNumberTicket.Text);
                        if (!string.IsNullOrEmpty(txtCCMail.Text))
                        {
                            tempccmail = txtCCMail.Text.ToLower();
                        }
                        GetInfoTicketDelegate(listNewTickets);
                        MessageBox.Show("SU SOLICITUD FUE ENVIADA CON ÉXITO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                    }
                }
                else
                {
                    MessageBox.Show("EL BOLETO NO PUDO SER ENCONTRADO, FAVOR DE REPORTARLO A SISTEMAS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                }
            }
            else
            {
                MessageBox.Show("NO SE PUEDE ACCESAR AL NÚMERO DE BOLETO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
        }
        private void OnRecordCompleted(object sender, OnRecordCompletedEventArgs e)
        {
            if (VolarisSession.IsVolarisProcess)
            {
                var reservation = (VolarisReservation)this.Parameter;//preguntar a Luis
                VolarisSession.ReservationStatus            = VolarisReservationStatus.Accepted;
                ucServicesFeePayApply.PNRBajoCostoAerolinea = VolarisSession.PNR;
                ucServicesFeePayApply.PNRBajoCostoSabre     = String.Empty;
                ChargesPerService.DKActualBajoCosto         = VolarisSession.DK;
                ucServicesFeePayApply.OrigenTipo            = ChargesPerService.OrigenTipoCargo.BajoCosto;

                if (!string.IsNullOrEmpty(e.SabrePnr) && e.SabrePnr.Length == 6 && ValidateRegularExpression.ValidatePNR(e.SabrePnr))
                {
                    LogTicketsBL.LogTicketsVolarisUpdate(VolarisSession.PNR, e.SabrePnr);
                    VolarisSession.PNRSabre = e.SabrePnr;
                    ucServicesFeePayApply.PNRBajoCostoSabre = e.SabrePnr;
                    //quitar
                    ImpuestosBajoCostoBL.UpdateImpuestosBajoCosto(ImpuestosBajoCosto.Id, ImpuestosBajoCosto.ImpuestosObtenidos, VolarisSession.PNR, ImpuestosBajoCosto.ImpuestosMostrados, ImpuestosBajoCosto.LineaContable, VolarisSession.PNRSabre);

                    var mailer = new VolarisMailer
                    {
                        Reservation = reservation
                    };
                    mailer.SendTest();
                    if (e.IsInvoiced)
                    {
                        VolarisSession.ReservationStatus = VolarisReservationStatus.Invoiced;
                        VolarisLogger.UpdateReservation(VolarisSession.PNR,
                                                        VolarisSession.PNRSabre, VolarisSession.ReservationStatus);
                        ucServicesFeePayApply.OrigenTipo = ChargesPerService.OrigenTipoCargo.BajoCosto;
                        ucServicesFeePayApply pago = new ucServicesFeePayApply();
                        pago.PayServiceFee();
                        Loader.AddToPanelWithParameters(Loader.Zone.Middle, this, "ucEndRecordSuccess",
                                                        null);
                    }
                }
                else
                {
                    MessageBox.Show("No ha sido posible generar la factura para el servicio aéreo,\n por tal motivo los cargos por servicio en linea\n no pudieron ser completados", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            if (IsInterJet)
            {
                ucServicesFeePayApply.PNRBajoCostoAerolinea = InterJetTicket.RecordLocator;
                ucServicesFeePayApply.PNRBajoCostoSabre     = String.Empty;
                ucServicesFeePayApply.OrigenTipo            = ChargesPerService.OrigenTipoCargo.BajoCosto;

                if (!string.IsNullOrEmpty(e.SabrePnr) && e.SabrePnr.Length == 6 && ValidateRegularExpression.ValidatePNR(e.SabrePnr))
                {
                    //quitar
                    ImpuestosBajoCostoBL.UpdateImpuestosBajoCosto(ImpuestosBajoCosto.Id, ImpuestosBajoCosto.ImpuestosObtenidos, ImpuestosBajoCosto.PNRBajoCosto, ImpuestosBajoCosto.ImpuestosMostrados, ImpuestosBajoCosto.LineaContable, e.SabrePnr);

                    LogTicketsBL.LogTicketsInterjetUpdate(InterJetTicket.RecordLocator, e.SabrePnr);

                    InterJetTicket.RecordSabre = e.SabrePnr;
                    ucServicesFeePayApply.PNRBajoCostoSabre = e.SabrePnr;
                    var mailer = new InterJetMailer {
                        Ticket = InterJetTicket
                    };
                    mailer.SendConfirmationMail();
                    if (e.IsInvoiced)
                    {
                        InterJetTicket.IsFactured = e.IsInvoiced;
                        var service = new LogInterJetBL();
                        service.InvoiceRecord(InterJetTicket.RecordLocator);
                        MyCTS.Presentation.Reservations.Availability.ChargeOfServiceLowFare.AssignamentChargeOfService.ucChargeOfServiceAssign.sPNR = InterJetTicket.RecordLocator;
                        service.InsertSabreRecord(InterJetTicket.RecordLocator, InterJetTicket.RecordSabre);
                        ucMenuReservations.EnabledMenu   = true;
                        ucServicesFeePayApply.OrigenTipo = ChargesPerService.OrigenTipoCargo.BajoCosto;
                        ucServicesFeePayApply pago = new ucServicesFeePayApply();
                        pago.PayServiceFee();
                        Loader.AddToPanelWithParameters(Loader.Zone.Middle, this, "ucEndRecordSuccess",
                                                        null);
                    }
                }
                else
                {
                    MessageBox.Show("No ha sido posible generar la factura para el servicio aéreo,\n por tal motivo los cargos por servicio en linea\n no pudieron ser completados", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

            this.errrorMessageContainer.Visible = e.Success;
            this.errorMessage.Text         = e.Message;
            ucMenuReservations.EnabledMenu = true;
            this._group.Visible            = true;
            this.loadingControl1.Visible   = false;
        }
Ejemplo n.º 6
0
 private void APIResponseER()
 {
     if ((!string.IsNullOrEmpty(result)))
     {
         ERR_ConcludeReservation.err_concludereservation(result);
         if (ERR_ConcludeReservation.Status)
         {
             if (!string.IsNullOrEmpty(ERR_ConcludeReservation.CustomUserMsg))
             {
                 errorER = true;
                 MessageBox.Show(ERR_ConcludeReservation.CustomUserMsg, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
             }
         }
         else if (ERR_ConcludeReservation.StatusDKNull)
         {
             errorER = true;
             Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCDKCLIENT);
         }
         else if (ERR_ConcludeReservation.Command)
         {
             errorER = false;
             using (CommandsAPI objCommand = new CommandsAPI())
             {
                 result = objCommand.SendReceive(Resources.Constants.COMMANDS_N_AST_NM, 0, 1);
             }
             send = Resources.Constants.COMMANDS_ER;
             using (CommandsAPI objCommand = new CommandsAPI())
             {
                 result = objCommand.SendReceive(send);
             }
             string   resultAux       = result.Replace("‡", "\n");
             string[] sabreAnswerInfo = resultAux.Split(new char[] { '\n' });
             if (sabreAnswerInfo.Length > 0 && sabreAnswerInfo[0].Length == 6 && ValidateRegularExpression.ValidatePNR(sabreAnswerInfo[0]))
             {
                 GetValuesWebServices(sabreAnswerInfo[0]);
             }
         }
         else if (ERR_ConcludeReservation.CommandF)
         {
             errorER = false;
             using (CommandsAPI objCommand = new CommandsAPI())
             {
                 objCommand.SendReceive(Resources.Constants.COMMANDS_F);
                 objCommand.SendReceive(Resources.Constants.COMMANDS_ER);
             }
         }
         else
         {
             errorER = false;
         }
     }
 }
        public void PayServiceFee()
        {
            frmPreloading frm2 = new frmPreloading(this);

            frm2.Show();
            List <ListaFiltrada> lstListaFiltrada = new List <ListaFiltrada>();

            UsuarioValidoParaCargosPorServicio = ChargesPerService.ValidateTestingUsers(OrigenTipo);
            if ((OrigenTipo != ChargesPerService.OrigenTipoCargo.Independiente) && !UsuarioValidoParaCargosPorServicio)
            {
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
            else
            {
                if (OrigenTipo == ChargesPerService.OrigenTipoCargo.BajoCosto)
                {
                    if (String.IsNullOrEmpty(PNRBajoCostoSabre))
                    {
                        MessageBox.Show("No ha sido posible generar la factura para el servicio aéreo,\n por tal motivo los cargos por servicio en linea\n no pudieron ser completados", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    else
                    {
                        using (CommandsAPI objCommand = new CommandsAPI())
                        {
                            string sabreAnswer = objCommand.SendReceive("*" + PNRBajoCostoSabre);
                        }
                        recLoc = PNRBajoCostoSabre;
                    }
                }
                else if (OrigenTipo == ChargesPerService.OrigenTipoCargo.Hoteles || OrigenTipo == ChargesPerService.OrigenTipoCargo.Autos)
                {
                    TransaccionesRespuestasEntities Respuesta = new TransaccionesRespuestasEntities();
                    PagarHotel(ref lstListaFiltrada, ref Respuesta);
                    using (CommandsAPI objCommand = new CommandsAPI())
                    {
                        objCommand.SendReceive(ChargesPerService.PreguntasASabre.VERIFICAR_RESERVA);
                    }
                }
                else
                {
                    RecuperarPNR();
                }

                if (tarjeta != null)
                {
                    lstDatosTarjeta.Add(tarjeta);
                }

                if (!string.IsNullOrEmpty(recLoc) && recLoc.Length == 6 && ValidateRegularExpression.ValidatePNR(recLoc) &&
                    OrigenTipo != ChargesPerService.OrigenTipoCargo.Hoteles && OrigenTipo != ChargesPerService.OrigenTipoCargo.Autos)
                {
                    FlujoPagos();
                }

                lstListaFiltrada = FiltrarLista(lstDatosTarjeta);
                if (!string.IsNullOrEmpty(recLoc) && recLoc.Length == 6 && ValidateRegularExpression.ValidatePNR(recLoc) &&
                    OrigenTipo != ChargesPerService.OrigenTipoCargo.Hoteles && OrigenTipo != ChargesPerService.OrigenTipoCargo.Autos)
                {
                    MandarDin(lstListaFiltrada);
                }
            }
        }