示例#1
0
    public string _Sabre_CrearSesion()
    {
        string Session_ = null;

        Ssoft.ValueObjects.VO_Credentials objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();
        /*ASIGNAMOS LOS CRITERIOS BASICOS PARA CREAR LA SESSION*/
        VO_SessionCreateRQ vo_SessionCreateRQ = new VO_SessionCreateRQ(objvo_Credentials.User,
                                                                       objvo_Credentials.Password,
                                                                       objvo_Credentials.Ipcc,
                                                                       objvo_Credentials.Pcc,
                                                                       objvo_Credentials.Dominio
                                                                       );

        clsSessionCreateRQ objclsSessionCreateRQ = new clsSessionCreateRQ();

        Session_ = objclsSessionCreateRQ.getSesion(vo_SessionCreateRQ);
        VO_SabreCommandLLSRS vo = new VO_SabreCommandLLSRS();

        vo.BCDATA     = true;
        vo.StrComando = "AAA" + objvo_Credentials.Pcc;

        clsSabreCommandLLS oclsSabreCommandLLS = new clsSabreCommandLLS();

        oclsSabreCommandLLS.StrSesion = Session_;
        SabreCommandLLSRS respuesta = oclsSabreCommandLLS.getEjecutarComando(vo);

        return(Session_);
    }
 public VO_HotelDetailRQ(
     VO_Credentials vCredentials,
     string sHotelCode)
 {
     this.vCredentials = vCredentials;
     this.sHotelCode   = sHotelCode;
 }
 public VO_PurchaseReference(
     VO_Credentials vCredentials,
     string sFileNumber,
     string sIncomingOffice)
 {
     this.vCredentials    = vCredentials;
     this.sFileNumber     = sFileNumber;
     this.sIncomingOffice = sIncomingOffice;
 }
