Esempio n. 1
0
    private static clsParametros Comando(string Comando_)
    {
        /*METODO BASE QUE SIRVE PARA EJECUTAR COMANDOS*/
        clsParametros cParametros = new clsParametros();

        try
        {
            clsSabreCommandLLS objClsSabreCommandLLS = new clsSabreCommandLLS();
            /*ASIGNAMOS LA SESSION DE SABRE*/
            objClsSabreCommandLLS.StrSesion = AutenticacionSabre.GET_SabreSession();

            if (objClsSabreCommandLLS.StrSesion != null)
            {
                WebService_SabreCommandLLS.SabreCommandLLSRS SabreCommandRespuesta_ = objClsSabreCommandLLS._Sabre_EjecutarComando(Comando_);

                if (SabreCommandRespuesta_ != null)
                {
                    if (SabreCommandRespuesta_.Response != null)
                    {
                        cParametros.Id          = 1;
                        cParametros.TipoLog     = Enum_Error.Transac;
                        cParametros.Message     = SabreCommandRespuesta_.Response;
                        cParametros.Tipo        = clsTipoError.Library;
                        cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
                        cParametros.Info        = "Comando Sabre: " + Comando_;
                        cParametros.Complemento = "Response: " + SabreCommandRespuesta_.Response;
                        ExceptionHandled.Publicar(cParametros);
                    }
                    else
                    {
                        WebService_SabreCommandLLS.SabreCommandLLSRSErrorRSErrorsError          SabreErrores_     = SabreCommandRespuesta_.ErrorRS.Errors.Error;
                        WebService_SabreCommandLLS.SabreCommandLLSRSErrorRSErrorsErrorErrorInfo SabreErroresInfo_ = SabreErrores_.ErrorInfo;

                        if (SabreErrores_ != null)
                        {
                            cParametros.Id          = 0;
                            cParametros.TipoLog     = Enum_Error.Log;
                            cParametros.Message     = SabreErrores_.ErrorMessage;
                            cParametros.Code        = SabreErrores_.ErrorCode;
                            cParametros.Info        = SabreErrores_.ErrorInfo.Message;
                            cParametros.Severity    = SabreErrores_.Severity;
                            cParametros.Tipo        = clsTipoError.Library;
                            cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
                            cParametros.Complemento = "Error al ejecutar Comando " + Comando_ + "  Sabre";
                            ExceptionHandled.Publicar(cParametros);
                            try
                            {
                                setEmailError(cParametros, "Error al ejecutar comando");
                            }
                            catch { }
                        }
                    }
                }
            }
            else
            {
                cParametros.Id       = 0;
                cParametros.Message  = "Sesion no iniciada al ejecutar Comando " + Comando_ + "  Sabre";
                cParametros.TipoLog  = Enum_Error.Log;
                cParametros.Severity = clsSeveridad.Alta;
                cParametros.Tipo     = clsTipoError.Library;
                cParametros.Metodo   = System.Reflection.MethodBase.GetCurrentMethod().Name;
                cParametros.ViewMessage.Add("Sesion de sabre no iniciada!!!");
                cParametros.Sugerencia.Add("Por favor verifique las credenciales!!!");
                ExceptionHandled.Publicar(cParametros);
                try
                {
                    setEmailError(cParametros, "Error al ejecutar comando");
                }
                catch { }
            }
        }
        catch (Exception Ex)
        {
            cParametros.Id          = 0;
            cParametros.Message     = Ex.Message.ToString();
            cParametros.Source      = Ex.Source.ToString();
            cParametros.TipoLog     = Enum_Error.Log;
            cParametros.Tipo        = clsTipoError.Library;
            cParametros.Severity    = clsSeveridad.Alta;
            cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
            cParametros.StackTrace  = Ex.StackTrace.ToString();
            cParametros.Complemento = "Error al ejecutar Comando " + Comando_ + "  Sabre";
            ExceptionHandled.Publicar(cParametros);
            if (cParametros.Message.Contains("limit of Host TAs allocated"))
            {
                cParametros.ViewMessage.Add("En este momento hay mas de 2000 usuarios consultado nuestras Promociones!!!");
                cParametros.Sugerencia.Add("Por favor intente de nuevo en 5 minutos!!!");
                clsSesiones.setParametrosError(cParametros);
                ExceptionHandled.Publicar(cParametros);
                Page PageActual = (Page)HttpContext.Current.Handler;
                clsValidaciones.RedirectPagina("ErrorBusqueda.aspx", true);
            }
            try
            {
                setEmailError(cParametros, "Error al Ejecutar Commando");
            }
            catch { }
        }
        return(cParametros);
    }
