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); }
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_); }
public SabreCommandLLSRS getEjecutarComando(VO_SabreCommandLLSRS vo_SabreCommandLLSRS) { SabreCommandLLSRS SabreCommandRespuesta_ = new SabreCommandLLSRS(); MessageHeader srMensaje = clsSabreBase.SabreCommandLLS(); clsParametros cParametros = new clsParametros(); clsCache cCache = new csCache().cCache(); VO_Credentials objvo_Credentials; objvo_Credentials = clsSesiones.getCredentials(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; if (srMensaje != null) { Security Seguridad_ = new Security(); Seguridad_.BinarySecurityToken = StrSesion; SabreCommandLLSRQ SabreCommand_ = new SabreCommandLLSRQ(); SabreCommandLLSRQRequest oSabreCommandLLSRQRequest = new SabreCommandLLSRQRequest(); //oSabreCommandLLSRQRequest.Output = vo_SabreCommandLLSRS.ESalida; oSabreCommandLLSRQRequest.CDATA = vo_SabreCommandLLSRS.BCDATA; oSabreCommandLLSRQRequest.HostCommand = vo_SabreCommandLLSRS.StrComando; SabreCommand_.Request = oSabreCommandLLSRQRequest; SabreCommand_.Version = clsSabreBase.COMMANDLLS_VERSION; SabreCommandLLSService SabreCommandServicio_ = new SabreCommandLLSService(); SabreCommandServicio_.MessageHeaderValue = srMensaje; 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.ViewMessage.Add(""); cParametros.Sugerencia.Add(""); cParametros.Message = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorMessage; cParametros.Complemento = "SabreCommand"; cParametros.InnerException = "HostCommand: " + vo_SabreCommandLLSRS.StrComando; cParametros.TipoLog = Enum_Error.Log; try { cParametros.TargetSite = "Response: " + SabreCommandRespuesta_.Response; } 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("Session Sabre: " + strSesion.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.StackTrace = 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 "; } } catch { cParametros.Source = "Sesion Local: Error "; } ExceptionHandled.Publicar(cParametros); } else { //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE")) //{ cParametros.Id = 1; cParametros.Complemento = "SabreCommand"; cParametros.Message = "HostCommand: " + vo_SabreCommandLLSRS.StrComando; cParametros.Info = "Response: " + SabreCommandRespuesta_.Response; cParametros.Severity = clsSeveridad.Moderada; cParametros.Tipo = clsTipoError.WebServices; 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(); 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); //} } } return(SabreCommandRespuesta_); }