Пример #1
0
    public static clsParametros _ADD(List <VO_Remarks> vlRemark, string sRecord)
    {
        clsParametros cParametros = new clsParametros();

        try
        {
            clsOTA_TravelItineraryRead ota_TravelItineraryRead = new clsOTA_TravelItineraryRead();
            OTA_TravelItineraryRS      ota_TravelItineraryRS   = ota_TravelItineraryRead._Sabre_LeerInformacionPNR(sRecord);
            cParametros = new WebService_Remark()._Sabre_AgregarObservaciones(vlRemark);
            Negocios_WebServiceSabreCommand.setER();
            Negocios_WebServiceSession._CerrarSesion();
        }
        catch (Exception Ex)
        {
            cParametros.Id          = 0;
            cParametros.Message     = Ex.Message.ToString();
            cParametros.Source      = Ex.Source.ToString();
            cParametros.Tipo        = clsTipoError.Library;
            cParametros.Severity    = clsSeveridad.Alta;
            cParametros.StackTrace  = Ex.StackTrace.ToString();
            cParametros.Complemento = "Error al ejecutar Reamrk  Sabre";
            ExceptionHandled.Publicar(cParametros);
        }
        return(cParametros);
    }
        /// <summary>
        /// Metodo para abrir la reserva a traves de comando
        /// </summary>
        /// <param name="str_Record">record</param>
        /// <returns>Respuesta del Command para verificacion</returns>
        /// <remarks>
        /// Autor:  Faustino Posas
        /// Fecha:  2011-10-07
        /// -- Control de cambios --
        /// Descripcion:
        /// Fecha:
        /// Responsable:
        /// </remarks>
        public string Abrir_ReservaCommand(String str_Record)
        {
            string sReponse = "Error";

            try
            {
                string sComando = "*" + str_Record;
                sReponse = Negocios_WebServiceSabreCommand._EjecutarComando(sComando);
            }
            catch { }
            return(sReponse);
        }
Пример #3
0
    public static clsParametros _ADDPerfilAg()
    {
        clsParametros cParametros    = new clsParametros();
        string        sComando       = "N*¤";
        string        sComandoRemark = "NM";

        try
        {
            cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComando);

            //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE"))
            //{
            cParametros.TipoLog     = Enum_Error.Transac;
            cParametros.Complemento = "Ejecucion del comando del perfil de sabre - Agencia";
            cParametros.Metodo      = sComando;
            ExceptionHandled.Publicar(cParametros);
            //}
            cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComandoRemark);

            //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE"))
            //{
            cParametros.TipoLog     = Enum_Error.Transac;
            cParametros.Complemento = "Ejecucion del comando de confirmacion del perfil de sabre - Agencia";
            cParametros.Metodo      = sComandoRemark;
            ExceptionHandled.Publicar(cParametros);
            //}
        }
        catch (Exception Ex)
        {
            cParametros.Id          = 0;
            cParametros.TipoLog     = Enum_Error.Log;
            cParametros.Complemento = Ex.Message.ToString();
            cParametros.Source      = Ex.Source.ToString();
            cParametros.Tipo        = clsTipoError.Library;
            cParametros.Severity    = clsSeveridad.Alta;
            cParametros.StackTrace  = Ex.StackTrace.ToString();
            cParametros.Info        = "Error al ejecutar comando de sabre para los perfiles - Agencia. Comandos; " + sComando + "  ... Segubdo: " + sComandoRemark;
            ExceptionHandled.Publicar(cParametros);
        }
        return(cParametros);
    }
        public static void setFechaLimiteTiquete()
        {
            Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno("WP");
            string   ComandoPQ_ = Negocios_WebServiceSabreCommand._EjecutarComando("PQ");
            DateTime FechaPQ_   = new DateTime();

            ComandoPQ_ = clsValidaciones._Seleccionar_FechaExpedicionTickete(ComandoPQ_);

            if (ComandoPQ_ == null)
            {
                FechaPQ_ = DateTime.Today.AddDays(1);
                FechaPQ_ = FechaPQ_.AddMinutes(-1);
            }
            else
            {
                if (ComandoPQ_.Contains("/"))
                {
                    string[] sDate = ComandoPQ_.Split('/');
                    ComandoPQ_  = sDate[0] + DateTime.Now.Year;
                    ComandoPQ_ += " " + sDate[1].Insert(2, ":");
                }
                DateTime.TryParse(ComandoPQ_, out FechaPQ_);
            }
            int iHoras = 8;

            try
            {
                iHoras = clsSesiones.getCredentials().TimeLimit;
            }
            catch { }
            try
            {
                FechaPQ_ = FechaPQ_.AddHours(-iHoras);
            }
            catch
            {
                FechaPQ_ = DateTime.Today.AddDays(1);
                FechaPQ_ = FechaPQ_.AddMinutes(-1);
            }
            Ssoft.Utils.clsSesiones.SET_TICKETE(FechaPQ_);
        }