示例#4
0
 public VO_ServiceAddRQ(
     VO_Credentials vCredentials,
     string savailToken,
     string sContractName,
     string sIncomingOffice,
     string sDateFrom,
     string sDateTo,
     VO_HotelInfo vHotelInfo,
     List <VO_HotelOccupancy> lvHotelOccupancy,
     VO_HotelRoom vHotelRoom)
 {
     this.vCredentials     = vCredentials;
     this.savailToken      = savailToken;
     this.sContractName    = sContractName;
     this.sIncomingOffice  = sIncomingOffice;
     this.sDateFrom        = sDateFrom;
     this.sDateTo          = sDateTo;
     this.vHotelInfo       = vHotelInfo;
     this.lvHotelOccupancy = lvHotelOccupancy;
     this.vHotelRoom       = vHotelRoom;
 }
        public RulesFromPriceRS getRules(VO_RulesFromPriceRQ vo_RulesFromPriceRQ)
        {
            RulesFromPriceRS oRulesFromPriceRS = new RulesFromPriceRS();

            objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();
            MessageHeader strMensaje = clsSabreBase.RulesFromPrice();

            try
            {
                if (strMensaje != null)
                {
                    int iCountCategory = vo_RulesFromPriceRQ.LsRuleCategoryNumber.Count;
                    int iCountSegment  = vo_RulesFromPriceRQ.LvoSegmentSelect.Count;
                    RulesFromPriceRQ          oRulesFromPriceRQ = new RulesFromPriceRQ();
                    RulesFromPriceRQPOS       oPOS       = new RulesFromPriceRQPOS();
                    RulesFromPriceRQPOSSource oPOSSource = new RulesFromPriceRQPOSSource();

                    oPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"];
                    oPOS.Source           = oPOSSource;
                    oRulesFromPriceRQ.POS = oPOS;

                    //clase
                    RulesFromPriceRQRuleReqInfo                oRuleReqInfo              = new RulesFromPriceRQRuleReqInfo();
                    RulesFromPriceRQRuleReqInfoFareBasis       oRuleReqInfoFareBasis     = new RulesFromPriceRQRuleReqInfoFareBasis();
                    RulesFromPriceRQRuleReqInfoPassenger       oRuleReqInfoPassenger     = new RulesFromPriceRQRuleReqInfoPassenger();
                    RulesFromPriceRQRuleReqInfoRuleCategory[]  oRuleReqInfoRuleCategorys = new RulesFromPriceRQRuleReqInfoRuleCategory[iCountCategory];
                    RulesFromPriceRQRuleReqInfoRuleCategory    oRuleReqInfoRuleCategory  = new RulesFromPriceRQRuleReqInfoRuleCategory();
                    RulesFromPriceRQRuleReqInfoSegmentSelect[] oRuleReqInfoSegmentSelecs = new RulesFromPriceRQRuleReqInfoSegmentSelect[iCountSegment];
                    RulesFromPriceRQRuleReqInfoSegmentSelect   oRuleReqInfoSegmentSelec  = new RulesFromPriceRQRuleReqInfoSegmentSelect();

                    oRuleReqInfoPassenger.TypeNumber = vo_RulesFromPriceRQ.VPassenger.SCantidad;
                    oRuleReqInfoPassenger.Code       = vo_RulesFromPriceRQ.VPassenger.SCodigo;

                    for (int i = 0; i < iCountCategory; i++)
                    {
                        oRuleReqInfoRuleCategory.Number = vo_RulesFromPriceRQ.LsRuleCategoryNumber[i];
                        oRuleReqInfoRuleCategorys[i]    = oRuleReqInfoRuleCategory;
                    }

                    for (int i = 0; i < iCountSegment; i++)
                    {
                        oRuleReqInfoSegmentSelec.Number = vo_RulesFromPriceRQ.LvoSegmentSelect[i].SNumber;
                        //oRuleReqInfoSegmentSelec.EndNumber = vo_RulesFromPriceRQ.LvoSegmentSelect[i].SEndNumber;
                        oRuleReqInfoSegmentSelecs[i] = oRuleReqInfoSegmentSelec;
                    }

                    if (!vo_RulesFromPriceRQ.SFareBasisCode.Length.Equals(0))
                    {
                        oRuleReqInfoFareBasis.Code = vo_RulesFromPriceRQ.SFareBasisCode;
                    }

                    oRuleReqInfo.FareBasis     = oRuleReqInfoFareBasis;
                    oRuleReqInfo.Passenger     = oRuleReqInfoPassenger;
                    oRuleReqInfo.RuleCategory  = oRuleReqInfoRuleCategorys;
                    oRuleReqInfo.SegmentSelect = oRuleReqInfoSegmentSelecs;

                    oRulesFromPriceRQ.RuleReqInfo = oRuleReqInfo;

                    RulesFromPriceRQTPA_Extensions oTPA_Extensions = new RulesFromPriceRQTPA_Extensions();
                    RulesFromPriceRQTPA_ExtensionsMessagingDetails          oTPA_ExtensionsMessagingDetails          = new RulesFromPriceRQTPA_ExtensionsMessagingDetails();
                    RulesFromPriceRQTPA_ExtensionsMessagingDetailsMDRSubset oTPA_ExtensionsMessagingDetailsMDRSubset = new RulesFromPriceRQTPA_ExtensionsMessagingDetailsMDRSubset();

                    if (!vo_RulesFromPriceRQ.SMDRSubset.Length.Equals(0))
                    {
                        oTPA_ExtensionsMessagingDetailsMDRSubset.Code = vo_RulesFromPriceRQ.SMDRSubset;
                    }

                    oTPA_ExtensionsMessagingDetails.MDRSubset = oTPA_ExtensionsMessagingDetailsMDRSubset;
                    oTPA_Extensions.MessagingDetails          = oTPA_ExtensionsMessagingDetails;

                    oRulesFromPriceRQ.TPA_Extensions = oTPA_Extensions;

                    oRulesFromPriceRQ.Version = clsSabreBase.RULES_FROM_PRICE_VERSION;

                    Security oSecurity = new Security();
                    oSecurity.BinarySecurityToken = strSesion;

                    RulesFromPriceService oRulesFromPriceService = new RulesFromPriceService();
                    oRulesFromPriceService.MessageHeaderValue = strMensaje;
                    oRulesFromPriceService.SecurityValue      = oSecurity;
                    oRulesFromPriceRS = oRulesFromPriceService.RulesFromPriceRQ(oRulesFromPriceRQ);
                }
                if (oRulesFromPriceRS.Errors != null)
                {
                    //clsParametros cMensaje = new clsParametros();
                    //cMensaje.Id = 0;
                    //cMensaje.Code = oRulesFromPriceRS.Errors.Error.ErrorCode;
                    //cMensaje.Info = oRulesFromPriceRS.Errors.Error.ErrorInfo.Message;
                    //cMensaje.Message = oRulesFromPriceRS.Errors.Error.ErrorMessage;
                    //cMensaje.Severity = oRulesFromPriceRS.Errors.Error.Severity;
                    //cMensaje.Tipo = clsTipoError.WebServices;
                    //cMensaje.Metodo = "RulesFromPriceRS";
                    //cMensaje.Complemento = "Reglas de tarifas aereas";
                    //ExceptionHandled.Publicar(cMensaje);
                }
            }
            catch
            {
                //clsParametros cMensaje = new clsParametros();
                //cMensaje.Id = 0;
                //cMensaje.Message = Ex.Message;
                //cMensaje.Severity = clsSeveridad.Alta;
                //cMensaje.Tipo = clsTipoError.WebServices;
                //cMensaje.Metodo = "RulesFromPriceRS";
                //cMensaje.Complemento = "Reglas de tarifas aereas";
                //cMensaje.Source = Ex.Source;
                //cMensaje.StackTrace = Ex.StackTrace;
                //ExceptionHandled.Publicar(cMensaje);
            }
            return(oRulesFromPriceRS);
        }