Esempio n. 2
0
        public WebService_SabreCommandLLS.SabreCommandLLSRS _Sabre_EjecutarComando(string Comando_)
        {
            WebService_SabreCommandLLS.SabreCommandLLSRS SabreCommandRespuesta_ = new WebService_SabreCommandLLS.SabreCommandLLSRS();
            clsParametros  cParametros = new clsParametros();
            VO_Credentials objvo_Credentials;

            objvo_Credentials  = clsSesiones.getCredentials();
            cParametros.TipoWs = Enum_ProveedorWebServices.Sabre;
            StringBuilder consulta = new StringBuilder();
            clsCache      cCache   = new csCache().cCache();

            try
            {
                WebService_SabreCommandLLS.MessageHeader Mensaje_ = WS_SsoftSabre.Air.clsSabreBase.SabreCommandLLS();

                if (Mensaje_ != null)
                {
                    WebService_SabreCommandLLS.Security Seguridad_ = new WebService_SabreCommandLLS.Security();
                    Seguridad_.BinarySecurityToken = strSesion;
                    WebService_SabreCommandLLS.SabreCommandLLSRQ        SabreCommand_      = new WebService_SabreCommandLLS.SabreCommandLLSRQ();
                    WebService_SabreCommandLLS.SabreCommandLLSRQRequest oSabreComandReques = new WS_SsoftSabre.SabreCommandLLS.SabreCommandLLSRQRequest();
                    oSabreComandReques.HostCommand = Comando_;
                    SabreCommand_.Request          = oSabreComandReques;
                    SabreCommand_.Version          = WS_SsoftSabre.Air.clsSabreBase.SABRE_VERSION_SABRECOMMANDLLS;
                    WebService_SabreCommandLLS.SabreCommandLLSService SabreCommandServicio_ = new WebService_SabreCommandLLS.SabreCommandLLSService();
                    SabreCommandServicio_.MessageHeaderValue = Mensaje_;
                    SabreCommandServicio_.SecurityValue      = Seguridad_;
                    SabreCommandServicio_.Url = objvo_Credentials.UrlWebServices;
                    SabreCommandRespuesta_    = SabreCommandServicio_.SabreCommandLLSRQ(SabreCommand_);

                    if (SabreCommandRespuesta_.ErrorRS != null)
                    {
                        cParametros.Id          = 0;
                        cParametros.Code        = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorCode;
                        cParametros.Info        = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorInfo.Message;
                        cParametros.Message     = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorMessage;
                        cParametros.Severity    = SabreCommandRespuesta_.ErrorRS.Errors.Error.Severity;
                        cParametros.Tipo        = clsTipoError.WebServices;
                        cParametros.Metodo      = System.Reflection.MethodBase.GetCurrentMethod().Name;
                        cParametros.Complemento = "";
                        cParametros.ViewMessage.Add("");
                        cParametros.Sugerencia.Add("");
                        cParametros.InnerException = "HostCommand: " + Comando_;
                        cParametros.TargetSite     = "Response: " + SabreCommandRespuesta_.Response;
                        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: " + strSesion.ToString());
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                            }
                        }
                        catch { }
                        cParametros.StackTrace = consulta.ToString();
                        try
                        {
                            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);
                    }
                    else
                    {
                        //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE"))
                        //{
                        cParametros.Id       = 1;
                        cParametros.Message  = "SabreCommand";
                        cParametros.Severity = clsSeveridad.Moderada;
                        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: " + strSesion.ToString());
                                consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                            }
                        }
                        catch { }
                        cParametros.StackTrace = consulta.ToString();
                        cParametros.Tipo       = clsTipoError.WebServices;
                        try
                        {
                            cParametros.Metodo     = System.Reflection.MethodBase.GetCurrentMethod().Name;
                            cParametros.StackTrace = "Session Sabre: " + strSesion.ToString();
                            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.TipoLog     = Enum_Error.Log;
                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 Comando " + Comando_ + "  Sabre";
                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: " + strSesion.ToString());
                        consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices);
                    }
                }
                catch { }
                cParametros.TargetSite = consulta.ToString();
                try
                {
                    cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                    if (cCache != null)
                    {
                        cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString();
                    }
                    else
                    {
                        cParametros.Source = "Sesion Local: No hay cache ";
                    }
                    cParametros.InnerException = "HostCommand: " + Comando_;
                    cParametros.TargetSite     = "Response: " + SabreCommandRespuesta_.Response;
                }
                catch
                {
                    cParametros.Source = "Sesion Local: Error ";
                }
                ExceptionHandled.Publicar(cParametros);
            }

            return(SabreCommandRespuesta_);
        }