Пример #5
0
    /// <summary>
    /// Metodo para incluir el registro de Ssoft
    /// </summary>
    /// <param name="sPNR">Record</param>
    /// <remarks>
    /// Autor:          José Faustino Posas
    /// Company:        Ssoft Colombia
    /// Fecha:          2012-02-06
    /// -------------------
    /// Control de Cambios
    /// -------------------
    /// Autor:
    /// Fecha:
    /// Descripción:
    /// </remarks>
    public static void _ADDRemarkSsoftOpen(string sPNR)
    {
        try
        {
            string sCommand   = "I";
            string sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

            sCommand   = "*" + sPNR;
            sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

            sCommand = "ASD/SS/" + sPNR + "/" + DateTime.Now.Year.ToString();
            _ADD(Enum_TipoRemark.Historico, sCommand);

            sCommand   = "6WEB";
            sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

            sCommand   = "E";
            sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);
        }
        catch
        {
        }
    }
        public static string setResultComado(string sComand, string sSearch, int iPosIni, int iLength)
        {
            string sDato = string.Empty;

            try
            {
                string sComando = Negocios_WebServiceSabreCommand._EjecutarComando(sComand);
                if (sComando.Contains("\n"))
                {
                    string[] strResponse = sComando.Split('\n');
                    int      iPosGen     = 0;
                    try
                    {
                        iPosGen = strResponse.Length;
                    }
                    catch { }
                    for (int i = 0; i < iPosGen; i++)
                    {
                        if (strResponse[i].ToString().Contains(sSearch))
                        {
                            if (iLength.Equals(0))
                            {
                                sDato = strResponse[i].Trim();
                            }
                            else
                            {
                                sDato = strResponse[i].Substring(iPosIni, iLength).Trim();
                            }
                            break;
                        }
                    }
                }
            }
            catch { }
            return(sDato);
        }
Пример #7
0
    /// <summary>
    /// Metodo para incluir el segmento futuro despues de cerrada la reserva
    /// Se debe tener en el web.config, la llave SegmentoFuturo, dentro del espacio de credenciales de sabre, si esta en 0, no lo toma
    /// </summary>
    /// <param name="sPNR">Record</param>
    /// <remarks>
    /// Autor:          José Faustino Posas
    /// Company:        Ssoft Colombia
    /// Fecha:          2012-02-14
    /// -------------------
    /// Control de Cambios
    /// -------------------
    /// Autor:
    /// Fecha:
    /// Descripción:
    /// </remarks>
    public static void _ADDSegmentoFuturo(string sPNR)
    {
        clsParametros objParametros = new clsParametros();

        try
        {
            int iDias = 280;
            try
            {
                iDias = clsSesiones.getCredentials().SegmentoFuturo;
            }
            catch { }
            if (iDias.Equals(0))
            {
                objParametros.Id       = 0;
                objParametros.Code     = "0";
                objParametros.Info     = "Segmento no incluido por ser valor 0";
                objParametros.Message  = "No icluye OTH";
                objParametros.Severity = clsSeveridad.Baja;
                objParametros.Metodo   = "clsRulesFromPrice.getRulesSegment()";
                objParametros.Tipo     = clsTipoError.WebServices;
                Ssoft.ManejadorExcepciones.ExceptionHandled.Publicar(objParametros);
            }
            else
            {
                string sCommand   = "I";
                string sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

                sCommand   = "*" + sPNR;
                sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

                DateTime dtm_Fecha_Segmento = DateTime.Now;
                /*SE SUMAN LOS 330 DIAS*/
                dtm_Fecha_Segmento = dtm_Fecha_Segmento.AddDays(iDias);
                /*OBTENEMOS EL MES EN LETRAS, EN INGLES*/
                string str_Mes_Letras = clsValidaciones.RetornaMesLetrasCorto(dtm_Fecha_Segmento.Month.ToString(), "en");
                String str_Dia        = dtm_Fecha_Segmento.Day.ToString();
                if (str_Dia.Length == 1)
                {
                    str_Dia = "0" + str_Dia;
                }

                sCommand   = "0OTHAAGK1BOG" + str_Dia + str_Mes_Letras.ToUpper();
                sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

                sCommand   = "6WEB";
                sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);

                sCommand   = "ET";
                sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand);
            }
        }
        catch (Exception Ex)
        {
            objParametros.Id          = 0;
            objParametros.Code        = "0";
            objParametros.Info        = "Segmento no incluido por ser error al ejecutar comando";
            objParametros.Message     = Ex.Message.ToString();
            objParametros.Complemento = "No icluye OTH";
            objParametros.Severity    = clsSeveridad.Baja;
            objParametros.Metodo      = "clsRulesFromPrice.getRulesSegment()";
            objParametros.Tipo        = clsTipoError.WebServices;
            Ssoft.ManejadorExcepciones.ExceptionHandled.Publicar(objParametros);
        }
    }