示例#6
0
 public static void setQP(String sReserva)
 {
     Ssoft.ValueObjects.VO_Credentials objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();
     setQP(sReserva, objvo_Credentials.QNumber);
 }
        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_);
        }
示例#9
0
    public clsParametros _Sabre_AgregarObservaciones(Enum_TipoRemark TypeRemark_, List <string> ListTextRemark_)
    {
        WebService_AddRemarkLLS.AddRemarkRS RemarkResultado_ = new WebService_AddRemarkLLS.AddRemarkRS();
        clsParametros cParametros = new clsParametros();

        objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();
        StringBuilder consulta = new StringBuilder();

        cParametros.TipoWs = Enum_ProveedorWebServices.Sabre;

        try
        {
            WebService_AddRemarkLLS.MessageHeader Mensaje_ = clsSabreBase.__ISabre_AddRemarkLLSRQ();

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

                WebService_AddRemarkLLS.AddRemarkRQ          Remark_       = new WebService_AddRemarkLLS.AddRemarkRQ();
                WebService_AddRemarkLLS.AddRemarkRQPOS       RemarkPos_    = new WebService_AddRemarkLLS.AddRemarkRQPOS();
                WebService_AddRemarkLLS.AddRemarkRQPOSSource RemarkSource_ = new WebService_AddRemarkLLS.AddRemarkRQPOSSource();
                // pcc viejo
                //RemarkSource_.PseudoCityCode = ConfigurationManager.AppSettings["Sabre_Ipcc"];
                RemarkSource_.PseudoCityCode = objvo_Credentials.Pcc;
                RemarkPos_.Source            = RemarkSource_;
                Remark_.POS = RemarkPos_;

                #region [ Tipo Remark ]

                switch (TypeRemark_)
                {
                    #region " Libre "

                case Enum_TipoRemark.Libre:

                    List <WebService_AddRemarkLLS.AddRemarkRQBasicRemark> ListBasikRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQBasicRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQBasicRemark BasikRemark_ = new WebService_AddRemarkLLS.AddRemarkRQBasicRemark("X/-" + TextRemark_);
                        ListBasikRemark_.Add(BasikRemark_);
                    }

                    Remark_.BasicRemark = ListBasikRemark_.ToArray();

                    break;

                    #endregion

                    #region " Compuesto "

                case Enum_TipoRemark.Compuesto:

                    List <WebService_AddRemarkLLS.AddRemarkRQAlphaCodedRemark> ListAlphaCodedRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQAlphaCodedRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQAlphaCodedRemark AlphaCodedRemark_ = new WebService_AddRemarkLLS.AddRemarkRQAlphaCodedRemark("H", TextRemark_);
                        ListAlphaCodedRemark_.Add(AlphaCodedRemark_);
                    }

                    Remark_.AlphaCodedRemark = ListAlphaCodedRemark_.ToArray();

                    break;

                    #endregion

                    #region " Direccion Cliente "

                case Enum_TipoRemark.DireccionCliente:

                    List <WebService_AddRemarkLLS.AddRemarkRQClientAddressRemark> ListClientAddressRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQClientAddressRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQClientAddressRemark ClientAddressRemark_ = new WebService_AddRemarkLLS.AddRemarkRQClientAddressRemark(TextRemark_);
                        ListClientAddressRemark_.Add(ClientAddressRemark_);
                    }

                    Remark_.ClientAddressRemark = ListClientAddressRemark_.ToArray();

                    break;

                    #endregion

                    #region " Direccion "

                case Enum_TipoRemark.Direccion:

                    List <WebService_AddRemarkLLS.AddRemarkRQDeliveryAddressRemark> ListDeliveryAddressRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQDeliveryAddressRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQDeliveryAddressRemark DeliveryAddressRemark_ = new WebService_AddRemarkLLS.AddRemarkRQDeliveryAddressRemark(TextRemark_);
                        ListDeliveryAddressRemark_.Add(DeliveryAddressRemark_);
                    }

                    Remark_.DeliveryAddressRemark = ListDeliveryAddressRemark_.ToArray();

                    break;

                    #endregion

                    #region " Impresion "

                case Enum_TipoRemark.Impresion:

                    List <WebService_AddRemarkLLS.AddRemarkRQInvoiceRemark> ListInvoiceRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQInvoiceRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQInvoiceRemark InvoiceRemark_ = new WebService_AddRemarkLLS.AddRemarkRQInvoiceRemark(TextRemark_);
                        ListInvoiceRemark_.Add(InvoiceRemark_);
                    }

                    Remark_.InvoiceRemark = ListInvoiceRemark_.ToArray();

                    break;

                    #endregion

                    #region " Simple "

                case Enum_TipoRemark.Simple:

                    List <WebService_AddRemarkLLS.AddRemarkRQItineraryRemark> ListItineraryRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQItineraryRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQItineraryRemark ItineraryRemark_ = new WebService_AddRemarkLLS.AddRemarkRQItineraryRemark(TextRemark_);
                        ListItineraryRemark_.Add(ItineraryRemark_);
                    }

                    Remark_.ItineraryRemark = ListItineraryRemark_.ToArray();

                    break;

                    #endregion

                    #region " Grupo "

                case Enum_TipoRemark.Grupo:

                    List <WebService_AddRemarkLLS.AddRemarkRQGroupNameRemark> ListGroupNameRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQGroupNameRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQGroupNameRemark GroupNameRemark_ = new WebService_AddRemarkLLS.AddRemarkRQGroupNameRemark(TextRemark_);
                        ListGroupNameRemark_.Add(GroupNameRemark_);
                    }

                    Remark_.GroupNameRemark = ListGroupNameRemark_.ToArray();

                    break;

                    #endregion

                    #region " Historico "

                case Enum_TipoRemark.Historico:

                    List <WebService_AddRemarkLLS.AddRemarkRQHistoricalRemark> ListHistoricalRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQHistoricalRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQHistoricalRemark HistoricalRemark_ = new WebService_AddRemarkLLS.AddRemarkRQHistoricalRemark(TextRemark_);
                        ListHistoricalRemark_.Add(HistoricalRemark_);
                    }

                    Remark_.HistoricalRemark = ListHistoricalRemark_.ToArray();

                    break;

                    #endregion

                    #region " Oculto "

                case Enum_TipoRemark.Oculto:

                    List <WebService_AddRemarkLLS.AddRemarkRQHiddenRemark> ListHiddenRemark_ = new List <WebService_AddRemarkLLS.AddRemarkRQHiddenRemark>();

                    foreach (string TextRemark_ in ListTextRemark_)
                    {
                        WebService_AddRemarkLLS.AddRemarkRQHiddenRemark HiddenRemark_ = new WebService_AddRemarkLLS.AddRemarkRQHiddenRemark(TextRemark_);
                        ListHiddenRemark_.Add(HiddenRemark_);
                    }

                    Remark_.HiddenRemark = ListHiddenRemark_.ToArray();

                    break;

                    #endregion
                }

                #endregion

                Remark_.Version = clsSabreBase.SABRE_VERSION_ADDREMARK;

                WebService_AddRemarkLLS.AddRemarkService Servicio_ = new WebService_AddRemarkLLS.AddRemarkService();

                Servicio_.MessageHeaderValue = Mensaje_;
                Servicio_.SecurityValue      = Seguridad_;

                RemarkResultado_ = Servicio_.AddRemarkRQ(Remark_);

                if (RemarkResultado_.Errors != null)
                {
                    WebService_AddRemarkLLS.AddRemarkRSErrorsError          Error_     = RemarkResultado_.Errors.Error;
                    WebService_AddRemarkLLS.AddRemarkRSErrorsErrorErrorInfo ErrorInfo_ = Error_.ErrorInfo;

                    cParametros.Id          = 0;
                    cParametros.TipoLog     = Enum_Error.Transac;
                    cParametros.Code        = RemarkResultado_.Errors.Error.ErrorCode;
                    cParametros.Info        = RemarkResultado_.Errors.Error.ErrorInfo.Message;
                    cParametros.Message     = RemarkResultado_.Errors.Error.ErrorMessage;
                    cParametros.Severity    = RemarkResultado_.Errors.Error.Severity;
                    cParametros.Tipo        = clsTipoError.WebServices;
                    cParametros.Metodo      = "Remarks";
                    cParametros.Complemento = "HostCommand: " + RemarkResultado_.TPA_Extensions.HostCommand;
                    cParametros.Message     = RemarkResultado_.Errors.Error.ErrorMessage;
                    ExceptionHandled.Publicar(cParametros);
                    cParametros.TipoLog = Enum_Error.Log;
                    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());
                        }
                    }
                    catch { }
                    cParametros.StackTrace = consulta.ToString();
                    ExceptionHandled.Publicar(cParametros);
                }
                else
                {
                    cParametros.Id      = 1;
                    cParametros.TipoLog = Enum_Error.Transac;
                    cParametros.Message = "Response: " + RemarkResultado_.Success.ToString();
                    cParametros.Metodo  = "_Remark_Observaciones";
                    try
                    {
                        cParametros.Complemento = "HostCommand: " + RemarkResultado_.TPA_Extensions.HostCommand;
                    }
                    catch { }
                    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());
                        }
                    }
                    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);
                    cParametros.TipoLog = Enum_Error.Log;
                    ExceptionHandled.Publicar(cParametros);
                }
            }
        }
        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";
            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());
                }
            }
            catch { }
            cParametros.TargetSite = consulta.ToString();
            ExceptionHandled.Publicar(cParametros);
        }
        return(cParametros);
    }
