public string getRulesCommand() { string sRespuesta = string.Empty; try { clsParametros cParametros = new clsParametros(); cParametros.Message = "Entra getRulesCommand"; cParametros.Complemento = "Reserva Vuelos"; ExceptionHandled.Publicar(cParametros); VO_SabreCommandLLSRS vo = new VO_SabreCommandLLSRS(); vo.BCDATA = true; vo.StrComando = "WPRD*PADT¥C2/15/16/19/22¥S1"; clsSabreCommandLLS oclsSabreCommandLLS = new clsSabreCommandLLS(); oclsSabreCommandLLS.StrSesion = strSesion; WS_SsoftSabre.SabreCommandLLS.SabreCommandLLSRS respuesta = oclsSabreCommandLLS.getEjecutarComando(vo); int iPosIni = respuesta.Response.IndexOf("02.DAY/TIME"); if (iPosIni == -1) { iPosIni = 0; } //int iPosFin = respuesta.Response.Length; sRespuesta = respuesta.Response.Remove(0, iPosIni); } catch { } return(sRespuesta); }
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 clsParametros getRulesSegment() { clsParametros objParametros = new clsParametros(); VO_SabreCommandLLSRS vo = new VO_SabreCommandLLSRS(); DateTime dtm_Fecha_Segmento = DateTime.Now; /*SE SUMAN LOS 330 DIAS*/ int iDias = 330; 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 { 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; } String str_Comando = "0OTHAAGK1BOG" + str_Dia + str_Mes_Letras.ToUpper(); vo.BCDATA = true; vo.StrComando = str_Comando; clsSabreCommandLLS oclsSabreCommandLLS = new clsSabreCommandLLS(); oclsSabreCommandLLS.StrSesion = strSesion; WS_SsoftSabre.SabreCommandLLS.SabreCommandLLSRS respuesta = oclsSabreCommandLLS.getEjecutarComando(vo); if (respuesta.ErrorRS != null) { objParametros.Id = 0; objParametros.Code = respuesta.ErrorRS.Errors.Error.ErrorCode; objParametros.Info = respuesta.ErrorRS.Errors.Error.ErrorInfo.Message; objParametros.Message = respuesta.ErrorRS.Errors.Error.ErrorMessage; objParametros.Severity = respuesta.ErrorRS.Errors.Error.Severity; objParametros.Metodo = "clsRulesFromPrice.getRulesSegment()"; objParametros.Tipo = Ssoft.ManejadorExcepciones.clsTipoError.WebServices; Ssoft.ManejadorExcepciones.ExceptionHandled.Publicar(objParametros); } else { objParametros.Id = 1; objParametros.Message = respuesta.Response; objParametros.DatoAdic = respuesta.AltLangID; objParametros.DatoAdicArr.Add(respuesta.EchoToken); objParametros.Data = respuesta.PrimaryLangID; objParametros.Metodo = "clsRulesFromPrice.getRulesSegment()"; Ssoft.ManejadorExcepciones.ExceptionHandled.Publicar(objParametros); } } return(objParametros); }
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); }
public static string _CrearSesion() { string Session_ = null; clsCache cCache = new csCache().cCache(); StringBuilder consulta = new StringBuilder(); clsParametros cParametros = new clsParametros(); VO_Credentials objvo_Credentials = clsSesiones.getCredentials(); string sMensaje = clsValidaciones.GetKeyOrAdd("sMensajeSesionSabre", "En este momento hay mas de 2000 personas consultado nuestras Promociones!!!"); string sSugerencia = clsValidaciones.GetKeyOrAdd("sSugerenciaSesionSabre", "Por favor intente de nuevo en 5 minutos!!!"); try { /*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(); try { Session_ = objclsSessionCreateRQ.getSesion(vo_SessionCreateRQ); } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message.ToString(); cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Moderada; cParametros.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = "_CrearSesion"; cParametros.Info = cParametros.Message; consulta.AppendLine("Credenciales: "); try { 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("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.StackTrace = consulta.ToString(); try { if (Session_ != null) { if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } } catch { cParametros.Source = "Sesion Local: Error "; } try { if (cCache != null) { cParametros.ErrorConfigura[0] = cCache.Empresa; } else { cParametros.ErrorConfigura[0] = "0"; } } catch { } if (cParametros.Message.Contains("limit of Host TAs allocated")) { cParametros.ViewMessage.Add(sMensaje); cParametros.Sugerencia.Add(sSugerencia); cParametros.Code = "109"; } else { cParametros.Code = "106"; } cParametros.ValidaInfo = false; clsSesiones.setParametrosError(cParametros); ExceptionHandled.Publicar(cParametros); clsValidaciones.RedirectPagina("ErrorBusqueda.aspx", true); } 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); //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE")) //{ 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.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = "Ejecucion del comando AAA y perfil de agencia"; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Baja; cParametros.TargetSite = "Comando: " + vo.StrComando; cParametros.StackTrace = "Respuesta" + respuesta.Response; cParametros.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = consulta.ToString(); try { if (Session_ != null) { cParametros.Info = "Session Sabre: " + Session_.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) { 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.Id = 0; cParametros.TipoLog = Enum_Error.Log; cParametros.Message = Ex.Message.ToString(); cParametros.Source = Ex.Source.ToString(); cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Alta; cParametros.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = consulta.ToString(); cParametros.Info = cParametros.Message; try { if (cCache != null) { cParametros.ErrorConfigura[0] = cCache.Empresa; } else { cParametros.ErrorConfigura[0] = "0"; } } catch { } if (cParametros.Message.Contains("limit of Host TAs allocated")) { cParametros.ViewMessage.Add(sMensaje); cParametros.Sugerencia.Add(sSugerencia); cParametros.Code = "109"; } else { cParametros.Code = "106"; } cParametros.ValidaInfo = false; cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; clsSesiones.setParametrosError(cParametros); ExceptionHandled.Publicar(cParametros); clsValidaciones.RedirectPagina("ErrorBusqueda.aspx", true); } return(Session_); }