Пример #8
0
    public static clsParametros _ADDPerfil(string PseudoPerfil, string PerfilComunidad)
    {
        clsParametros cParametros    = new clsParametros();
        string        sTexto         = string.Empty;
        string        sValue         = "0";
        string        sComando       = "N*-" + PseudoPerfil + "-" + PerfilComunidad;
        string        sComandoRemark = "NM";

        try
        {
            cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComando);

            //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE"))
            //{
            cParametros.TipoLog     = Enum_Error.Transac;
            cParametros.Complemento = "Ejecucion del comando del perfil de sabre - Comunidad";
            cParametros.Metodo      = sComando;
            ExceptionHandled.Publicar(cParametros);
            //}
            sTexto = "  -" + PerfilComunidad.Substring(0, 4);
            sValue = clsValidaciones.RetornaNumero(clsValidacionesVuelos.setResultComado(cParametros.Message, sTexto).Substring(0, 5));
            if (!sValue.Equals("0"))
            {
                sComandoRemark += "X" + sValue;
            }
            //else
            //{
            //    int iCant = 3;
            //    int iCantInicio = 3;
            //    for (int i = 0; i < iCant; i++)
            //    {
            //        if (i.Equals(0))
            //        {
            //            sTexto = "  -" + PerfilComunidad.Substring(0, iCantInicio) + " ";
            //        }
            //        else
            //        {
            //            sTexto = "  -" + PerfilComunidad.Substring(0, iCantInicio) + " " + PerfilComunidad.Substring(iCantInicio + 1, i);
            //        }
            //        sValue = clsValidaciones.RetornaNumero(clsValidacionesVuelos.setResultComado(cParametros.Message, sTexto).Substring(0, 5));
            //        if (!sValue.Equals("0"))
            //        {
            //            sComandoRemark += "X" + sValue;
            //            break;
            //        }
            //        iCantInicio--;
            //    }
            //}

            cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComandoRemark);

            //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE"))
            //{
            cParametros.TipoLog     = Enum_Error.Transac;
            cParametros.Complemento = "Ejecucion del comando de confirmacion del perfil de sabre - Comunidad";
            cParametros.Metodo      = sComandoRemark;
            ExceptionHandled.Publicar(cParametros);
            //}
        }
        catch (Exception Ex)
        {
            cParametros.Id          = 0;
            cParametros.TipoLog     = Enum_Error.Log;
            cParametros.Complemento = Ex.Message.ToString();
            cParametros.Source      = Ex.Source.ToString();
            cParametros.Tipo        = clsTipoError.Library;
            cParametros.Severity    = clsSeveridad.Alta;
            cParametros.StackTrace  = Ex.StackTrace.ToString();
            cParametros.Info        = "Error al ejecutar comando de sabre para los perfiles. Comandos; " + sComando + "  ... Segubdo: " + sComandoRemark + "   .... Value: " + sValue + "    .... Texto " + sTexto;
            ExceptionHandled.Publicar(cParametros);
        }
        return(cParametros);
    }
        public OTA_TravelItineraryRS _Sabre_LeerInformacionPNR(string Record_)
        {
            OTA_TravelItineraryRS TravelResultado_ = new OTA_TravelItineraryRS();
            clsResultados         cResultados      = new clsResultados();
            clsParametros         cParametros      = new clsParametros();
            StringBuilder         consulta         = new StringBuilder();

            try
            {
                objvo_Credentials = clsSesiones.getCredentials();
                OTA_TravelItineraryRead.MessageHeader Mensaje_ = clsSabreBase.OTA_TravelItineraryRead();

                if (Mensaje_ != null)
                {
                    OTA_TravelItineraryRead.Security Seguridad_ = new OTA_TravelItineraryRead.Security();
                    Seguridad_.BinarySecurityToken = Session_;

                    OTA_TravelItineraryReadRQ          Travel_       = new OTA_TravelItineraryReadRQ();
                    OTA_TravelItineraryReadRQPOS       TravelPos_    = new OTA_TravelItineraryReadRQPOS();
                    OTA_TravelItineraryReadRQPOSSource TravelSource_ = new OTA_TravelItineraryReadRQPOSSource();

                    TravelSource_.PseudoCityCode = objvo_Credentials.Pcc;
                    TravelPos_.Source            = TravelSource_;
                    Travel_.POS = TravelPos_;

                    OTA_TravelItineraryReadRQUniqueID Travel_UniqueID_ = new OTA_TravelItineraryReadRQUniqueID();
                    OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction[] aTPA_ExtensionsTransaction = new OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction[1];
                    OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction   oTPA_ExtensionsTransaction = new OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction();
                    OTA_TravelItineraryReadRQUniqueIDTPA_Extensions oIDTPA_Extensions = new OTA_TravelItineraryReadRQUniqueIDTPA_Extensions();

                    Travel_UniqueID_.ID             = Record_;
                    oTPA_ExtensionsTransaction.Code = "AIT";
                    aTPA_ExtensionsTransaction.SetValue(oTPA_ExtensionsTransaction, 0);
                    oIDTPA_Extensions.Transaction = aTPA_ExtensionsTransaction;
                    //Travel_UniqueID_.TPA_Extensions = oIDTPA_Extensions;
                    Travel_.UniqueID = Travel_UniqueID_;

                    OTA_TravelItineraryReadRQUniqueIDTPA_Extensions          oUniqueIDTPA_Extensions          = new OTA_TravelItineraryReadRQUniqueIDTPA_Extensions();
                    OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsRedisplay oUniqueIDTPA_ExtensionsRedisplay = new OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsRedisplay();

                    oUniqueIDTPA_ExtensionsRedisplay.Ind = false;
                    oUniqueIDTPA_Extensions.Redisplay    = oUniqueIDTPA_ExtensionsRedisplay;
                    Travel_UniqueID_.TPA_Extensions      = oUniqueIDTPA_Extensions;

                    OTA_TravelItineraryReadRQTPA_Extensions oTPA_Extensions = new OTA_TravelItineraryReadRQTPA_Extensions();
                    OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetails          oMessagingDetails = new OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetails();
                    OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetailsMDRSubset oMDRSubset        = new OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetailsMDRSubset();

                    oMDRSubset.Code                  = "PN12";
                    oMessagingDetails.MDRSubset      = oMDRSubset;
                    oTPA_Extensions.MessagingDetails = oMessagingDetails;
                    Travel_.TPA_Extensions           = oTPA_Extensions;

                    Travel_.Version = clsSabreBase.SABRE_VERSION_TRAVELITINERARYREADLLS;

                    OTA_TravelItineraryService TravelServicio_ = new OTA_TravelItineraryService();

                    TravelServicio_.MessageHeaderValue = Mensaje_;
                    TravelServicio_.SecurityValue      = Seguridad_;
                    TravelServicio_.Url = objvo_Credentials.UrlWebServices;

                    TravelResultado_ = TravelServicio_.OTA_TravelItineraryReadRQ(Travel_);

                    if (TravelResultado_.Errors != null)
                    {
                        cParametros.Id          = 0;
                        cParametros.Code        = TravelResultado_.Errors.Error.ErrorCode;
                        cParametros.Info        = TravelResultado_.Errors.Error.ErrorInfo.Message;
                        cParametros.Message     = TravelResultado_.Errors.Error.ErrorMessage;
                        cParametros.Severity    = TravelResultado_.Errors.Error.Severity;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
                        cParametros.Complemento = "Recuperacion de la reserva " + Record_;
                        cParametros.ViewMessage.Add("Error al intentar recuperar la reserva");
                        cParametros.Sugerencia.Add("Por favor intente de nuevo");
                        consulta.AppendLine("Credenciales: ");
                        try
                        {
                            if (objvo_Credentials != null)
                            {
                                consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                                consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                                consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber);
                                consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                                consulta.AppendLine("Session Sabre: " + Session_.ToString());
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                                consulta.AppendLine("Reserva: " + Record_);
                            }
                        }
                        catch { }
                        cParametros.TargetSite = consulta.ToString();
                        try
                        {
                            clsCache cCache = new csCache().cCache();
                            if (cCache != null)
                            {
                                cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString();
                            }
                            else
                            {
                                cParametros.Source = "Sesion Local: No hay cache ";
                            }
                        }
                        catch
                        {
                            cParametros.Source = "Sesion Local: Error ";
                        }
                        cResultados.Error = cParametros;
                        ExceptionHandled.Publicar(cParametros);
                        try
                        {
                            Negocios_WebServiceSabreCommand.setEmailError(cParametros, "Error al Recuperar la reserva " + Record_);
                        }
                        catch { }
                    }
                    else
                    {
                        cParametros.Id          = 1;
                        cParametros.TipoLog     = Enum_Error.Transac;
                        cParametros.Message     = TravelResultado_.Success;
                        cParametros.Metodo      = "Informacion PNR";
                        cParametros.Complemento = "HostCommand: " + TravelResultado_.TPA_Extensions.HostCommand;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Severity    = clsSeveridad.Moderada;
                        consulta.AppendLine("Credenciales: ");
                        try
                        {
                            if (objvo_Credentials != null)
                            {
                                consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                                consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                                consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber);
                                consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                                consulta.AppendLine("Session Sabre: " + Session_.ToString());
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                                consulta.AppendLine("Reserva: " + Record_);
                            }
                        }
                        catch { }
                        cParametros.TargetSite = consulta.ToString();
                        try
                        {
                            clsCache cCache = new csCache().cCache();
                            if (cCache != null)
                            {
                                cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString();
                            }
                            else
                            {
                                cParametros.Source = "Sesion Local: No hay cache ";
                            }
                        }
                        catch
                        {
                            cParametros.Source = "Sesion Local: Error ";
                        }
                        ExceptionHandled.Publicar(cParametros);
                    }
                }
            }
            catch (Exception Ex)
            {
                cParametros.Id          = 0;
                cParametros.Message     = Ex.Message;
                cParametros.Severity    = clsSeveridad.Alta;
                cParametros.Tipo        = clsTipoError.WebServices;
                cParametros.Metodo      = Ex.TargetSite.Name;
                cParametros.Complemento = "Recuperacion de la reserva " + Record_;
                cParametros.Source      = Ex.Source;
                cParametros.StackTrace  = Ex.StackTrace;
                cParametros.ViewMessage.Add("Error al intentar recuperar la reserva");
                cParametros.Sugerencia.Add("Por favor intente de nuevo");
                cResultados.Error = cParametros;
                ExceptionHandled.Publicar(cParametros);
                try
                {
                    Negocios_WebServiceSabreCommand.setEmailError(cParametros, "Error al Recuperar la reserva " + Record_);
                }
                catch { }
            }
            return(TravelResultado_);
        }
        public clsParametros _CerrarReserva(ref String Record_)
        {
            #region [ CERRAR RESERVA ]
            string        Return_      = "XXXXXX";
            string        ReturnTotal_ = "YYYYYY";
            string        NotComplete_ = "ZZZZZZ";
            clsParametros cParametros  = new clsParametros();
            objvo_Credentials = clsSesiones.getCredentials();
            bool bReservaNormal = true;
            cParametros.DatoAdic = Record_;
            List <VO_SabreErrors> SabreErrors_ = WS_SsoftSabre.Utilidades.clsValidacionesVuelos._SabreErrors();
            int iCount = 0;
            while (!Ssoft.Utils.clsValidaciones.IS_ALPHABETIC(cParametros.DatoAdic))
            {
                cParametros = _GuardarReserva();

                if (cParametros.Message.Contains("Unable to connect"))
                {
                    if (iCount < 3)
                    {
                        cParametros.DatoAdic = Record_;
                        iCount++;
                    }
                    else
                    {
                        cParametros.DatoAdic = NotComplete_;
                    }
                }
                else
                {
                    if (cParametros.DatoAdic == null)
                    {
                        cParametros.DatoAdic = String.Empty;
                    }

                    if (cParametros.DatoAdic.Length != 6 || !Ssoft.Utils.clsValidaciones.IS_ALPHABETIC(cParametros.DatoAdic))
                    {
                        for (int i = 0; i < SabreErrors_.Count; i++)
                        {
                            if (cParametros.DatoAdic.Trim().CompareTo(SabreErrors_[i].Error_) == 0)
                            {
                                #region [ FILTRAR ]

                                if (SabreErrors_[i].Solucion_[0].CompareTo("RETURN") == 0)
                                {
                                    cParametros.DatoAdic = Return_;
                                }
                                else if (SabreErrors_[i].Solucion_[0].CompareTo("RETURNCOMPLETE") == 0)
                                {
                                    cParametros.DatoAdic = ReturnTotal_;
                                }
                                else
                                {
                                    foreach (string Solucion_ in SabreErrors_[i].Solucion_)
                                    {
                                        if (SabreErrors_[i].Error_.Contains("NEED ADDRESS - USE W-"))
                                        {
                                            Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_ + objvo_Credentials.Agencia_Nombre);
                                        }
                                        else
                                        {
                                            if (SabreErrors_[i].Error_.Contains("NEED PHONE FIELD - USE 9"))
                                            {
                                                Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_ + objvo_Credentials.Agencia_Telefono);
                                            }
                                            else
                                            {
                                                if (SabreErrors_[i].Error_.Contains("INFANT DETAILS REQUIRED IN SSR - ENTER 3INFT/..."))
                                                {
                                                    Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_);
                                                    bReservaNormal = false;
                                                }
                                                else
                                                {
                                                    Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_);
                                                }
                                            }
                                        }
                                        System.Threading.Thread.Sleep(50);
                                    }
                                    if (bReservaNormal)
                                    {
                                        cParametros = _GuardarReserva();
                                    }
                                    else
                                    {
                                        string sComando = "*P6";
                                        cParametros             = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComando);
                                        cParametros.Complemento = "Command de reserva: " + cParametros.Message;
                                        ExceptionHandled.Publicar(cParametros);
                                        cParametros.DatoAdic = clsValidacionesVuelos.setResultComado(cParametros.Message.ToString(), 1, 27, 6);
                                    }
                                    if (cParametros.DatoAdic == null)
                                    {
                                        cParametros.DatoAdic = String.Empty;
                                    }

                                    if (cParametros.DatoAdic.Length != 6 || !Ssoft.Utils.clsValidaciones.IS_ALPHABETIC(cParametros.DatoAdic))
                                    {
                                        if (iCount < 3)
                                        {
                                            iCount++;
                                            i = -1;
                                        }
                                        else
                                        {
                                            cParametros.DatoAdic = Return_;
                                            i = SabreErrors_.Count;
                                        }
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }

                                #endregion
                            }
                            if (i.CompareTo(SabreErrors_.Count - 1) == 0)
                            {
                                cParametros.DatoAdic = NotComplete_;
                            }
                        }
                    }
                }
            }
            #endregion
            Record_ = cParametros.DatoAdic;
            if ((cParametros.DatoAdic == Return_) || (cParametros.DatoAdic == ReturnTotal_) || (cParametros.DatoAdic == NotComplete_))
            {
                cParametros.Data = "La reserva no se pudo confirmar";
                Record_          = cParametros.Data;
            }
            return(cParametros);
        }
        public EndTransactionRQ.EndTransactionRS _Sabre_GuardarReserva()
        {
            objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();
            EndTransactionRQ.EndTransactionRS EndTransactionResultado_ = new EndTransactionRQ.EndTransactionRS();
            clsParametros cParametros = new clsParametros();
            StringBuilder consulta    = new StringBuilder();

            cParametros.TipoWs = Enum_ProveedorWebServices.Sabre;

            try
            {
                EndTransactionRQ.MessageHeader Mensaje_ = clsSabreBase.__ISabre_EndTransactionLLSUpdated();

                if (Mensaje_ != null)
                {
                    EndTransactionRQ.Security Seguridad_ = new EndTransactionRQ.Security();
                    Seguridad_.BinarySecurityToken = Session_;

                    EndTransactionRQ.EndTransactionRQ          EndTransaction_       = new EndTransactionRQ.EndTransactionRQ();
                    EndTransactionRQ.EndTransactionRQPOS       EndTransactionPos_    = new EndTransactionRQ.EndTransactionRQPOS();
                    EndTransactionRQ.EndTransactionRQPOSSource EndTransactionSource_ = new EndTransactionRQ.EndTransactionRQPOSSource();

                    EndTransactionSource_.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"];
                    EndTransactionPos_.Source            = EndTransactionSource_;
                    EndTransaction_.POS = EndTransactionPos_;

                    EndTransactionRQ.EndTransactionRQEndTransaction                            EndTransactionEnd_                    = new EndTransactionRQ.EndTransactionRQEndTransaction();
                    EndTransactionRQ.EndTransactionRQUpdatedBy                                 EndTransaction_Update_                = new EndTransactionRQ.EndTransactionRQUpdatedBy();
                    EndTransactionRQ.EndTransactionRQUpdatedByTPA_Extensions                   EndTransaction_UpdateTPA_             = new EndTransactionRQ.EndTransactionRQUpdatedByTPA_Extensions();
                    EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccess             EndTransaction_UpdateTPAAccess_       = new EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccess();
                    EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccessAccessPerson EndTransaction_UpdateTPAAccessPerson_ = new EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccessAccessPerson();

                    EndTransaction_UpdateTPAAccessPerson_.GivenName = "WEB";
                    EndTransaction_UpdateTPAAccess_.AccessPerson    = EndTransaction_UpdateTPAAccessPerson_;
                    EndTransaction_UpdateTPA_.Access      = EndTransaction_UpdateTPAAccess_;
                    EndTransaction_Update_.TPA_Extensions = EndTransaction_UpdateTPA_;
                    EndTransaction_.UpdatedBy             = EndTransaction_Update_;
                    EndTransactionEnd_.Ind          = true;
                    EndTransactionEnd_.IndSpecified = true;
                    /*PARA CONFIGURAR SI SE ENVIA CORREO DE NOTIFICACION*/
                    string sCorreo;
                    try { sCorreo = ConfigurationManager.AppSettings["Sabre_VirtuallyThere"].ToString(); }
                    catch { sCorreo = "True"; }
                    if (sCorreo.Equals("True"))
                    {
                        EndTransactionRQ.EndTransactionRQEndTransactionSendEmail oSendEmail = new EndTransactionRQ.EndTransactionRQEndTransactionSendEmail();
                        oSendEmail.Ind               = true;
                        oSendEmail.IndSpecified      = true;
                        EndTransactionEnd_.SendEmail = oSendEmail;
                    }
                    EndTransaction_.EndTransaction = EndTransactionEnd_;
                    EndTransaction_.Version        = clsSabreBase.SABRE_VERSION_ENDTRANSACTION;
                    EndTransactionRQ.EndTransactionService EndTransactionServicio_ = new EndTransactionRQ.EndTransactionService();
                    EndTransactionServicio_.MessageHeaderValue = Mensaje_;
                    EndTransactionServicio_.SecurityValue      = Seguridad_;

                    try
                    {
                        string sConvenio = csVuelos.csConvenio();
                        if (!sConvenio.Length.Equals(0))
                        {
                            string Comando_ = "WPAC*" + sConvenio + "¥RQ";
                            Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Comando_);
                        }
                    }
                    catch { }
                    EndTransactionServicio_.Url = objvo_Credentials.UrlWebServices;

                    EndTransactionResultado_ = EndTransactionServicio_.EndTransactionRQ(EndTransaction_);
                    //string sComando = "PQ";
                    //string sVenta = Negocios_WebServiceSabreCommand._EjecutarComando(sComando);
                    if (EndTransactionResultado_.Errors != null)
                    {
                        cParametros.Id          = 0;
                        cParametros.TipoLog     = Enum_Error.Log;
                        cParametros.Code        = EndTransactionResultado_.Errors.Error.ErrorCode;
                        cParametros.Message     = EndTransactionResultado_.Errors.Error.ErrorMessage;
                        cParametros.Severity    = EndTransactionResultado_.Errors.Error.Severity;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Metodo      = "_Sabre_GuardarReserva";
                        cParametros.Complemento = "HostCommand: " + EndTransactionResultado_.TPA_Extensions.HostCommand;
                        cParametros.ViewMessage.Add("La reserva no pudo ser confirmada");
                        cParametros.Sugerencia.Add("Por favor intente de nuevo");
                        consulta.AppendLine("Credenciales: ");
                        if (objvo_Credentials != null)
                        {
                            consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                            consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                            consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber);
                            consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                            consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                        }
                        cParametros.TargetSite = consulta.ToString();
                        ExceptionHandled.Publicar(cParametros);
                    }
                    else
                    {
                        cParametros.Id          = 1;
                        cParametros.TipoLog     = Enum_Error.Transac;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Metodo      = "_Sabre_GuardarReserva";
                        cParametros.Complemento = "HostCommand: " + EndTransactionResultado_.TPA_Extensions.HostCommand;
                        try
                        {
                            if (EndTransactionResultado_.UniqueID != null)
                            {
                                cParametros.Message = EndTransactionResultado_.UniqueID.ID;
                            }
                        }
                        catch { }
                        consulta.AppendLine("Credenciales: ");
                        try
                        {
                            if (objvo_Credentials != null)
                            {
                                consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                                consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                                consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber);
                                consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                            }
                        }
                        catch { }
                        cParametros.TargetSite = consulta.ToString();
                        ExceptionHandled.Publicar(cParametros);
                    }
                }
            }
            catch (Exception Ex)
            {
                cParametros.Id         = 0;
                cParametros.Message    = Ex.Message;
                cParametros.StackTrace = Ex.StackTrace;
                cParametros.Source     = Ex.Source;
                cParametros.TargetSite = Ex.TargetSite.ToString();
                cParametros.Severity   = clsSeveridad.Alta;
                cParametros.Metodo     = "_Sabre_GuardarReserva";
                cParametros.Tipo       = clsTipoError.WebServices;
                consulta.AppendLine("Credenciales: ");
                if (objvo_Credentials != null)
                {
                    consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                    consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                    consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                    consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                }
                cParametros.TargetSite = consulta.ToString();
                ExceptionHandled.Publicar(cParametros);
            }
            return(EndTransactionResultado_);
        }