示例#10
0
        public DisplayPriceQuoteRS getTarifa()
        {
            /*METODO PRINCICPAL QUE RETORNA EL OBJETO DE RESULTADOS DE SABRE*/
            clsParametros cParametros = new clsParametros();
            csVuelos      cVuelos     = new csVuelos();

            DisplayPriceQuoteRQ oDisplayPriceQuoteRQ = new DisplayPriceQuoteRQ();
            DisplayPriceQuoteRS oDisplayPriceQuoteRS = new DisplayPriceQuoteRS();

            objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials();

            try
            {
                DisplayPriceQuote.MessageHeader Mensaje_ = clsSabreBase.DisplayPriceQuote();

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

                    #region [ POS ]
                    DisplayPriceQuoteRQPOS       oDisplayPriceQuoteRQPOS       = new DisplayPriceQuoteRQPOS();
                    DisplayPriceQuoteRQPOSSource oDisplayPriceQuoteRQPOSSource = new DisplayPriceQuoteRQPOSSource();

                    oDisplayPriceQuoteRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"];
                    oDisplayPriceQuoteRQPOS.Source = oDisplayPriceQuoteRQPOSSource;
                    oDisplayPriceQuoteRQ.POS       = oDisplayPriceQuoteRQPOS;
                    #endregion

                    #region [ VERSION ]
                    oDisplayPriceQuoteRQ.Version = clsSabreBase.SABRE_VERSION_DISPLAYPRICE;
                    #endregion

                    #region [ RESERVA ]
                    DisplayPriceQuoteRQAirItineraryPricingInfo       AirItineraryPricingInfo       = new DisplayPriceQuoteRQAirItineraryPricingInfo();
                    DisplayPriceQuoteRQAirItineraryPricingInfoRecord AirItineraryPricingInfoRecord = new DisplayPriceQuoteRQAirItineraryPricingInfoRecord();


                    #endregion

                    DisplayPriceQuoteService oDisplayPriceQuoteService = new DisplayPriceQuoteService();

                    oDisplayPriceQuoteService.MessageHeaderValue = Mensaje_;
                    oDisplayPriceQuoteService.SecurityValue      = Seguridad_;

                    oDisplayPriceQuoteRS = oDisplayPriceQuoteService.DisplayPriceQuoteRQ(oDisplayPriceQuoteRQ);
                    if (oDisplayPriceQuoteRS.Errors != null)
                    {
                        cParametros.Id          = 0;
                        cParametros.Code        = oDisplayPriceQuoteRS.Errors.Error.ErrorCode;
                        cParametros.Info        = oDisplayPriceQuoteRS.Errors.Error.ErrorInfo.Message;
                        cParametros.Message     = oDisplayPriceQuoteRS.Errors.Error.ErrorMessage;
                        cParametros.Severity    = oDisplayPriceQuoteRS.Errors.Error.Severity;
                        cParametros.Complemento = "HostCommand: " + oDisplayPriceQuoteRS.TPA_Extensions.HostCommand;
                        cParametros.Metodo      = "getBusqueda";
                        cParametros.Tipo        = clsTipoError.WebServices;
                        ExceptionHandled.Publicar(cParametros);
                    }
                    else
                    {
                        cParametros.Id          = 1;
                        cParametros.TipoLog     = Enum_Error.Transac;
                        cParametros.Message     = oDisplayPriceQuoteRS.Success;
                        cParametros.Metodo      = "_Remark_Observaciones";
                        cParametros.Complemento = "HostCommand: " + oDisplayPriceQuoteRS.TPA_Extensions.HostCommand;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Severity    = clsSeveridad.Moderada;
                        try
                        {
                            cParametros.Info = "Session Sabre: " + Session_.ToString();
                            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);
                        cParametros.TipoLog = Enum_Error.Log;
                    }
                }
            }
            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     = "getBusqueda";
                cParametros.Tipo       = clsTipoError.WebServices;
                ExceptionHandled.Publicar(cParametros);
            }
            return(oDisplayPriceQuoteRS);
        }