private void btnAccept_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtNumberTicket.Text))
     {
         MessageBox.Show("INGRESE EL NÚMERO DE BOLETO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtNumberTicket.Focus();
     }
     else if (!string.IsNullOrEmpty(txtNumberTicket.Text) && txtNumberTicket.TextLength != 13)
     {
         MessageBox.Show("EL NÚMERO DE BOLETO DEBE SER DE 13 DIGITOS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtNumberTicket.Focus();
     }
     else if (!string.IsNullOrEmpty(txtCCMail.Text) && !ValidateRegularExpression.ValidateEmailFormat(txtCCMail.Text))
     {
         MessageBox.Show("EL FORMATO DE CORREO ELECTRÓNICO ES INCORRECTO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtCCMail.Focus();
     }
     else
     {
         List <GetLinkByTkt> ticketList = new List <GetLinkByTkt>();
         ticketList = GetLinkByTktBL.GetLinkByTkt(txtNumberTicket.Text.Substring(3, 10), Login.OrgId);
         if (ticketList.Count > 0)
         {
             if (!string.IsNullOrEmpty(ticketList[0].LinkPassengerReceipt) && !string.IsNullOrEmpty(ticketList[0].LinkTicketPrinter))
             {
                 SendPDFDelgate(txtNumberTicket.Text, ticketList[0].LinkVirtuallyThere, txtCCMail.Text.ToLower());
                 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
             {
                 addTicketInBD = false;
                 try
                 {
                     RegenarateInvoice();
                 }
                 catch
                 {
                     MessageBox.Show("HA OCURRIDO UN ERROR EN LA REGENERACIÓN DEL BOLETO, FAVOR DE REPORTARLO A SISTEMAS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                     Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
                 }
             }
         }
         else
         {
             addTicketInBD = true;
             try
             {
                 RegenarateInvoice();
             }
             catch
             {
                 MessageBox.Show("HA OCURRIDO UN ERROR EN LA REGENERACIÓN DEL BOLETO, FAVOR DE REPORTARLO A SISTEMAS", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
             }
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Se validan que existan los datos que son obligatorios y que
 /// sean los datos correctos
 /// </summary>
 private void ValidateBusinessRulesForNumberFlight()
 {
     validatebusinessrules = false;
     if (string.IsNullOrEmpty(txtDataExit.Text))
     {
         MessageBox.Show(Resources.Reservations.INGRESA_FECHA_SALIDA_VUELO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtDataExit.Focus();
     }
     else if (string.IsNullOrEmpty(txtCity.Text))
     {
         MessageBox.Show(Resources.Reservations.INGRESA_CÓDIGO_CIUDAD, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtCity.Focus();
     }
     else if (txtCity.Text.Length <= 2)
     {
         MessageBox.Show(Resources.Reservations.CIUDAD_DEBE_TENER_3_CARAC, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtCity.Focus();
     }
     else if (string.IsNullOrEmpty(txtAeroline.Text))
     {
         MessageBox.Show(Resources.Reservations.INGRESA_CÓDIGO_AEROLÍNEA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtAeroline.Focus();
     }
     else if (txtAeroline.Text.Length <= 1)
     {
         MessageBox.Show(Resources.Reservations.CÓDIGO_AEROLÍNEA_DEBE_TENER_2_DÍG, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtAeroline.Focus();
     }
     else if (string.IsNullOrEmpty(txtNumberFlight.Text))
     {
         MessageBox.Show(Resources.Reservations.INGRESA_NÚEMRO_VUELO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtNumberFlight.Focus();
     }
     else if (string.IsNullOrEmpty(txtLastName1.Text))
     {
         MessageBox.Show(Resources.Reservations.INGRESE_APELLIDO_PASAJERO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtLastName1.Focus();
     }
     else if (!ValidateRegularExpression.ValidateDateFormat(txtDataExit.Text))
     {
         MessageBox.Show(Resources.Reservations.FORMAT_FECHA_DOS_NUM_TRES_ALFA, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtDataExit.Focus();
     }
     else if (statusDate)
     {
         MessageBox.Show(Resources.Reservations.FECHA_SELEC_MENOR_ACTUAL, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtDataExit.Focus();
     }
     else
     {
         validatebusinessrules = true;
     }
 }
 /// <summary>
 /// Evalua las reglas del negocio aplicadas para este user control
 /// (evitando invocación de metodos sin envio de parametros)
 /// </summary>
 private bool isValidBussinesRules()
 {
     isValid = false;
     if ((string.IsNullOrEmpty(txtName1.Text)) &&
         (string.IsNullOrEmpty(txtName2.Text)) &&
         (string.IsNullOrEmpty(txtName3.Text)) &&
         (string.IsNullOrEmpty(txtName4.Text)))
     {
         MessageBox.Show(Resources.TicketEmission.Tickets.ING_AL_MENOS_UN_NOMBRE, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtName1.Focus();
     }
     else if (((string.IsNullOrEmpty(txtName1.Text)) &&
               ((!string.IsNullOrEmpty(txtName2.Text)) ||
                (!string.IsNullOrEmpty(txtName3.Text)) ||
                (!string.IsNullOrEmpty(txtName4.Text)))))
     {
         MessageBox.Show(Resources.TicketEmission.Tickets.DEBES_ING_PRIMER_NOMBRE_PARA_ING_OTRO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtName1.Focus();
     }
     else if ((!string.IsNullOrEmpty(txtName1.Text) && (!ValidateRegularExpression.ValidateOneorTwoPlusDecimalNumber(txtName1.Text))))
     {
         MessageBox.Show(Resources.TicketEmission.Tickets.FORMATO_POSICION_NOMBRE_INCORRECTO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtName1.Focus();
     }
     else if ((!string.IsNullOrEmpty(txtName2.Text) && (!ValidateRegularExpression.ValidateOneorTwoPlusDecimalNumber(txtName2.Text))))
     {
         MessageBox.Show(Resources.TicketEmission.Tickets.FORMATO_POSICION_NOMBRE_INCORRECTO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtName2.Focus();
     }
     else if ((!string.IsNullOrEmpty(txtName3.Text) && (!ValidateRegularExpression.ValidateOneorTwoPlusDecimalNumber(txtName3.Text))))
     {
         MessageBox.Show(Resources.TicketEmission.Tickets.FORMATO_POSICION_NOMBRE_INCORRECTO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtName3.Focus();
     }
     else if ((!string.IsNullOrEmpty(txtName4.Text) && (!ValidateRegularExpression.ValidateOneorTwoPlusDecimalNumber(txtName4.Text))))
     {
         MessageBox.Show(Resources.TicketEmission.Tickets.FORMATO_POSICION_NOMBRE_INCORRECTO, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtName4.Focus();
     }
     else
     {
         isValid = true;
     }
     return(isValid);
 }
        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);
            }
        }
        private bool validBussinesRules()
        {
            bool isValid = false;

            if ((!string.IsNullOrEmpty(txtMount1.Text) && (!ValidateRegularExpression.ValidateTwoDecimals(txtMount1.Text))))
            {
                MessageBox.Show("EL MONTO DEBE INCLUIR DOS DECIMALES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMount1.Focus();
            }
            else if ((!string.IsNullOrEmpty(txtMount2.Text) && (!ValidateRegularExpression.ValidateTwoDecimals(txtMount2.Text))))
            {
                MessageBox.Show("EL MONTO DEBE INCLUIR DOS DECIMALES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMount2.Focus();
            }
            else if ((!string.IsNullOrEmpty(txtMount3.Text) && (!ValidateRegularExpression.ValidateTwoDecimals(txtMount3.Text))))
            {
                MessageBox.Show("EL MONTO DEBE INCLUIR DOS DECIMALES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMount3.Focus();
            }
            else if ((!string.IsNullOrEmpty(txtMount4.Text) && (!ValidateRegularExpression.ValidateTwoDecimals(txtMount4.Text))))
            {
                MessageBox.Show("EL MONTO DEBE INCLUIR DOS DECIMALES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMount4.Focus();
            }
            else if ((!string.IsNullOrEmpty(txtMount5.Text) && (!ValidateRegularExpression.ValidateTwoDecimals(txtMount5.Text))))
            {
                MessageBox.Show("EL MONTO DEBE INCLUIR DOS DECIMALES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMount5.Focus();
            }
            else if ((!string.IsNullOrEmpty(txtMount6.Text) && (!ValidateRegularExpression.ValidateTwoDecimals(txtMount6.Text))))
            {
                MessageBox.Show("EL MONTO DEBE INCLUIR DOS DECIMALES", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtMount6.Focus();
            }
            else
            {
                isValid = true;
            }

            return(isValid);
        }
        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);
        }
Пример #7
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>
        /// 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);
            }
            //***********************************************
        }
Пример #9
0
        /// <summary>
        /// Copia la dirección que contiene el remark
        /// en las cajas te texto
        /// </summary>
        private void CopyAdress()
        {
            int row    = 0;
            int col    = 0;
            int numext = 0;
            int numint = 0;
            int delega = 0;

            string socialreason = string.Empty;
            string adress       = string.Empty;
            int    adresslenght = 0;
            string street       = string.Empty;
            string numberext    = string.Empty;
            string numberint    = string.Empty;
            string colony       = string.Empty;

            string native       = string.Empty;
            int    nativelenght = 0;
            string delegation   = string.Empty;
            string city         = string.Empty;
            string state        = string.Empty;

            string cp = string.Empty;

            string rfc1 = string.Empty;
            string rfc2 = string.Empty;
            string rfc3 = string.Empty;

            CommandsQik.CopyResponse(result, ref socialreason, 2, 6, 55);
            socialreason = socialreason.Trim();
            CommandsQik.CopyResponse(result, ref adress, 3, 6, 64);
            adress = adress.Trim();

            CommandsQik.searchResponse(adress, "*", ref row, ref col);
            if (row != 0 || col != 0)
            {
                CommandsQik.CopyResponse(adress, ref street, row, 1, col);
                numext       = col;
                adresslenght = ((adress.Length) - (col + 1));
                adress       = adress.Substring((col + 1), adresslenght);
                row          = 0;
                col          = 0;
            }
            if (!string.IsNullOrEmpty(street))
            {
                CommandsQik.searchResponse(adress, "*", ref row, ref col);
                if (col > 0)
                {
                    CommandsQik.CopyResponse(adress, ref numberext, row, 1, col);
                    numint = col;
                    col    = 0;
                    row    = 0;
                }

                CommandsQik.searchResponse(adress, ",", ref row, ref col, 1, 1, numint + 2, 64);
                if (col > 0)
                {
                    if (numint > 0)
                    {
                        CommandsQik.CopyResponse(adress, ref numberint, row, numint + 2, (col - (numint + 1)));
                    }
                    else
                    {
                        CommandsQik.CopyResponse(adress, ref numberext, row, 1, col);
                    }

                    CommandsQik.CopyResponse(adress, ref colony, row, col + 2, 30);
                    colony = colony.Trim();
                }
            }
            else
            {
                adresslenght = adress.Length;
                street       = adress.Substring(0, adresslenght);
            }
            col = 0;
            row = 0;
            CommandsQik.CopyResponse(result, ref native, 4, 6, 55);
            native = native.Trim();
            CommandsQik.searchResponse(native, ",", ref row, ref col);
            if (row != 0 || col != 0)
            {
                CommandsQik.CopyResponse(native, ref delegation, row, 1, col);
                nativelenght = (native.Length - (col + 1));
                native       = native.Substring((col + 1), nativelenght);
                delega       = col;
                row          = 0;
                col          = 0;
                CommandsQik.searchResponse(native, ",", ref row, ref col);
                if (col > 0)
                {
                    CommandsQik.CopyResponse(native, ref city, row, 1, col);
                    CommandsQik.CopyResponse(native, ref state, row, col + 2, 18);
                    state = state.Trim();
                }
            }
            else
            {
                nativelenght = native.Length;
                delegation   = native.Substring(0, nativelenght);
            }
            CommandsQik.CopyResponse(result, ref cp, 5, 6, 6);
            cp = cp.Replace('*', ' ').Trim();
            CommandsQik.CopyResponse(result, ref rfc1, 6, 6, 4);
            CommandsQik.CopyResponse(result, ref rfc2, 6, 10, 6);
            rfc2 = rfc2.Trim();
            CommandsQik.CopyResponse(result, ref rfc3, 6, 16, 3);

            if (socialreason.Length > 55)
            {
                socialreason = socialreason.Remove(55);
            }
            if (street.Length > 21)
            {
                street = street.Remove(21);
            }
            if (numberext.Length > 5)
            {
                numberext = numberext.Remove(5);
            }
            if (numberint.Length > 5)
            {
                numberint = numberint.Remove(5);
            }
            if (colony.Length > 30)
            {
                colony = colony.Remove(30);
            }
            if (delegation.Length > 15)
            {
                delegation = delegation.Remove(15);
            }
            if (cp.Length > 6)
            {
                cp = cp.Remove(6);
            }
            if (city.Length > 20)
            {
                city = city.Remove(20);
            }
            if (state.Length > 18)
            {
                state = state.Remove(18);
            }
            if (rfc1.Length > 4)
            {
                rfc1 = rfc1.Remove(4);
            }
            if (rfc2.Length > 6)
            {
                rfc2 = rfc2.Remove(6);
            }
            if (rfc3.Length > 3)
            {
                rfc3 = rfc3.Remove(3);
            }

            string rfcComplete = rfc1 + rfc2 + rfc3;

            if (rfcComplete.Length == 12)
            {
                rfc1 = rfcComplete.Substring(0, 3);
                rfc2 = rfcComplete.Substring(3, 6);
                rfc3 = rfcComplete.Substring(9, 3);
            }
            else if (rfcComplete.Length == 13)
            {
                rfc1 = rfcComplete.Substring(0, 4);
                rfc2 = rfcComplete.Substring(4, 6);
                rfc3 = rfcComplete.Substring(10, 3);
            }

            if (ValidateRegularExpression.ValidateCharacter(socialreason))
            {
                txtSocialReason.Text = socialreason;
            }
            if (ValidateRegularExpression.ValidateCharacter(street))
            {
                txtStreet.Text = street;
            }
            if (ValidateRegularExpression.ValidateCharacter(numberint))
            {
                txtNumberInt.Text = numberint;
            }
            if (ValidateRegularExpression.ValidateCharacter(numberext))
            {
                txtNumberExt.Text = numberext;
            }
            if (ValidateRegularExpression.ValidateCharacter(colony))
            {
                txtColony.Text = colony;
            }
            if (ValidateRegularExpression.ValidateCharacter(city))
            {
                txtCity.Text = city;
            }
            if (ValidateRegularExpression.ValidateCharacter(state))
            {
                txtState.Text = state;
            }
            if (ValidateRegularExpression.ValidateCharacter(delegation))
            {
                txtDelegation.Text = delegation;
            }
            if (ValidateRegularExpression.ValidateNumbers(cp))
            {
                txtCP.Text = cp;
            }
            if (ValidateRegularExpression.ValidateNumberandLetters(rfc1))
            {
                txtRFC1.Text = rfc1;
            }
            if (ValidateRegularExpression.ValidateNumberandLetters(rfc2))
            {
                txtRFC2.Text = rfc2;
            }
            if (ValidateRegularExpression.ValidateNumberandLetters(rfc3))
            {
                txtRFC3.Text = rfc3;
            }
        }
        /// <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;
        }
Пример #12
0
        /// <summary>
        /// Esta función lo que hace es extraer una fecha
        /// se manda un comando primero y busca la fecha en ERR__BoletageDateAndReceived,
        /// sino la encuentra,se manda otro comando distinto igual se busca la fecha,
        /// sino la vuelve a encontrar se manda un tercer comando y vuelve a buscar
        /// la fecha si en esta no la vuelva a encontrar, se termina la busqueda y el
        /// textbox de fecha se queda en blanco.
        /// </summary>
        private void LookNewDate()
        {
            string   date;
            string   dateinitial;
            string   dateoptional;
            string   dates_Suitable;
            string   date_compare;
            int      datefinal;
            int      chagedate;
            DateTime today = DateTime.Today;

            using (CommandsAPI objCommands = new CommandsAPI())
            {
                result = objCommands.SendReceive(Resources.Constants.COMMANDS_AST_PQ);
                PQ     = true;
            }
            ERR__BoletageDateAndReceived.err_boletagedataandreceived(result);
            PQ = false;
            if (ERR__BoletageDateAndReceived.Status)
            {
                date = ERR__BoletageDateAndReceived.Fecha;
                if (ValidateRegularExpression.ValidateDateFormat(date))
                {
                    dateinitial  = (date.Substring(0, 2));
                    dateoptional = (date.Substring(2, 3));
                    datefinal    = Convert.ToInt32(dateinitial);
                    chagedate    = datefinal - 2;
                    if (chagedate == 00)
                    {
                        chagedate = 2;
                    }
                    if (chagedate == -1)
                    {
                        chagedate = 1;
                    }
                    dates_Suitable = chagedate + dateoptional;
                    if (dates_Suitable.Length < 5)
                    {
                        date_compare = Resources.Constants.ZERO + dates_Suitable;
                    }
                    else
                    {
                        date_compare = dates_Suitable;
                    }
                    if (Convert.ToDateTime(date_compare) >= today)
                    {
                        txtDateSelected.Text = date_compare;
                    }
                    else
                    {
                        txtDateSelected.Text = dateinitial + dateoptional;
                    }
                }
            }
            else
            {
                using (CommandsAPI objCommands = new CommandsAPI())
                {
                    result = objCommands.SendReceive(Resources.Constants.COMMANDS_WP);
                    WP     = true;
                }
                ERR__BoletageDateAndReceived.err_boletagedataandreceived(result);
                WP = false;
                ERR__BoletageDateAndReceived.IA = false;
                if (ERR__BoletageDateAndReceived.Status)
                {
                    date = ERR__BoletageDateAndReceived.Fecha;
                    if (ValidateRegularExpression.ValidateDateFormat(date))
                    {
                        dateinitial  = (date.Substring(0, 2));
                        dateoptional = (date.Substring(2, 3));
                        datefinal    = Convert.ToInt32(dateinitial);
                        chagedate    = datefinal - 2;
                        if (chagedate == 00)
                        {
                            chagedate = 2;
                        }
                        if (chagedate == -1)
                        {
                            chagedate = 1;
                        }
                        dates_Suitable = chagedate + dateoptional;
                        if (dates_Suitable.Length < 5)
                        {
                            date_compare = Resources.Constants.ZERO + dates_Suitable;
                        }
                        else
                        {
                            date_compare = dates_Suitable;
                        }
                        if (Convert.ToDateTime(date_compare) >= today)
                        {
                            txtDateSelected.Text = date_compare;
                        }
                        else
                        {
                            txtDateSelected.Text = dateinitial + dateoptional;
                        }
                    }
                }
                else
                {
                    using (CommandsAPI objCommands = new CommandsAPI())
                    {
                        result = objCommands.SendReceive(Resources.Constants.COMMANDS_AST_IA);
                    }
                    ERR__BoletageDateAndReceived.err_boletagedataandreceived(result);
                    if (ERR__BoletageDateAndReceived.IA)
                    {
                        date = ERR__BoletageDateAndReceived.Fecha;
                        if (ValidateRegularExpression.ValidateDateFormat(date))
                        {
                            dateinitial  = (date.Substring(0, 2));
                            dateoptional = (date.Substring(2, 3));
                            datefinal    = Convert.ToInt32(dateinitial);
                            chagedate    = datefinal - 2;
                            if (chagedate == 00)
                            {
                                chagedate = 2;
                            }
                            if (chagedate == -1)
                            {
                                chagedate = 1;
                            }
                            dates_Suitable = chagedate + dateoptional;
                            if (dates_Suitable.Length < 5)
                            {
                                date_compare = Resources.Constants.ZERO + dates_Suitable;
                            }
                            else
                            {
                                date_compare = dates_Suitable;
                            }
                            if (Convert.ToDateTime(date_compare) >= today)
                            {
                                txtDateSelected.Text = date_compare;
                            }
                            else
                            {
                                txtDateSelected.Text = dateinitial + dateoptional;
                            }
                        }
                    }
                }
            }
        }
Пример #13
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;
         }
     }
 }
Пример #14
0
        /// <summary>
        /// Carga informacion a la mascarilla por Location si falla el metodo principal
        /// </summary>
        private Boolean ExistLoadLocationInfoBackup()
        {
            string send     = "*PDK";
            string res      = string.Empty;
            string location = string.Empty;

            using (CommandsAPI objCommand = new CommandsAPI())
            {
                res = objCommand.SendReceive(send);
            }
            if (res.Trim() != "‡NO PSGR DATA‡")
            {
                location = res.Substring(18, 6);
            }
            MyCTS.Entities.Cat1stStarInfoByLocation starFirstInfoByLocation = Cat1stStarInfoByLocationBL.Get1stStarInfoByLocation(location);
            if (starFirstInfoByLocation != null)
            {
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.CustomerName))
                {
                    string customer = starFirstInfoByLocation.CustomerName.ToString();
                    customer             = customer.Replace("(", "");
                    customer             = customer.Replace(")", "");
                    txtSocialReason.Text = customer.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address1))
                {
                    txtStreet.Text = starFirstInfoByLocation.Address1.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address2))
                {
                    starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.Replace("#", "");
                    starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.TrimStart();

                    txtNumberExt.Text = starFirstInfoByLocation.Address2.Replace(',', ' ');
                }
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address3))
                {
                    starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.Replace("#", "");
                    starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.TrimStart();
                    txtNumberInt.Text = starFirstInfoByLocation.Address3;
                }
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address4))
                {
                    txtColony.Text = starFirstInfoByLocation.Address4.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Municipality))
                {
                    txtDelegation.Text = starFirstInfoByLocation.Municipality.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.PostalCode))
                {
                    txtCP.Text = starFirstInfoByLocation.PostalCode;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.City))
                {
                    txtCity.Text = starFirstInfoByLocation.City.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.State))
                {
                    txtState.Text = starFirstInfoByLocation.State.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.RFC))
                {
                    bool IsRFC = ValidateRegularExpression.ValidateRFCFormat(starFirstInfoByLocation.RFC);
                    if (IsRFC)
                    {
                        if (starFirstInfoByLocation.RFC.Length.Equals(13))
                        {
                            txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 4);
                            txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(4, 6);
                            txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(10, 3);
                        }
                        else if (starFirstInfoByLocation.RFC.Length.Equals(12))
                        {
                            txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 3);
                            txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(3, 6);
                            txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(9, 3);
                        }
                    }
                }
                return(true);
            }

            return(true);
        }
        /// <summary>
        /// Carga informacion a la mascarilla por Location si falla el metodo principal
        /// </summary>
        private Boolean  ExistLoadLocationInfoBackup()
        {
            string  location = txtDK.Text;
            WsMyCTS wsServ   = new WsMyCTS();

            MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation starFirstInfoByLocation;
            starFirstInfoByLocation = wsServ.Get1stStarInfoByLocation(location);

            //MyCTS.Entities.Cat1stStarInfoByLocation starFirstInfoByLocation = Cat1stStarInfoByLocationBL.Get1stStarInfoByLocation(location);
            if (starFirstInfoByLocation != null)
            {
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.CustomerName))
                {
                    string customer = starFirstInfoByLocation.CustomerName.ToString();
                    customer = customer.Replace("(", "");
                    customer = customer.Replace(")", "");
                    txtEnterpriseName.Text = customer;
                    txtSocialReason.Text   = customer;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.MainPhone) && !starFirstInfoByLocation.MainPhone.Equals("()"))
                {
                    string phone = starFirstInfoByLocation.MainPhone.Trim(new char[] { '(', ')' });
                    phone         = phone.TrimEnd();
                    phone         = phone.TrimStart();
                    txtPhone.Text = phone;
                }
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address1))
                {
                    txtStreet.Text = starFirstInfoByLocation.Address1;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address2))
                {
                    starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.Replace("#", "");
                    starFirstInfoByLocation.Address2 = starFirstInfoByLocation.Address2.TrimStart();

                    txtNumberExt.Text = starFirstInfoByLocation.Address2;
                }
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address3))
                {
                    starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.Replace("#", "");
                    starFirstInfoByLocation.Address3 = starFirstInfoByLocation.Address3.TrimStart();
                    txtNumberInt.Text = starFirstInfoByLocation.Address3;
                }
                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Address4))
                {
                    txtColony.Text = starFirstInfoByLocation.Address4;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.Municipality))
                {
                    txtDelorMunicipality.Text = starFirstInfoByLocation.Municipality;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.PostalCode))
                {
                    txtPostalCode.Text = starFirstInfoByLocation.PostalCode;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.City))
                {
                    txtCity.Text = starFirstInfoByLocation.City;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.State))
                {
                    txtState.Text = starFirstInfoByLocation.State;
                }

                if (!string.IsNullOrEmpty(starFirstInfoByLocation.RFC))
                {
                    bool IsRFC = ValidateRegularExpression.ValidateRFCFormat(starFirstInfoByLocation.RFC);
                    if (IsRFC)
                    {
                        if (starFirstInfoByLocation.RFC.Length.Equals(13))
                        {
                            txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 4);
                            txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(4, 6);
                            txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(10, 3);
                        }
                        else if (starFirstInfoByLocation.RFC.Length.Equals(12))
                        {
                            txtRFC1.Text = starFirstInfoByLocation.RFC.Substring(0, 3);
                            txtRFC2.Text = starFirstInfoByLocation.RFC.Substring(3, 6);
                            txtRFC3.Text = starFirstInfoByLocation.RFC.Substring(9, 3);
                        }
                    }
                }
                return(true);
            }
            else
            {
                MessageBox.Show("El DK ingresado no existe", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
        }
Пример #16
0
        /// <summary>
        /// Carga informacion a la mascarilla por Location
        /// </summary>
        private Boolean ExistAndLoadLocationInformation()
        {
            string send     = "*PDK";
            string res      = string.Empty;
            string location = string.Empty;

            using (CommandsAPI objCommand = new CommandsAPI())
            {
                res = objCommand.SendReceive(send);
            }
            if (res.Trim() != "‡NO PSGR DATA‡")
            {
                location = res.Substring(18, 6);
            }
            WsMyCTS wsServ = new WsMyCTS();

            MyCTS.Services.ValidateDKsAndCreditCards.Cat1stStarInfoByLocation star1InfoByLocation = null;

            try
            {
                star1InfoByLocation = wsServ.GetProfileInfo(location);
            }
            catch { }

            if (star1InfoByLocation != null)
            {
                if (!string.IsNullOrEmpty(star1InfoByLocation.CustomerName))
                {
                    string customer = star1InfoByLocation.CustomerName.ToString();
                    customer             = customer.Replace("(", "");
                    customer             = customer.Replace(")", "");
                    txtSocialReason.Text = customer.Replace(',', ' ');
                }

                if (!string.IsNullOrEmpty(star1InfoByLocation.Address1))
                {
                    txtStreet.Text = star1InfoByLocation.Address1.Replace(',', ' ');
                }
                ;

                if (!string.IsNullOrEmpty(star1InfoByLocation.Address2))
                {
                    star1InfoByLocation.Address2 = star1InfoByLocation.Address2.Replace("#", "");
                    star1InfoByLocation.Address2 = star1InfoByLocation.Address2.TrimStart().Replace(',', ' ');;

                    txtNumberExt.Text = star1InfoByLocation.Address2;
                }
                if (!string.IsNullOrEmpty(star1InfoByLocation.Address3))
                {
                    star1InfoByLocation.Address3 = star1InfoByLocation.Address3.Replace("#", "");
                    star1InfoByLocation.Address3 = star1InfoByLocation.Address3.TrimStart().Replace(',', ' ');
                    txtNumberInt.Text            = star1InfoByLocation.Address3;
                }
                if (!string.IsNullOrEmpty(star1InfoByLocation.Address4))
                {
                    txtColony.Text = star1InfoByLocation.Address4;
                }

                if (star1InfoByLocation.Address4 == "")
                {
                    txtColony.Enabled = true;
                }


                if (!string.IsNullOrEmpty(star1InfoByLocation.Municipality))
                {
                    txtDelegation.Text = star1InfoByLocation.Municipality.Replace(',', ' ');
                }


                if (!string.IsNullOrEmpty(star1InfoByLocation.PostalCode))
                {
                    txtCP.Text = star1InfoByLocation.PostalCode;
                }

                if (!string.IsNullOrEmpty(star1InfoByLocation.City))
                {
                    txtCity.Text = star1InfoByLocation.City.Replace(',', ' ');
                }


                if (!string.IsNullOrEmpty(star1InfoByLocation.State))
                {
                    txtState.Text = star1InfoByLocation.State.Replace(',', ' ');
                }


                if (!string.IsNullOrEmpty(star1InfoByLocation.RFC))
                {
                    bool IsRFC = ValidateRegularExpression.ValidateRFCFormat(star1InfoByLocation.RFC);
                    if (IsRFC)
                    {
                        if (star1InfoByLocation.RFC.Length.Equals(13))
                        {
                            txtRFC1.Text = star1InfoByLocation.RFC.Substring(0, 4);
                            txtRFC2.Text = star1InfoByLocation.RFC.Substring(4, 6);
                            txtRFC3.Text = star1InfoByLocation.RFC.Substring(10, 3);
                        }


                        else if (star1InfoByLocation.RFC.Length.Equals(12))
                        {
                            txtRFC1.Text = star1InfoByLocation.RFC.Substring(0, 3);
                            txtRFC2.Text = star1InfoByLocation.RFC.Substring(3, 6);
                            txtRFC3.Text = star1InfoByLocation.RFC.Substring(9, 3);
                        }
                    }
                }
                return(true);
            }

            return(true);
        }
        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);
                }
            }
        }