Пример #12
0
        public AirTicketRS getAirTicketRS(VO_PrintersTicketsRQ vo_PrintersTicketsRQ)
        {
            /*METODO PRINCICPAL QUE RETORNA EL OBJETO DE RESULTADOS DE SABRE*/
            StringBuilder consulta    = new StringBuilder();
            clsParametros cParametros = new clsParametros();

            cParametros.TipoWs = Enum_ProveedorWebServices.Sabre;
            AirTicketRQ.AirTicketRQ oAirTicketRQ = new WS_SsoftSabre.AirTicketRQ.AirTicketRQ();
            AirTicketRS             oAirTicketRS = new AirTicketRS();

            objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();
            try
            {
                List <string>             lsContadorOpciones = new List <string>();
                AirTicketRQ.MessageHeader Mensaje_           = clsSabreBase.AirTicket();

                if (Mensaje_ != null)
                {
                    AirTicketRQ.Security Seguridad_ = new AirTicketRQ.Security();
                    Seguridad_.BinarySecurityToken = Session_;

                    #region [ POS ]
                    AirTicketRQPOS       oAirTicketRQPOS       = new AirTicketRQPOS();
                    AirTicketRQPOSSource oAirTicketRQPOSSource = new AirTicketRQPOSSource();

                    oAirTicketRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"];
                    oAirTicketRQPOS.Source = oAirTicketRQPOSSource;
                    oAirTicketRQ.POS       = oAirTicketRQPOS;
                    #endregion

                    #region [ VERSION ]
                    oAirTicketRQ.Version = clsSabreBase.SABRE_VERSION_AIRTICKET;
                    #endregion

                    #region [ DESIGNATEPRINTERS ]

                    AirTicketRQOptionalQualifiers oAirTicketRQOptionalQualifiers = new AirTicketRQOptionalQualifiers();
                    AirTicketRQOptionalQualifiersPricingQualifiers             oPricingQualifiers            = new AirTicketRQOptionalQualifiersPricingQualifiers();
                    AirTicketRQOptionalQualifiersPricingQualifiersBasicPrice[] oPricingQualifiersBasicPrices = new AirTicketRQOptionalQualifiersPricingQualifiersBasicPrice[vo_PrintersTicketsRQ.PQNumber.Count];
                    AirTicketRQOptionalQualifiersMiscQualifiers           oMiscQualifiers           = new AirTicketRQOptionalQualifiersMiscQualifiers();
                    AirTicketRQOptionalQualifiersMiscQualifiersCommission oMiscQualifiersCommission = new AirTicketRQOptionalQualifiersMiscQualifiersCommission();
                    int iPosPQ = 0;
                    foreach (string sPQNumber in vo_PrintersTicketsRQ.PQNumber)
                    {
                        AirTicketRQOptionalQualifiersPricingQualifiersBasicPrice oPricingQualifiersBasicPrice = new AirTicketRQOptionalQualifiersPricingQualifiersBasicPrice();
                        oPricingQualifiersBasicPrice.PQNumber = vo_PrintersTicketsRQ.PQNumber[iPosPQ].ToString();

                        //oPricingQualifiersBasicPrice.EndPQNumber = vo_PrintersTicketsRQ.EndPQNumber;
                        oPricingQualifiersBasicPrices[iPosPQ] = oPricingQualifiersBasicPrice;
                        iPosPQ++;
                    }
                    oPricingQualifiers.BasicPrice = oPricingQualifiersBasicPrices;
                    oAirTicketRQOptionalQualifiers.PricingQualifiers = oPricingQualifiers;

                    oMiscQualifiersCommission.Percentage = vo_PrintersTicketsRQ.CommisionPercent;
                    oMiscQualifiers.Commission           = oMiscQualifiersCommission;

                    oAirTicketRQ.OptionalQualifiers = oAirTicketRQOptionalQualifiers;

                    #endregion

                    AirTicketService oAirTicketService = new AirTicketService();

                    oAirTicketService.MessageHeaderValue = Mensaje_;
                    oAirTicketService.SecurityValue      = Seguridad_;
                    oAirTicketService.Url = objvo_Credentials.UrlWebServices;

                    oAirTicketRS = oAirTicketService.AirTicketRQ(oAirTicketRQ);
                    if (oAirTicketRS.Errors != null)
                    {
                        cParametros.Id          = 0;
                        cParametros.Code        = oAirTicketRS.Errors.Error.ErrorCode;
                        cParametros.Info        = oAirTicketRS.Errors.Error.ErrorInfo.Message;
                        cParametros.Message     = oAirTicketRS.Errors.Error.ErrorMessage;
                        cParametros.Severity    = oAirTicketRS.Errors.Error.Severity;
                        cParametros.Complemento = "HostCommand: " + oAirTicketRS.TPA_Extensions.HostCommand;
                        cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        consulta.AppendLine("Credenciales: ");
                        try
                        {
                            if (objvo_Credentials != null)
                            {
                                consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                                consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                                consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber);
                                consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                                consulta.AppendLine("Session Sabre: " + Session_.ToString());
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                            }
                        }
                        catch { }
                        cParametros.TargetSite = consulta.ToString();
                        try
                        {
                            clsCache cCache = new csCache().cCache();
                            if (cCache != null)
                            {
                                cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString();
                            }
                            else
                            {
                                cParametros.Source = "Sesion Local: No hay cache ";
                            }
                        }
                        catch
                        {
                            cParametros.Source = "Sesion Local: Error ";
                        }
                        ExceptionHandled.Publicar(cParametros);
                        try
                        {
                            Negocios_WebServiceSabreCommand.setEmailError(cParametros, "Error al emitir tiquetes");
                        }
                        catch { }
                    }
                    else
                    {
                        cParametros.Id      = 1;
                        cParametros.Message = oAirTicketRS.Success;
                        cParametros.TipoLog = Enum_Error.Transac;
                        consulta.AppendLine("Credenciales: ");
                        try
                        {
                            if (objvo_Credentials != null)
                            {
                                consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc);
                                consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc);
                                consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber);
                                consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio);
                                consulta.AppendLine("Session Sabre: " + Session_.ToString());
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                            }
                        }
                        catch { }
                        cParametros.TargetSite = consulta.ToString();
                        try
                        {
                            clsCache cCache = new csCache().cCache();
                            if (cCache != null)
                            {
                                cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString();
                            }
                            else
                            {
                                cParametros.Source = "Sesion Local: No hay cache ";
                            }
                        }
                        catch
                        {
                            cParametros.Source = "Sesion Local: Error ";
                        }
                        cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
                        cParametros.Complemento = "HostCommand: " + oAirTicketRS.TPA_Extensions.HostCommand;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Severity    = clsSeveridad.Moderada;
                        ExceptionHandled.Publicar(cParametros);
                    }
                }
            }
            catch (Exception Ex)
            {
                cParametros.Id         = 0;
                cParametros.Message    = Ex.Message;
                cParametros.StackTrace = Ex.StackTrace;
                cParametros.Source     = Ex.Source;
                cParametros.TargetSite = Ex.TargetSite.ToString();
                cParametros.Severity   = clsSeveridad.Alta;
                cParametros.Metodo     = System.Reflection.MethodBase.GetCurrentMethod().Name;
                cParametros.Tipo       = clsTipoError.WebServices;
                ExceptionHandled.Publicar(cParametros);
                try
                {
                    Negocios_WebServiceSabreCommand.setEmailError(cParametros, "Error al Emitir tiquetes");
                }
                catch { }
            }
            return(oAirTicketRS);
        }