public static VO_Credentials Credenciales(Enum_ProveedorWebServices eWebServices) { VO_Credentials vo_Credentials = new VO_Credentials(); try { switch (eWebServices) { case Enum_ProveedorWebServices.Sabre: vo_Credentials = clsConfiguracionSabre.Credentials(); break; case Enum_ProveedorWebServices.POL: vo_Credentials = clsConfiguracionPOL.Credentials(); break; case Enum_ProveedorWebServices.TotalTrip: vo_Credentials = clsConfiguracionTotalTrip.Credentials(); break; default: break; } } catch { } return(vo_Credentials); }
public void getServices(DataSet dsResultados) { clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); try { HotelInfoRQ oHotelInfoRQ = new HotelInfoRQ(); HotelInfoRS oHotelInfoRS = new HotelInfoRS(); DataTable dtData = dsResultados.Tables[clsEsquema.TABLA_HOTEL_INFO]; int iTotal = dtData.Rows.Count; int[] iHotelCodes = new int[iTotal]; int i = 0; string sCodeHotel = clsEsquema.COLUMN_HOTELCODE; string sCodeCity = string.Empty; try { sCodeCity = dtData.Rows[0][clsEsquema.COLUMN_DESTINATION_CODE].ToString(); } catch { } foreach (DataRow drData in dtData.Rows) { iHotelCodes[i] = int.Parse(drData[sCodeHotel].ToString()); i++; } oHotelInfoRQ.CityCode = sCodeCity; oHotelInfoRQ.HotelCodes = iHotelCodes; oHotelInfoRQ.Username = vo_Credentials.LoginUser; oHotelInfoRQ.Password = vo_Credentials.PasswordUser; HotelInfoService oHotelInfoService = new HotelInfoService(); oHotelInfoService.Url = clsEsquema.setConexionWs(oHotelInfoService.Url); oHotelInfoRS = oHotelInfoService.GetHotelInfos(oHotelInfoRQ); new clsEsquema().GetDatasetHotelInfo(dsResultados, oHotelInfoRS); } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Resultados de Hoteles"; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "0"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; ExceptionHandled.Publicar(cParametros); } }
public static OTA_AirAvail.MessageHeader __ISabre_OTA_AirAvailLLSRQ() { OTA_AirAvail.MessageHeader Mensaje_ = new OTA_AirAvail.MessageHeader(); VO_Credentials objvo_Credentials = clsSesiones.getCredentials(); try { Mensaje_.ConversationId = objvo_Credentials.Conversacion;//"*****@*****.**" DateTime Fecha_ = DateTime.UtcNow; string Tiempo_ = Fecha_.ToString("s") + "Z"; OTA_AirAvail.From Desde_ = new OTA_AirAvail.From(); OTA_AirAvail.PartyId DesdePartyID_ = new OTA_AirAvail.PartyId(); OTA_AirAvail.PartyId[] DesdePartyIdArray_ = new OTA_AirAvail.PartyId[1]; DesdePartyID_.Value = "99999"; DesdePartyIdArray_[0] = DesdePartyID_; Desde_.PartyId = DesdePartyIdArray_; Mensaje_.From = Desde_; OTA_AirAvail.To A_ = new OTA_AirAvail.To(); OTA_AirAvail.PartyId APartyID_ = new OTA_AirAvail.PartyId(); OTA_AirAvail.PartyId[] APartyIdArray_ = new OTA_AirAvail.PartyId[1]; APartyID_.Value = "123123"; APartyIdArray_[0] = APartyID_; A_.PartyId = APartyIdArray_; Mensaje_.To = A_; //------------------------------------------------------------------------------------- OTA_AirAvail.Service Servicio_ = new OTA_AirAvail.Service(); OTA_AirAvail.MessageData MensajeDatos_ = new OTA_AirAvail.MessageData(); Mensaje_.CPAId = objvo_Credentials.Ipcc; Mensaje_.Action = "OTA_AirAvailLLSRQ"; Servicio_.Value = "Low Fare Search"; Servicio_.type = "sabreXML"; Mensaje_.Service = Servicio_; MensajeDatos_.MessageId = objvo_Credentials.Mensaje;//"cf5d80f2-575e-4969-b30e-84a1f0a18cb1@34" //MensajeDatos_.RefToMessageId = "mid:[email protected]"; MensajeDatos_.Timestamp = Tiempo_; Mensaje_.MessageData = MensajeDatos_; } catch (Exception Ex) { throw Ex; } return(Mensaje_); }
public static OTA_AirLowFareSearch.MessageHeader __ISabre_OTA_AirLowFareSearchLLSRQ() { OTA_AirLowFareSearchRQ.MessageHeader Mensaje_ = new OTA_AirLowFareSearchRQ.MessageHeader(); VO_Credentials objvo_Credentials = clsSesiones.getCredentials(); try { Mensaje_.ConversationId = objvo_Credentials.Conversacion; DateTime Fecha_ = DateTime.UtcNow; string Tiempo_ = Fecha_.ToString("s") + "Z"; OTA_AirLowFareSearchRQ.From Desde_ = new OTA_AirLowFareSearchRQ.From(); OTA_AirLowFareSearchRQ.PartyId DesdePartyID_ = new OTA_AirLowFareSearchRQ.PartyId(); OTA_AirLowFareSearchRQ.PartyId[] DesdePartyIdArray_ = new OTA_AirLowFareSearchRQ.PartyId[1]; DesdePartyID_.Value = "99999"; DesdePartyIdArray_[0] = DesdePartyID_; Desde_.PartyId = DesdePartyIdArray_; Mensaje_.From = Desde_; OTA_AirLowFareSearchRQ.To A_ = new OTA_AirLowFareSearchRQ.To(); OTA_AirLowFareSearchRQ.PartyId APartyID_ = new OTA_AirLowFareSearchRQ.PartyId(); OTA_AirLowFareSearchRQ.PartyId[] APartyIdArray_ = new OTA_AirLowFareSearchRQ.PartyId[1]; APartyID_.Value = "123123"; APartyIdArray_[0] = APartyID_; A_.PartyId = APartyIdArray_; Mensaje_.To = A_; //------------------------------------------------------------------------------------- OTA_AirLowFareSearchRQ.Service Servicio_ = new OTA_AirLowFareSearchRQ.Service(); OTA_AirLowFareSearchRQ.MessageData MensajeDatos_ = new OTA_AirLowFareSearchRQ.MessageData(); Mensaje_.CPAId = objvo_Credentials.Ipcc; Mensaje_.Action = "OTA_AirLowFareSearchLLSRQ"; Servicio_.Value = "OTA_AirLowFareSearchRQ."; Servicio_.type = "sabreXML"; Mensaje_.Service = Servicio_; MensajeDatos_.MessageId = objvo_Credentials.Mensaje; MensajeDatos_.Timestamp = Tiempo_; Mensaje_.MessageData = MensajeDatos_; } catch (Exception Ex) { throw Ex; } return(Mensaje_); }
public static WebService_AddRemarkLLS.MessageHeader __ISabre_AddRemarkLLSRQ() { WebService_AddRemarkLLS.MessageHeader Mensaje_ = new WebService_AddRemarkLLS.MessageHeader(); try { VO_Credentials objvo_Credentials = clsSesiones.getCredentials(); Mensaje_.ConversationId = objvo_Credentials.Conversacion; DateTime Fecha_ = DateTime.UtcNow; string Tiempo_ = Fecha_.ToString("s") + "Z"; WebService_AddRemarkLLS.From Desde_ = new WebService_AddRemarkLLS.From(); WebService_AddRemarkLLS.PartyId DesdePartyID_ = new WebService_AddRemarkLLS.PartyId(); WebService_AddRemarkLLS.PartyId[] DesdePartyIdArray_ = new WebService_AddRemarkLLS.PartyId[1]; DesdePartyID_.Value = "99999"; DesdePartyIdArray_[0] = DesdePartyID_; Desde_.PartyId = DesdePartyIdArray_; Mensaje_.From = Desde_; WebService_AddRemarkLLS.To A_ = new WebService_AddRemarkLLS.To(); WebService_AddRemarkLLS.PartyId APartyID_ = new WebService_AddRemarkLLS.PartyId(); WebService_AddRemarkLLS.PartyId[] APartyIdArray_ = new WebService_AddRemarkLLS.PartyId[1]; APartyID_.Value = "123123"; APartyIdArray_[0] = APartyID_; A_.PartyId = APartyIdArray_; Mensaje_.To = A_; //------------------------------------------------------------------------------------- WebService_AddRemarkLLS.Service Servicio_ = new WebService_AddRemarkLLS.Service(); WebService_AddRemarkLLS.MessageData MensajeDatos_ = new WebService_AddRemarkLLS.MessageData(); Mensaje_.CPAId = objvo_Credentials.Ipcc; Mensaje_.Action = "AddRemarkLLSRQ"; Servicio_.Value = "AddRemark"; Mensaje_.Service = Servicio_; MensajeDatos_.MessageId = objvo_Credentials.Mensaje; MensajeDatos_.Timestamp = Tiempo_; Mensaje_.MessageData = MensajeDatos_; } catch (Exception Ex) { throw Ex; } return(Mensaje_); }
public VO_PurchaseConfirmRQ( VO_Credentials vCredentials, VO_Holder vHolder, string spurchaseToken, string sAgencyReference, List <VO_ServiceData> lvServiceData) { this.vCredentials = vCredentials; this.vHolder = vHolder; this.spurchaseToken = spurchaseToken; this.sAgencyReference = sAgencyReference; this.lvServiceData = lvServiceData; }
public VO_HotelValuedAvailRQ( VO_Credentials vCredentials, string sPaginationData, string sCheckInDate, string sCheckOutDate, string sDestination, List <VO_HotelOccupancy> vlHotelOccupancy) { this.vCredentials = vCredentials; this.sPaginationData = sPaginationData; this.sCheckInDate = sCheckInDate; this.sCheckOutDate = sCheckOutDate; this.sDestination = sDestination; this.vlHotelOccupancy = vlHotelOccupancy; }
public XmlDocument Credenciales(XmlDocument xmlDoc, VO_Credentials vo_Credentials, string sRQ, bool bSession) { clsSerializer cDataXml = new clsSerializer(); try { if (bSession) { xmlDoc = cDataXml.AsignarAtrributo(xmlDoc, "sessionId", sRQ, vo_Credentials.SessionId); } } catch { } xmlDoc = cDataXml.AsignarParametro(xmlDoc, "User", vo_Credentials.User); xmlDoc = cDataXml.AsignarParametro(xmlDoc, "Password", vo_Credentials.Password); xmlDoc = cDataXml.AsignarParametro(xmlDoc, "Language", vo_Credentials.Language); return(xmlDoc); }
/// <summary> /// Obtiene si el codigo de la ciudad login es especificacdo. /// </summary> public static VO_Credentials Credentials() { VO_Credentials vo_Credentials = new VO_Credentials(); clsParametros cParametros = new clsParametros(); //bool bCredentials = false; try { vo_Credentials.LoginUser = clsConfiguracionTotalTrip.LoginUser; vo_Credentials.PasswordUser = clsConfiguracionTotalTrip.PasswordUser; vo_Credentials.User = clsConfiguracionTotalTrip.Pcc; vo_Credentials.UrlWebServices = clsConfiguracionTotalTrip.UrlWebService; } catch { } return(vo_Credentials); }
/// <summary> /// Obtiene si el codigo de la ciudad login es especificacdo. /// </summary> public static VO_Credentials Credentials() { VO_Credentials vo_Credentials = new VO_Credentials(); clsParametros cParametros = new clsParametros(); bool bCredentials = false; vo_Credentials.UrlWebServices = clsConfiguracionPOL.UrlPago; vo_Credentials.Prueba = clsConfiguracionPOL.Prueba; try { vo_Credentials.User = clsConfiguracionPOL.Usuario; vo_Credentials.PlantillaVisa = clsConfiguracionPOL.PlantillaVisa; vo_Credentials.PlantillaDiners = clsConfiguracionPOL.PlantillaDiners; vo_Credentials.PlantillaAmex = clsConfiguracionPOL.PlantillaAmex; vo_Credentials.PlantillaMaster = clsConfiguracionPOL.PlantillaMaster; vo_Credentials.PlantillaPse = clsConfiguracionPOL.PlantillaPSE; vo_Credentials.Extra2 = clsConfiguracionPOL.Extra2; vo_Credentials.CiudadEnvio = clsConfiguracionPOL.CiudadEnvio; vo_Credentials.DireccionEnvio = clsConfiguracionPOL.DireccionEnvio; } catch { if (!bCredentials) { try { vo_Credentials.User = clsConfiguracionPOL.Usuario; vo_Credentials.PlantillaVisa = clsConfiguracionPOL.PlantillaVisa; vo_Credentials.PlantillaDiners = clsConfiguracionPOL.PlantillaDiners; vo_Credentials.PlantillaAmex = clsConfiguracionPOL.PlantillaAmex; vo_Credentials.PlantillaMaster = clsConfiguracionPOL.PlantillaMaster; vo_Credentials.PlantillaPse = clsConfiguracionPOL.PlantillaPSE; vo_Credentials.Extra2 = clsConfiguracionPOL.Extra2; vo_Credentials.CiudadEnvio = clsConfiguracionPOL.CiudadEnvio; vo_Credentials.DireccionEnvio = clsConfiguracionPOL.DireccionEnvio; } catch { } } } return(vo_Credentials); }
public static VO_Credentials csCredenciales(Enum_ProveedorWebServices eProveedor) { VO_Credentials vCredentials = new VO_Credentials(); switch (eProveedor) { case Enum_ProveedorWebServices.Sabre: vCredentials = clsConfiguracionSabre.Credentials(); break; } try { clsCache cCache = new csCache().cCache(); if (cCache != null) { //if (cCache.Corporativo != null) //{ // int iTotal = cCache.Corporativo.Count; // for (int i = 0; i < iTotal; i++) // { // if (cCache.Corporativo[i].ProveedorWs.Equals(eProveedor)) // { // vCredentials = cCache.Corporativo[i].Credentials; // } // } //} } } catch (Exception Ex) { clsParametros cParametros = new clsParametros(); cParametros.Id = 0; cParametros.Message = Ex.Message.ToString(); cParametros.Source = Ex.Source.ToString(); cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Moderada; cParametros.StackTrace = Ex.StackTrace.ToString(); cParametros.Complemento = "Actualiza agencia en la cache "; cParametros.ViewMessage.Add("Su sesion ha terminado"); cParametros.Sugerencia.Add("Por favor confirme con el administrador"); ExceptionHandled.Publicar(cParametros); } return(vCredentials); }
public static VO_Credentials Credentials() { VO_Credentials vo_Credentials = new VO_Credentials(); clsParametros cParametros = new clsParametros(); try { //clsCache cCache = new csCache().cCache(); //if (cCache != null) //{ string sIdiomaGen = clsSesiones.getIdioma(); vo_Credentials.Language = clsValidaciones.GetKeyOrAdd(sIdiomaGen, "CAS"); vo_Credentials.User = clsConfiguracionHB.User; vo_Credentials.Password = clsConfiguracionHB.Password; vo_Credentials.UrlWebServices = clsConfiguracionHB.UrlWebService; } catch { } return(vo_Credentials); }
public clsResultados getServices(VO_PurchaseReference vo_PurchaseReference) { clsSerializer cDataXml = new clsSerializer(); clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); string sesion = new clsCacheControl().CrearSession() + HttpContext.Current.Session.SessionID.ToString(); //VO_PurchaseReference vo_PurchaseReference = clsSesiones.getPurchaseReference(); try { string sXml = clsEstilosXmlHB.PurchaseCancelRQ + ".xml"; string sRuta = clsConfiguracionHB.RutaArchivosXml; XmlDocument xmlDoc = cDataXml.RecuperarXML(sRuta, sXml); clsInterfaceWSHttp cInterface = new clsInterfaceWSHttp(); clsCredencialesHB cCredenciales = new clsCredencialesHB(); VO_Credentials vo_Credentials = new VO_Credentials(); try { vo_Credentials.Language = ConfigurationManager.AppSettings[clsSesiones.getIdioma()].ToString(); } catch { vo_Credentials.Language = "CAS"; } vo_Credentials.User = clsConfiguracionHB.User; vo_Credentials.Password = clsConfiguracionHB.Password; vo_Credentials.SessionId = sesion; vo_Credentials.UrlWebServices = clsConfiguracionHB.UrlWebService; vo_PurchaseReference.Credentials = vo_Credentials; xmlDoc = cCredenciales.Credenciales(xmlDoc, vo_PurchaseReference.Credentials, clsEstilosXmlHB.PurchaseCancelRQ, false); xmlDoc = cDataXml.AsignarAtrributo(xmlDoc, "code", "IncomingOffice", vo_PurchaseReference.IncomingOffice); xmlDoc = cDataXml.AsignarParametro(xmlDoc, "FileNumber", vo_PurchaseReference.FileNumber, 0); string sXmlRS = sRuta + clsSolicitudesXmlHB.PurchaseCancelRS + ".xml"; string sResponse = cInterface.ObtenerHttpWebResponse(xmlDoc.InnerXml, vo_PurchaseReference.Credentials.UrlWebServices, clsConfiguracionHB.FormatoXml); cDataXml.SaveXML(sXmlRS, sResponse); cResultados.dsResultados = cDataXml.CrearDataSet(sResponse); if (cResultados.dsResultados.Tables.Count < 5) { cParametros.Id = 0; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "PurchaseCancelRQ"; cParametros.Complemento = "Cancelacion de Hoteles"; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "0"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.HotelBeds; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cResultados.Error = cParametros; } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "PurchaseCancelRQ"; cParametros.Complemento = "Cancelacion de Hoteles"; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "0"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.HotelBeds; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(cResultados); }
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 WebService_SabreCommandLLS.SabreCommandLLSRS _Sabre_EjecutarComando(string Comando_) { WebService_SabreCommandLLS.SabreCommandLLSRS SabreCommandRespuesta_ = new WebService_SabreCommandLLS.SabreCommandLLSRS(); clsParametros cParametros = new clsParametros(); VO_Credentials objvo_Credentials = clsSesiones.getCredentials(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { WebService_SabreCommandLLS.MessageHeader Mensaje_ = WS_SsoftSabre.Air.clsSabreBase.SabreCommandLLS(); if (Mensaje_ != null) { WebService_SabreCommandLLS.Security Seguridad_ = new WebService_SabreCommandLLS.Security(); Seguridad_.BinarySecurityToken = Session_; 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_; 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.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = "HostCommand: " + Comando_; cParametros.ViewMessage.Add("Error al ejecutar comando"); cParametros.Sugerencia.Add(""); cParametros.Message = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorMessage; 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.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); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = SabreCommandRespuesta_.ToString(); cParametros.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = "HostCommand: " + Comando_; 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; } } } 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.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = "Error al ejecutar Comando " + Comando_ + " 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(SabreCommandRespuesta_); }
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 OTA_CancelRS _Sabre_CancelRecord() { OTA_CancelRS TravelResultado_ = new OTA_CancelRS(); clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { objvo_Credentials = clsSesiones.getCredentials(); OTA_Cancel.MessageHeader Mensaje_ = clsSabreBase.OTA_Cancel(); if (Mensaje_ != null) { OTA_Cancel.Security Seguridad_ = new OTA_Cancel.Security(); Seguridad_.BinarySecurityToken = Session_; OTA_CancelRQ Travel_ = new OTA_CancelRQ(); OTA_CancelRQPOS TravelPos_ = new OTA_CancelRQPOS(); OTA_CancelRQPOSSource TravelSource_ = new OTA_CancelRQPOSSource(); TravelSource_.PseudoCityCode = objvo_Credentials.Pcc; TravelPos_.Source = TravelSource_; Travel_.POS = TravelPos_; OTA_CancelRQTPA_Extensions oTPA_Extensions = new OTA_CancelRQTPA_Extensions(); OTA_CancelRQTPA_ExtensionsMessagingDetails oMessagingDetails = new OTA_CancelRQTPA_ExtensionsMessagingDetails(); OTA_CancelRQTPA_ExtensionsMessagingDetailsMDRSubset oMDRSubset = new OTA_CancelRQTPA_ExtensionsMessagingDetailsMDRSubset(); //oMDRSubset.Code = "PN12"; //oMessagingDetails.MDRSubset = oMDRSubset; //oTPA_Extensions.MessagingDetails = oMessagingDetails; OTA_CancelRQTPA_ExtensionsSegmentCancel oSegmentCancel = new OTA_CancelRQTPA_ExtensionsSegmentCancel(); OTA_CancelRQTPA_ExtensionsSegmentCancelSegment oSegmentCancelSegment = new OTA_CancelRQTPA_ExtensionsSegmentCancelSegment(); OTA_CancelRQTPA_ExtensionsSegmentCancelSegment[] oSegmentCancelSegments = new OTA_CancelRQTPA_ExtensionsSegmentCancelSegment[1]; //oSegmentCancelSegment.Number = "1"; //oSegmentCancelSegment.EndNumber = iSegmentos.ToString(); //oSegmentCancelSegments[0] = oSegmentCancelSegment; //oSegmentCancel.Segment = oSegmentCancelSegments; // "Type" refers to the segment type that the user wants to cancel. Acceptable values for "Type" are "Air", "Car", "Hotel", "Other", or "Entire". These formats look like this: "XIA", "XIC", "XIH", "XIO", or "XI". oSegmentCancel.Type = "Entire"; oTPA_Extensions.SegmentCancel = oSegmentCancel; Travel_.TPA_Extensions = oTPA_Extensions; Travel_.Version = clsSabreBase.SABRE_VERSION_CANCEL; OTA_CancelService TravelServicio_ = new OTA_CancelService(); TravelServicio_.MessageHeaderValue = Mensaje_; TravelServicio_.SecurityValue = Seguridad_; TravelServicio_.Url = objvo_Credentials.UrlWebServices; TravelResultado_ = TravelServicio_.OTA_CancelRQ(Travel_); if (TravelResultado_.Errors != null) { cParametros.Id = 0; cParametros.Code = TravelResultado_.Errors.Error.ErrorCode; 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 = "Cancelacion de la reserva"; cParametros.ViewMessage.Add("Error al intentar cancelar 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); } } 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); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = TravelResultado_.Success; 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 = "CancelRecord"; cParametros.Complemento = "HostCommand: " + TravelResultado_.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.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = Ex.TargetSite.Name; cParametros.Complemento = "Cancelacion de la reserva"; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("Error al intentar cancelar la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(TravelResultado_); }
public clsResultados getServices() { clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); try { cResultados.dsResultados = clsSesiones.getReservaHotel(); VO_HotelValuedAvailRQ vo_HotelValuedAvailRQ = clsSesiones.getParametrosHotel(); HotelConfirmRQ oHotelConfirmRQ = new HotelConfirmRQ(); HotelConfirmRS oHotelConfirmRS = new HotelConfirmRS(); HotelFare oHotelFare = getHotelFare(cResultados.dsResultados); oHotelConfirmRQ.HotelFare = oHotelFare; oHotelConfirmRQ.Username = vo_Credentials.LoginUser; oHotelConfirmRQ.Password = vo_Credentials.PasswordUser; HotelConfirmService oHotelConfirmService = new HotelConfirmService(); oHotelConfirmService.Url = clsEsquema.setConexionWs(oHotelConfirmService.Url); string sRutaGen = clsValidaciones.XMLDatasetCrea(); string sHotelConfirmRQ = "HotelConfirmRQ"; string sHotelConfirmRS = "HotelConfirmRS"; clsCache cCache = new csCache().cCache(); try { if (cCache != null) { sHotelConfirmRQ += cCache.SessionID; sHotelConfirmRS += cCache.SessionID; } } catch { } try { clsXML.ClaseXML(oHotelConfirmRQ, sRutaGen + sHotelConfirmRQ + ".xml"); } catch { } oHotelConfirmRS = oHotelConfirmService.HotelConfirm(oHotelConfirmRQ); bool bCambioTarifa = getValidaCambioTarifa(oHotelFare, oHotelConfirmRS.HotelFare); try { clsXML.ClaseXML(oHotelConfirmRS, sRutaGen + sHotelConfirmRS + ".xml"); } catch { } cParametros = new clsEsquema().GetDatasetConfirmaReserva(cResultados.dsResultados, oHotelConfirmRS, bCambioTarifa); if (!cParametros.Id.Equals(0)) { clsSesiones.setReservaHotel(cResultados.dsResultados); cResultados.Error = cParametros; } else { cParametros.Id = 0; cParametros.Message = cResultados.dsResultados.Tables[clsEsquema.TABLA_ERROR].Rows[0][clsEsquema.COLUMN_MESSAGE].ToString(); cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "HotelConfirmRQ"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.Complemento = "Resultados de Hoteles"; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "502"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Confirmacion de reserva de Hoteles"; cParametros.Source = Ex.Source; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("La reserva no se confirmo"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "502"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(cResultados); }
/// <summary> /// Metodo de cancelacion de reserva /// </summary> /// <param name="sRecord">Record a cancelar</param> /// <returns>cParametros, objeto de error</returns> /// <remarks> /// Autor: José Faustino Posas /// Company: Ssoft Colombia /// Fecha: 2011-12-22 /// ------------------- /// Control de Cambios /// ------------------- /// Autor: /// Fecha: /// Descripción: /// </remarks> public clsParametros getServices(string sRecord) { clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); try { HotelCancelRQ oHotelCancelRQ = new HotelCancelRQ(); HotelCancelRS oHotelCancelRS = new HotelCancelRS(); oHotelCancelRQ.Username = vo_Credentials.LoginUser;; oHotelCancelRQ.Password = vo_Credentials.PasswordUser; oHotelCancelRQ.ID = int.Parse(sRecord); HotelCancelService oHotelCancelService = new HotelCancelService(); oHotelCancelService.Url = clsEsquema.setConexionWs(oHotelCancelService.Url); string sRutaGen = clsValidaciones.XMLDatasetCrea(); string sHotelCancelRQ = "HotelCancelRQ"; string sHotelCancelRS = "HotelCancelRS"; clsCache cCache = new csCache().cCache(); try { if (cCache != null) { sHotelCancelRQ += cCache.SessionID; sHotelCancelRS += cCache.SessionID; } } catch { } try { clsXML.ClaseXML(oHotelCancelRQ, sRutaGen + sHotelCancelRQ + ".xml"); } catch { } oHotelCancelRS = oHotelCancelService.CancelHotel(oHotelCancelRQ); try { clsXML.ClaseXML(oHotelCancelRS, sRutaGen + sHotelCancelRS + ".xml"); } catch { } cParametros = new clsEsquema().GetDatasetHotelCancel(oHotelCancelRS); } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Cancelacion de reserva de Hoteles"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.DatoAdic = "0"; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("La cancelacion no se confirmo"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "503"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; ExceptionHandled.Publicar(cParametros); } return(cParametros); }
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); }
public DesignatePrinterRS getDesignatePrinter(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; DesignatePrinterRQ.DesignatePrinterRQ oDesignatePrinterRQ = new WS_SsoftSabre.DesignatePrinterRQ.DesignatePrinterRQ(); DesignatePrinterRS oDesignatePrinterRS = new DesignatePrinterRS(); objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials(); try { List <string> lsContadorOpciones = new List <string>(); DesignatePrinterRQ.MessageHeader Mensaje_ = clsSabreBase.DesignatePrinter(); if (Mensaje_ != null) { DesignatePrinterRQ.Security Seguridad_ = new DesignatePrinterRQ.Security(); Seguridad_.BinarySecurityToken = Session_; #region [ POS ] DesignatePrinterRQPOS oDesignatePrinterRQPOS = new DesignatePrinterRQPOS(); DesignatePrinterRQPOSSource oDesignatePrinterRQPOSSource = new DesignatePrinterRQPOSSource(); oDesignatePrinterRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; oDesignatePrinterRQPOS.Source = oDesignatePrinterRQPOSSource; oDesignatePrinterRQ.POS = oDesignatePrinterRQPOS; #endregion #region [ VERSION ] oDesignatePrinterRQ.Version = clsSabreBase.SABRE_VERSION_DESIGNATEPRINTER; #endregion #region [ DESIGNATEPRINTERS ] DesignatePrinterRQPrinters oDesignatePrinterRQPrinters = new DesignatePrinterRQPrinters(); DesignatePrinterRQPrintersHardcopy oDesignatePrinterRQPrintersHardcopy = new DesignatePrinterRQPrintersHardcopy(); DesignatePrinterRQPrintersInvoiceItinerary oDesignatePrinterRQPrintersInvoiceItinerary = new DesignatePrinterRQPrintersInvoiceItinerary(); DesignatePrinterRQPrintersTicket oDesignatePrinterRQPrintersTicket = new DesignatePrinterRQPrintersTicket(); DesignatePrinterRQPrintersBoardingPass oDesignatePrinterRQPrintersBoardingPass = new DesignatePrinterRQPrintersBoardingPass(); oDesignatePrinterRQPrintersHardcopy.LineAddress = vo_PrintersTicketsRQ.PrtItinerario; oDesignatePrinterRQPrintersInvoiceItinerary.LineAddress = vo_PrintersTicketsRQ.PrtInvoice; oDesignatePrinterRQPrintersTicket.LineAddress = vo_PrintersTicketsRQ.PrtTicket; oDesignatePrinterRQPrintersTicket.CountryCode = vo_PrintersTicketsRQ.Countrycode; oDesignatePrinterRQPrinters.Hardcopy = oDesignatePrinterRQPrintersHardcopy; oDesignatePrinterRQPrinters.InvoiceItinerary = oDesignatePrinterRQPrintersInvoiceItinerary; oDesignatePrinterRQPrinters.Ticket = oDesignatePrinterRQPrintersTicket; oDesignatePrinterRQ.Printers = oDesignatePrinterRQPrinters; #endregion DesignatePrinterService oDesignatePrinterService = new DesignatePrinterService(); oDesignatePrinterService.MessageHeaderValue = Mensaje_; oDesignatePrinterService.SecurityValue = Seguridad_; oDesignatePrinterService.Url = objvo_Credentials.UrlWebServices; oDesignatePrinterRS = oDesignatePrinterService.DesignatePrinterRQ(oDesignatePrinterRQ); if (oDesignatePrinterRS.Errors != null) { cParametros.Id = 0; cParametros.Code = oDesignatePrinterRS.Errors.Error.ErrorCode; cParametros.Info = oDesignatePrinterRS.Errors.Error.ErrorInfo.Message; cParametros.Message = oDesignatePrinterRS.Errors.Error.ErrorMessage; cParametros.Severity = oDesignatePrinterRS.Errors.Error.Severity; cParametros.Complemento = "HostCommand: " + oDesignatePrinterRS.TPA_Extensions.HostCommand; cParametros.Metodo = "getDesignatePrinter"; 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); } else { cParametros.Id = 1; cParametros.Message = oDesignatePrinterRS.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 = "getBusqueda"; cParametros.Complemento = "HostCommand: " + oDesignatePrinterRS.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 = "getBusqueda"; cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } return(oDesignatePrinterRS); }
public ShortSellRS getItinerarioHora(VO_OTA_AirBookRQ vo_OTA_AirBookRQ) { /*METODO PRINCICPAL QUE RETORNA EL OBJETO DE RESULTADOS DE SABRE*/ clsParametros cParametros = new clsParametros(); ShortSellRQ oShortSellRQ = new ShortSellRQ(); ShortSellRS oShortSellRS = new ShortSellRS(); objvo_Credentials = clsSesiones.getCredentials(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { List <string> lsContadorOpciones = new List <string>(); ShortSell.MessageHeader Mensaje_ = clsSabreBase.ShortSell(); if (Mensaje_ != null) { ShortSell.Security Seguridad_ = new ShortSell.Security(); Seguridad_.BinarySecurityToken = Session_; #region [ POS ] ShortSellRQPOS oShortSellRQPOS = new ShortSellRQPOS(); ShortSellRQPOSSource oShortSellRQPOSSource = new ShortSellRQPOSSource(); oShortSellRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; oShortSellRQPOS.Source = oShortSellRQPOSSource; oShortSellRQ.POS = oShortSellRQPOS; #endregion #region [ VERSION ] oShortSellRQ.Version = clsSabreBase.SABRE_VERSION_SHORTSELL; #endregion #region [ ITINERARIO } int iPosRuta = vo_OTA_AirBookRQ.IRutaActual - 1; VO_OrigenDestinationOption vRuta = vo_OTA_AirBookRQ.Lvo_OrigenDestinationOption[iPosRuta]; ShortSellRQAirItinerary AirItinerary = new ShortSellRQAirItinerary(); ShortSellRQAirItineraryOriginDestinationOptions AirItineraryOriginDestinationOptions = new ShortSellRQAirItineraryOriginDestinationOptions(); int iOriginDestinationOption = vRuta.Lvo_AirItinerary.Count; ShortSellRQAirItineraryOriginDestinationOptionsFlightSegment[] AirSegmentArray_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegment[iOriginDestinationOption]; int i = 0; foreach (VO_AirItinerary vItinerario in vRuta.Lvo_AirItinerary) { ShortSellRQAirItineraryOriginDestinationOptionsFlightSegment AirSegment_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegment(); ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentArrivalAirport AirSegment_Arrival_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentArrivalAirport(); ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentDepartureAirport AirSegment_Departure_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentDepartureAirport(); ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentMarketingAirline AirSegment_Airline_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentMarketingAirline(); ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentMarriageGrp AirSegment_Marriage_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentMarriageGrp(); ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentTPA_Extensions AirSegment_TPA_Extensions_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentTPA_Extensions(); ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentTPA_ExtensionsLine AirSegment_TPA_Extensions_Line_ = new ShortSellRQAirItineraryOriginDestinationOptionsFlightSegmentTPA_ExtensionsLine(); AirSegment_Arrival_.CodeContext = vItinerario.Vo_AeropuertoDestino.SContexto; AirSegment_Arrival_.LocationCode = vItinerario.Vo_AeropuertoDestino.SCodigo; AirSegment_.ArrivalAirport = AirSegment_Arrival_; AirSegment_Departure_.CodeContext = vItinerario.Vo_AeropuertoOrigen.SContexto; AirSegment_Departure_.LocationCode = vItinerario.Vo_AeropuertoOrigen.SCodigo; AirSegment_.DepartureAirport = AirSegment_Departure_; AirSegment_Airline_.Code = vItinerario.SMarketingAirLine; AirSegment_.MarketingAirline = AirSegment_Airline_; AirSegment_Marriage_.Ind = vItinerario.BAirBook; AirSegment_.MarriageGrp = AirSegment_Marriage_; AirSegment_.FlightNumber = vItinerario.SNroVuelo; AirSegment_.DepartureDateTime = vItinerario.SFechaSalida; AirSegment_.ResBookDesigCode = vItinerario.SClase; AirSegment_.ActionCode = vItinerario.SActionCode; AirSegment_.NumberInParty = vItinerario.SNroPassenger; // Opcional, vemos como se comporta y si lo necesita //AirSegment_TPA_Extensions_Line_.Number = "1"; //AirSegment_TPA_Extensions_.Line = AirSegment_TPA_Extensions_Line_; //AirSegment_.TPA_Extensions = AirSegment_TPA_Extensions_; AirSegmentArray_[i] = AirSegment_; i++; } AirItineraryOriginDestinationOptions.OriginDestinationOption = AirSegmentArray_; AirItinerary.OriginDestinationOptions = AirItineraryOriginDestinationOptions; oShortSellRQ.AirItinerary = AirItinerary; #endregion ShortSellService oShortSellService = new ShortSellService(); oShortSellService.MessageHeaderValue = Mensaje_; oShortSellService.SecurityValue = Seguridad_; oShortSellService.Url = objvo_Credentials.UrlWebServices; oShortSellRS = oShortSellService.ShortSellRQ(oShortSellRQ); if (oShortSellRS.Errors != null) { cParametros.Id = 0; cParametros.Code = oShortSellRS.Errors.Error.ErrorCode; cParametros.Info = oShortSellRS.Errors.Error.ErrorInfo.Message; cParametros.Message = oShortSellRS.Errors.Error.ErrorMessage; cParametros.Severity = oShortSellRS.Errors.Error.Severity; cParametros.Complemento = "HostCommand: " + oShortSellRS.TPA_Extensions.HostCommand; cParametros.Metodo = "getBusqueda"; 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(); ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = oShortSellRS.Success; cParametros.Metodo = "getBusqueda"; cParametros.Complemento = "HostCommand: " + oShortSellRS.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); } } 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 = "getBusqueda"; cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } return(oShortSellRS); }
public static VO_Credentials Credentials() { VO_Credentials vo_Credentials = new VO_Credentials(); clsParametros cParametros = new clsParametros(); VO_OTA_AirLowFareSearchLLSRQ vo_OTA_AirLowFareSearchLLSRQ = clsSesiones.getParametrosAirBargain(); bool bCredentials = false; string sPccPais = clsValidaciones.GetKeyOrAdd("PaisDefault", "COL"); try { if (clsConfiguracionSabre.PccPais != null) { sPccPais = clsConfiguracionSabre.PccPais; } } catch { } try { clsCache cCache = new csCache().cCache(); if (cCache != null) { //if (cCache.Corporativo != null) //{ // int iTotal = cCache.Corporativo.Count; // for (int i = 0; i < iTotal; i++) // { // if (cCache.Corporativo[i].ProveedorWs.Equals(Enum_ProveedorWebServices.Sabre)) // { // vo_Credentials = cCache.Corporativo[i].Credentials; bCredentials = false; // } // } //} } if (!bCredentials) { vo_Credentials.User = clsConfiguracionSabre.User; vo_Credentials.Password = clsConfiguracionSabre.Password; vo_Credentials.Conversacion = clsConfiguracionSabre.Conversacion; vo_Credentials.Dominio = clsConfiguracionSabre.Dominio; vo_Credentials.From = clsConfiguracionSabre.From; vo_Credentials.Ipcc = clsConfiguracionSabre.Ipcc; vo_Credentials.Pcc = clsConfiguracionSabre.Pcc; vo_Credentials.PccDefault = clsConfiguracionSabre.Pcc; vo_Credentials.Pseudo = 0; vo_Credentials.PseudoDefault = 0; vo_Credentials.PccDefaultPais = sPccPais; vo_Credentials.Mensaje = clsConfiguracionSabre.Mensaje; vo_Credentials.QNumber = clsConfiguracionSabre.QNumber; vo_Credentials.To = clsConfiguracionSabre.To; vo_Credentials.SnapCode = clsConfiguracionSabre.SnapCode; vo_Credentials.PseudoPerfil = clsConfiguracionSabre.PseudoPerfil; vo_Credentials.UrlWebServices = clsConfiguracionSabre.UrlWebService; vo_Credentials.Agencia_Ciudad = clsConfiguracionSabre.Agencia_Ciudad; vo_Credentials.Agencia_CodigoArea = clsConfiguracionSabre.Agencia_CodigoArea; vo_Credentials.Agencia_CodigoEstado = clsConfiguracionSabre.Agencia_CodigoEstado; vo_Credentials.Agencia_CodigoLocalizacion = clsConfiguracionSabre.Agencia_CodigoLocalizacion; vo_Credentials.Agencia_CodigoPais = clsConfiguracionSabre.Agencia_CodigoPais; vo_Credentials.Agencia_CodigoPostal = clsConfiguracionSabre.Agencia_CodigoPostal; vo_Credentials.Agencia_Direccion = clsConfiguracionSabre.Agencia_Direccion; vo_Credentials.Agencia_Nombre = clsConfiguracionSabre.Agencia_Nombre; vo_Credentials.Agencia_Telefono = clsConfiguracionSabre.Agencia_Telefono; vo_Credentials.Agencia_TiketeId = clsConfiguracionSabre.Agencia_TicketeId; vo_Credentials.Agencia_TiketeManual = clsConfiguracionSabre.Agencia_TicketeManual; vo_Credentials.Agencia_TiketTimeLimit = clsConfiguracionSabre.Agencia_TicketTimeLimit; vo_Credentials.NameEspace = clsConfiguracionSabre.Namespace; vo_Credentials.SegmentoFuturo = clsConfiguracionSabre.SegmentoFuturo; vo_Credentials.TimeLimit = clsConfiguracionSabre.TimeLimit; } try { if (vo_OTA_AirLowFareSearchLLSRQ != null) { if (vo_OTA_AirLowFareSearchLLSRQ.SPseudoPlanes != null) { vo_Credentials.Pcc = vo_OTA_AirLowFareSearchLLSRQ.SPseudoPlanes.ToString(); } } } catch { } } catch { if (!bCredentials) { try { vo_Credentials.User = clsConfiguracionSabre.User; vo_Credentials.Password = clsConfiguracionSabre.Password; vo_Credentials.Conversacion = clsConfiguracionSabre.Conversacion; vo_Credentials.Dominio = clsConfiguracionSabre.Dominio; vo_Credentials.From = clsConfiguracionSabre.From; vo_Credentials.Ipcc = clsConfiguracionSabre.Ipcc; vo_Credentials.Pcc = clsConfiguracionSabre.Pcc; vo_Credentials.PccDefault = clsConfiguracionSabre.Pcc; vo_Credentials.Pseudo = 0; vo_Credentials.PseudoDefault = 0; vo_Credentials.PccDefaultPais = sPccPais; vo_Credentials.Mensaje = clsConfiguracionSabre.Mensaje; vo_Credentials.QNumber = clsConfiguracionSabre.QNumber; vo_Credentials.To = clsConfiguracionSabre.To; vo_Credentials.SnapCode = clsConfiguracionSabre.SnapCode; vo_Credentials.PseudoPerfil = clsConfiguracionSabre.PseudoPerfil; vo_Credentials.UrlWebServices = clsConfiguracionSabre.UrlWebService; vo_Credentials.Agencia_Ciudad = clsConfiguracionSabre.Agencia_Ciudad; vo_Credentials.Agencia_CodigoArea = clsConfiguracionSabre.Agencia_CodigoArea; vo_Credentials.Agencia_CodigoEstado = clsConfiguracionSabre.Agencia_CodigoEstado; vo_Credentials.Agencia_CodigoLocalizacion = clsConfiguracionSabre.Agencia_CodigoLocalizacion; vo_Credentials.Agencia_CodigoPais = clsConfiguracionSabre.Agencia_CodigoPais; vo_Credentials.Agencia_CodigoPostal = clsConfiguracionSabre.Agencia_CodigoPostal; vo_Credentials.Agencia_Direccion = clsConfiguracionSabre.Agencia_Direccion; vo_Credentials.Agencia_Nombre = clsConfiguracionSabre.Agencia_Nombre; vo_Credentials.Agencia_Telefono = clsConfiguracionSabre.Agencia_Telefono; vo_Credentials.Agencia_TiketeId = clsConfiguracionSabre.Agencia_TicketeId; vo_Credentials.Agencia_TiketeManual = clsConfiguracionSabre.Agencia_TicketeManual; vo_Credentials.Agencia_TiketTimeLimit = clsConfiguracionSabre.Agencia_TicketTimeLimit; vo_Credentials.NameEspace = clsConfiguracionSabre.Namespace; vo_Credentials.SegmentoFuturo = clsConfiguracionSabre.SegmentoFuturo; vo_Credentials.TimeLimit = clsConfiguracionSabre.TimeLimit; } catch { } } try { if (vo_OTA_AirLowFareSearchLLSRQ != null) { if (vo_OTA_AirLowFareSearchLLSRQ.SPseudoPlanes != null) { vo_Credentials.Pcc = vo_OTA_AirLowFareSearchLLSRQ.SPseudoPlanes.ToString(); } } } catch { } } return(vo_Credentials); }
public HotelFare getHotelFare(DataSet dsData) { clsParametros cParametros = new clsParametros(); HotelFare oHotelFare = new HotelFare(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); bool bSoloTT = false; try { bSoloTT = bool.Parse(clsValidaciones.GetKeyOrAdd("bSoloTT", "False")); } catch { } try { VO_HotelValuedAvailRQ vo_HotelValuedAvailRQ = clsSesiones.getParametrosHotel(); DataTable dtHotelInfo = dsData.Tables[clsEsquema.TABLA_HOTEL_INFO]; DataTable dtHotelRoom = dsData.Tables[clsEsquema.TABLA_HOTEL_ROOM]; DataTable dtPriceDate = dsData.Tables[clsEsquema.TABLA_PRICE]; if (dtHotelInfo.Rows.Count > 0) { string sWhere = string.Empty; int sHotel = int.Parse(dtHotelInfo.Rows[0][clsEsquema.COLUMN_HOTELCODE].ToString()); string sCityCode = dtHotelInfo.Rows[0][clsEsquema.COLUMN_DESTINATION_CODE].ToString(); decimal dAgencyComision = clsValidaciones.getDecimalNotRound(dtHotelInfo.Rows[0][clsEsquema.COLUMN_AGENCY_COMISION].ToString()); decimal dIva = clsValidaciones.getDecimalNotRound(dtHotelInfo.Rows[0][clsEsquema.COLUMN_IVA].ToString()); int iSource = int.Parse(dtHotelInfo.Rows[0][clsEsquema.COLUMN_SOURCE].ToString()); Hotel oHotel = new Hotel(); string sAdulto = clsValidaciones.GetKeyOrAdd("AdultoHB", "AD"); string sInfante = clsValidaciones.GetKeyOrAdd("InfanteHB", "CH"); int iRoom = dtHotelRoom.Rows.Count; HotelRoom[] oRoomArray = new HotelRoom[iRoom]; oHotel.CityCode = sCityCode; oHotel.HotelCode = sHotel; oHotel.Source = iSource; for (int i = 0; i < iRoom; i++) { HotelRoomType[] oHotelRoomTypeArray = new HotelRoomType[1]; sWhere = clsEsquema.COLUMN_HOTEL_ROOM_ID + " = " + dtHotelRoom.Rows[i][clsEsquema.COLUMN_HOTEL_ROOM_ID].ToString(); HotelRoom oRoom = new HotelRoom(); HotelRoomType oHotelRoomType = new HotelRoomType(); int iPax = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList.Count; HotelRoomPax[] oPaxArray = new HotelRoomPax[iPax]; for (int j = 0; j < iPax; j++) { HotelRoomPax oPax = new HotelRoomPax(); oPax.Age = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Age; if (vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Type.Equals(sAdulto)) { oPax.PaxType = PaxType.Adult; } else { oPax.PaxType = PaxType.Child; } oPax.EmailAddress = "*****@*****.**"; oPax.FirstName = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Name; oPax.LastName = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].LastName; oPax.PhoneNumber = "571"; oPaxArray[j] = oPax; } oRoom.Paxes = oPaxArray; DataRow[] drRoomsPrices = dtPriceDate.Select(sWhere); int iFechas = drRoomsPrices.Length; EffectiveDate[] eFechasArray = new EffectiveDate[iFechas]; int k = 0; foreach (DataRow drRoomPrice in drRoomsPrices) { EffectiveDate eFechas = new EffectiveDate(); eFechas.Date = DateTime.Parse(drRoomPrice[clsEsquema.COLUMN_DATE].ToString());; eFechas.AmountAfterTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_AMOUN_AFTER_TAX].ToString()); eFechas.AmountBeforeTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_AMOUN_BEFORE_TAX].ToString()); eFechas.DiscountAfterTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_DISCOUNT_AFTER_TAX].ToString()); eFechas.DiscountBeforeTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_DISCOUNT_BEFORE_TAX].ToString()); try { eFechas.Currency = drRoomPrice[clsEsquema.COLUMN_CURRENCY].ToString(); eFechas.ProviderCurrency = drRoomPrice[clsEsquema.COLUMN_PROVIDER_CURRENCY].ToString(); eFechas.ROE = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_ROE].ToString()); } catch { } eFechasArray[k] = eFechas; k++; } oHotelRoomType.EffectiveDates = eFechasArray; oHotelRoomType.InvBlockCode = dtHotelRoom.Rows[i][clsEsquema.COLUMN_CHARASTERISTIC].ToString(); oHotelRoomType.RatePlanType = dtHotelRoom.Rows[i][clsEsquema.COLUMN_CONFIRM_RATEPLANTYPE].ToString(); oHotelRoomType.RoomDesc = dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_TYPE_TEXT].ToString(); oHotelRoomType.RoomRate = dtHotelRoom.Rows[i][clsEsquema.COLUMN_SHRUI].ToString(); oHotelRoomType.RoomType = dtHotelRoom.Rows[i][clsEsquema.COLUMN_TYPE].ToString(); oHotelRoomType.AmountIncludedBoardSurcharge = decimal.Parse(dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_AMOUNT_SURCHARGE].ToString()); try { if (!dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_TTL].ToString().Equals("True")) { oHotelRoomType.TTL = DateTime.Parse(dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_TTL].ToString()); } } catch { } oHotelRoomTypeArray[0] = oHotelRoomType; oRoom.RoomTypes = oHotelRoomTypeArray; oRoomArray[i] = oRoom; } oHotelFare.Hot = oHotel; oHotelFare.Rooms = oRoomArray; oHotelFare.AgencyCommission = dAgencyComision; oHotelFare.Iva = dIva; if (bSoloTT) { oHotelFare.ContentType = ContentType.Exclusive; } else { oHotelFare.ContentType = ContentType.NonExclusive; } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Confirmacion de Hoteles"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("No se confirmo la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); ExceptionHandled.Publicar(cParametros); } return(oHotelFare); }
public clsResultados getServices() { clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); try { HotelReservationInfoRQ oHotelReservationInfoRQ = new HotelReservationInfoRQ(); HotelReservationInfoRS oHotelReservationInfoRS = new HotelReservationInfoRS(); oHotelReservationInfoRQ.TotalTripId = 1; oHotelReservationInfoRQ.TripId = "1"; oHotelReservationInfoRQ.Username = vo_Credentials.LoginUser;; oHotelReservationInfoRQ.Password = vo_Credentials.PasswordUser; HotelReservationInfoService oHotelReservationInfoService = new HotelReservationInfoService(); oHotelReservationInfoService.Url = clsEsquema.setConexionWs(oHotelReservationInfoService.Url); oHotelReservationInfoRS = oHotelReservationInfoService.HotelReservationInfo(oHotelReservationInfoRQ); cResultados = new clsEsquema().GetDatasetHotel(cResultados.dsResultados, oHotelReservationInfoRS); if (!cResultados.Error.Id.Equals(0)) { // clsSesiones..setConfirmaHotel(cResultados.dsResultados); } else { cParametros.Id = 0; cParametros.Message = cResultados.dsResultados.Tables[clsEsquema.TABLA_ERROR].Rows[0][clsEsquema.COLUMN_MESSAGE].ToString(); cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "HotelShopRQ"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.Complemento = "Resultados de Hoteles"; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Confirmacion de reserva de Hoteles"; cParametros.Source = Ex.Source; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("La reserva no se confirmo"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "0"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(cResultados); }
public clsResultados getServicesWs(string sCodeCity) { clsParametros cParametros = new clsParametros(); clsResultados cResultados = new clsResultados(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); try { string sWhere = "ID = '" + sCodeCity + "'"; HotelInfoRQ oHotelInfoRQ = new HotelInfoRQ(); HotelInfoRS oHotelInfoRS = new HotelInfoRS(); clsSerializer cSerializer = new clsSerializer(); DataSet dsData = new DataSet(); string strPathXML = clsValidaciones.XMLDatasetCreaGen(); string strArchivo = "CityTT.xml"; string strFile = strPathXML + strArchivo; dsData = cSerializer.XMLDatasetGen(strFile); DataTable dtData = new DataTable(); string sCounty = sCodeCity; string sCountyId = sCodeCity; string sCity = sCodeCity; string sCityId = sCodeCity; try { if (dsData != null) { dtData = clsDataNet.dsDataWhere(sWhere, dsData.Tables[1]); } } catch { } int iTotal = dtData.Rows.Count; int[] iHotelCodes = new int[iTotal]; int i = 0; string sCodeHotel = "inCodigo"; try { sCounty = dtData.Rows[0]["Value_Country"].ToString(); sCountyId = dtData.Rows[0]["ID_Country"].ToString(); sCity = dtData.Rows[0]["Value"].ToString(); sCityId = dtData.Rows[0]["ID"].ToString(); } catch { } foreach (DataRow drData in dtData.Rows) { iHotelCodes[i] = int.Parse(drData[sCodeHotel].ToString()); i++; } oHotelInfoRQ.CityCode = sCodeCity; oHotelInfoRQ.HotelCodes = iHotelCodes; oHotelInfoRQ.Username = vo_Credentials.LoginUser; oHotelInfoRQ.Password = vo_Credentials.PasswordUser; DataSet dsDataResult = new DataSet(); HotelInfoService oHotelInfoService = new HotelInfoService(); oHotelInfoService.Url = clsEsquema.setConexionWs(oHotelInfoService.Url); oHotelInfoRS = oHotelInfoService.GetHotelInfos(oHotelInfoRQ); new clsEsquema().GetDatasetHotelInfoWs(dsDataResult, oHotelInfoRS, sCounty, sCountyId, sCity, sCityId); cResultados.dsResultados = dsDataResult; } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Resultados de Hoteles"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "0"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; ExceptionHandled.Publicar(cParametros); } return(cResultados); }
//public OTA_AirBookRS getItinerarioHora(VO_OTA_AirBookRQ vo_OTA_AirBookRQ) //{ // /*METODO PRINCICPAL QUE RETORNA EL OBJETO DE RESULTADOS DE SABRE*/ // clsParametros cParametros = new clsParametros(); // OTA_AirBookRQ oOTA_AirBookRQ = new OTA_AirBookRQ(); // OTA_AirBookRS oOTA_AirBookRS = new OTA_AirBookRS(); // objvo_Credentials = clsSesiones.getCredentials(); // try // { // List<string> lsContadorOpciones = new List<string>(); // OTA_AirBook.MessageHeader Mensaje_ = clsSabreBase.OTA_AirBook(); // if (Mensaje_ != null) // { // OTA_AirBook.Security Seguridad_ = new OTA_AirBook.Security(); // Seguridad_.BinarySecurityToken = Session_; // #region [ POS ] // OTA_AirBookRQPOS oOTA_AirBookRQPOS = new OTA_AirBookRQPOS(); // OTA_AirBookRQPOSSource oOTA_AirBookRQPOSSource = new OTA_AirBookRQPOSSource(); // oOTA_AirBookRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; // oOTA_AirBookRQPOS.Source = oOTA_AirBookRQPOSSource; // oOTA_AirBookRQ.POS = oOTA_AirBookRQPOS; // #endregion // #region [ VERSION ] // oOTA_AirBookRQ.Version = clsSabreBase.SABRE_VERSION_OTA_AIRBOOK; // #endregion // #region [ ORIGINDESTINATIONINFORMATION ] // VO_OrigenDestinationOption vo_Rutas = vo_OTA_AirBookRQ.Lvo_OrigenDestinationOption[0]; // OTA_AirBookRQAirItinerary AirItinerary = new OTA_AirBookRQAirItinerary(); // if (vo_Rutas == null) // { // throw new Exception("No se recibieron rutas a procesar"); // } // else // { // int iOriginDestinationOption = vo_Rutas.Lvo_AirItinerary.Count; // int iContadorRutas = 0; // //OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[][] bAirItineraryOriginDestinationOptionFlightSegment = // // new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[iOriginDestinationOption]; // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[][] aAirItineraryOriginDestinationOptionFlightSegment = // new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[iOriginDestinationOption][]; // foreach (VO_AirItinerary vItinerario in vo_Rutas.Lvo_AirItinerary) // { // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment oAirItineraryOriginDestinationOptionFlightSegment = // new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment(); // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentArrivalAirport ArrivalAirport = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentArrivalAirport(); // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentDepartureAirport DepartureAirport = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentDepartureAirport(); // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment[] Equipments = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment[1]; // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment Equipment = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment(); // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarketingAirline MarketingAirline = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarketingAirline(); // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarriageGrp MarriageGrp = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarriageGrp(); // OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentOperatingAirline OperatingAirline = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentOperatingAirline(); // DepartureAirport.CodeContext = vItinerario.Vo_AeropuertoOrigen.SContexto; // DepartureAirport.LocationCode = vItinerario.Vo_AeropuertoOrigen.SCodigo; // ArrivalAirport.CodeContext = vItinerario.Vo_AeropuertoDestino.SContexto; // ArrivalAirport.LocationCode = vItinerario.Vo_AeropuertoDestino.SCodigo; // Equipment.AirEquipType = vItinerario.SAirEquip; // Equipments[0] = Equipment; // MarketingAirline.Code = vItinerario.SMarketingAirLine; // MarriageGrp.Ind = vItinerario.BAirBook; // OperatingAirline.Code = vItinerario.SOperatingAirLine; // oAirItineraryOriginDestinationOptionFlightSegment.ActionCode = vItinerario.SActionCode; // oAirItineraryOriginDestinationOptionFlightSegment.ArrivalDateTime = vItinerario.SFechaLlegada; // oAirItineraryOriginDestinationOptionFlightSegment.DepartureDateTime = vItinerario.SFechaSalida; // oAirItineraryOriginDestinationOptionFlightSegment.FlightNumber = vItinerario.SNroVuelo; // oAirItineraryOriginDestinationOptionFlightSegment.NumberInParty = vItinerario.SNroPassenger; // oAirItineraryOriginDestinationOptionFlightSegment.ResBookDesigCode = vItinerario.SClase; // oAirItineraryOriginDestinationOptionFlightSegment.ArrivalAirport = ArrivalAirport; // oAirItineraryOriginDestinationOptionFlightSegment.DepartureAirport = DepartureAirport; // oAirItineraryOriginDestinationOptionFlightSegment.Equipment = Equipments; // oAirItineraryOriginDestinationOptionFlightSegment.MarketingAirline = MarketingAirline; // oAirItineraryOriginDestinationOptionFlightSegment.MarriageGrp = MarriageGrp; // oAirItineraryOriginDestinationOptionFlightSegment.OperatingAirline = OperatingAirline; // aAirItineraryOriginDestinationOptionFlightSegment[iContadorRutas][0] = oAirItineraryOriginDestinationOptionFlightSegment; // iContadorRutas++; // } // //bAirItineraryOriginDestinationOptionFlightSegment[0] = aAirItineraryOriginDestinationOptionFlightSegment; // AirItinerary.OriginDestinationOptions = aAirItineraryOriginDestinationOptionFlightSegment; // } // oOTA_AirBookRQ.AirItinerary = AirItinerary; // #endregion // OTA_AirBookService oOTA_AirBookService = new OTA_AirBookService(); // oOTA_AirBookService.MessageHeaderValue = Mensaje_; // oOTA_AirBookService.SecurityValue = Seguridad_; // oOTA_AirBookRS = oOTA_AirBookService.OTA_AirBookRQ(oOTA_AirBookRQ); // if (oOTA_AirBookRS.Errors != null) // { // cParametros.Id = 0; // cParametros.Code = oOTA_AirBookRS.Errors[0].Error.ErrorCode; // cParametros.Info = oOTA_AirBookRS.Errors[0].Error.ErrorInfo.Message; // cParametros.Message = oOTA_AirBookRS.Errors[0].Error.ErrorMessage; // cParametros.Severity = oOTA_AirBookRS.Errors[0].Error.Severity; // cParametros.Complemento = "HostCommand: " + oOTA_AirBookRS.TPA_Extensions.HostCommand; // cParametros.Metodo = "getBusqueda"; // cParametros.Tipo = clsTipoError.WebServices; // ExceptionHandled.Publicar(cParametros); // } // else // { // cParametros.Id = 1; // cParametros.Message = oOTA_AirBookRS.Success; // cParametros.Metodo = "getBusqueda"; // cParametros.Complemento = "HostCommand: " + oOTA_AirBookRS.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 = "getBusqueda"; // cParametros.Tipo = clsTipoError.WebServices; // ExceptionHandled.Publicar(cParametros); // } // return oOTA_AirBookRS; //} public OTA_AirBookRS getItinerarioHora(VO_OTA_AirBookRQ vo_OTA_AirBookRQ) { /*METODO PRINCICPAL QUE RETORNA EL OBJETO DE RESULTADOS DE SABRE*/ clsParametros cParametros = new clsParametros(); OTA_AirBookRQ oOTA_AirBookRQ = new OTA_AirBookRQ(); OTA_AirBookRS oOTA_AirBookRS = new OTA_AirBookRS(); StringBuilder consulta = new StringBuilder(); objvo_Credentials = clsSesiones.getCredentials(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { List <string> lsContadorOpciones = new List <string>(); OTA_AirBook.MessageHeader Mensaje_ = clsSabreBase.OTA_AirBook(); if (Mensaje_ != null) { OTA_AirBook.Security Seguridad_ = new OTA_AirBook.Security(); Seguridad_.BinarySecurityToken = Session_; #region [ POS ] OTA_AirBookRQPOS oOTA_AirBookRQPOS = new OTA_AirBookRQPOS(); OTA_AirBookRQPOSSource oOTA_AirBookRQPOSSource = new OTA_AirBookRQPOSSource(); oOTA_AirBookRQPOSSource.PseudoCityCode = objvo_Credentials.Ipcc; // oOTA_AirBookRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; oOTA_AirBookRQPOS.Source = oOTA_AirBookRQPOSSource; oOTA_AirBookRQ.POS = oOTA_AirBookRQPOS; #endregion #region [ VERSION ] oOTA_AirBookRQ.Version = clsSabreBase.SABRE_VERSION_OTA_AIRBOOK; #endregion #region [ ITINERARIO } List <VO_OrigenDestinationOption> vo_Rutas = vo_OTA_AirBookRQ.Lvo_OrigenDestinationOption; OTA_AirBookRQAirItinerary Book_Air_ = new OTA_AirBookRQAirItinerary(); List <OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[]> Book_AirSegmentList_ = new List <OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[]>(); foreach (VO_OrigenDestinationOption vRuta in vo_Rutas) { int iOriginDestinationOption = vRuta.Lvo_AirItinerary.Count; OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[] Book_AirSegmentArray_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment[iOriginDestinationOption]; int i = 0; foreach (VO_AirItinerary vItinerario in vRuta.Lvo_AirItinerary) { OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment Book_AirSegment_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegment(); OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentArrivalAirport Book_AirSegment_Arrival_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentArrivalAirport(); OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentDepartureAirport Book_AirSegment_Departure_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentDepartureAirport(); OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarketingAirline Book_AirSegment_Airline_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarketingAirline(); OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarriageGrp Book_AirSegment_Marriage_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentMarriageGrp(); OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentOperatingAirline Book_AirSegment_Operating_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentOperatingAirline(); OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment[] Book_AirSegment_Equipments_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment[1]; OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment Book_AirSegment_Equipment_ = new OTA_AirBookRQAirItineraryOriginDestinationOptionFlightSegmentEquipment(); // Book_AirSegment_Arrival_.CodeContext = vItinerario.Vo_AeropuertoDestino.SContexto; Book_AirSegment_Arrival_.LocationCode = vItinerario.Vo_AeropuertoDestino.SCodigo; Book_AirSegment_.ArrivalAirport = Book_AirSegment_Arrival_; //Book_AirSegment_Departure_.CodeContext = vItinerario.Vo_AeropuertoOrigen.SContexto; Book_AirSegment_Departure_.LocationCode = vItinerario.Vo_AeropuertoOrigen.SCodigo; Book_AirSegment_.DepartureAirport = Book_AirSegment_Departure_; Book_AirSegment_Airline_.Code = vItinerario.SMarketingAirLine; Book_AirSegment_.MarketingAirline = Book_AirSegment_Airline_; Book_AirSegment_Marriage_.Ind = vItinerario.BAirBook; Book_AirSegment_.MarriageGrp = Book_AirSegment_Marriage_; Book_AirSegment_Operating_.Code = vItinerario.SOperatingAirLine; Book_AirSegment_.OperatingAirline = Book_AirSegment_Operating_; Book_AirSegment_Equipment_.AirEquipType = vItinerario.SAirEquip; Book_AirSegment_Equipments_[0] = Book_AirSegment_Equipment_; Book_AirSegment_.Equipment = Book_AirSegment_Equipments_; Book_AirSegment_.FlightNumber = vItinerario.SNroVuelo; Book_AirSegment_.ArrivalDateTime = vItinerario.SFechaLlegada; Book_AirSegment_.DepartureDateTime = vItinerario.SFechaSalida; Book_AirSegment_.ResBookDesigCode = vItinerario.SClase; Book_AirSegment_.ActionCode = vItinerario.SActionCode; Book_AirSegment_Marriage_.Ind = true; //Book_AirSegment_.RPH = Detalle_.ItinerarioDetalle__Id_.ToString(); Book_AirSegment_.NumberInParty = vItinerario.SNroPassenger; Book_AirSegmentArray_[i] = Book_AirSegment_; i++; } //Book_AirSegmentList_.Clear(); Book_AirSegmentList_.Add(Book_AirSegmentArray_); } Book_Air_.OriginDestinationOptions = Book_AirSegmentList_.ToArray(); oOTA_AirBookRQ.AirItinerary = Book_Air_; #endregion OTA_AirBookService oOTA_AirBookService = new OTA_AirBookService(); oOTA_AirBookService.MessageHeaderValue = Mensaje_; oOTA_AirBookService.SecurityValue = Seguridad_; oOTA_AirBookService.Url = objvo_Credentials.UrlWebServices; oOTA_AirBookRS = oOTA_AirBookService.OTA_AirBookRQ(oOTA_AirBookRQ); //XmlSerializer mySerializer = new XmlSerializer(typeof(OTA_AirBookRQ)); //// To write to a file, create a StreamWriter object. //System.IO.StreamWriter myWriter = new System.IO.StreamWriter("d://OTA_AirBookRQNewMULTI" + DateTime.Now.Hour + DateTime.Now.Minute + ".xml"); //mySerializer.Serialize(myWriter, oOTA_AirBookRQ); //myWriter.Close(); //mySerializer = new XmlSerializer(typeof(OTA_AirBookRS)); //// To write to a file, create a StreamWriter object. //myWriter = new System.IO.StreamWriter("d://OTA_AirBookRQNewMULTI" + DateTime.Now.Hour + DateTime.Now.Minute + ".xml"); //mySerializer.Serialize(myWriter, oOTA_AirBookRS); //myWriter.Close(); if (oOTA_AirBookRS.Errors != null) { cParametros.Id = 0; cParametros.Code = oOTA_AirBookRS.Errors[0].Error.ErrorCode; cParametros.Info = oOTA_AirBookRS.Errors[0].Error.ErrorInfo.Message; cParametros.Message = oOTA_AirBookRS.Errors[0].Error.ErrorMessage; cParametros.Severity = oOTA_AirBookRS.Errors[0].Error.Severity; cParametros.Complemento = "HostCommand: " + oOTA_AirBookRS.TPA_Extensions.HostCommand; cParametros.Metodo = "getBusqueda"; 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(); cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.Message = oOTA_AirBookRS.Success; cParametros.Metodo = "getBusqueda"; cParametros.Complemento = "HostCommand: " + oOTA_AirBookRS.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 = "getBusqueda"; cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } return(oOTA_AirBookRS); }
public OTA_AirPriceRQ.OTA_AirPriceRS _Sabre_BuscarTarifa(VO_OTA_AirLowFareSearchLLSRQ vo_OTA_AirLowFareSearchLLSRQ) { OTA_AirPriceRQ.OTA_AirPriceRS BargainResultado_ = new OTA_AirPriceRQ.OTA_AirPriceRS(); objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials(); StringBuilder consulta = new StringBuilder(); clsParametros cParametros = new clsParametros(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { OTA_AirPriceRQ.MessageHeader Mensaje_ = clsSabreBase.__ISabre_OTA_AirPrice(); if (Mensaje_ != null) { OTA_AirPriceRQ.Security Seguridad_ = new OTA_AirPriceRQ.Security(); Seguridad_.BinarySecurityToken = Session_; OTA_AirPriceRQ.OTA_AirPriceRQ Bargain_ = new OTA_AirPriceRQ.OTA_AirPriceRQ(); OTA_AirPriceRQ.OTA_AirPriceRQPOS BargainPos_ = new OTA_AirPriceRQ.OTA_AirPriceRQPOS(); OTA_AirPriceRQ.OTA_AirPriceRQPOSSource BargainSource_ = new OTA_AirPriceRQ.OTA_AirPriceRQPOSSource(); BargainSource_.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; BargainPos_.Source = BargainSource_; Bargain_.POS = BargainPos_; //OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummary Bargain_Info_ = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummary(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummary oTravelerInfoSummary = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummary(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_Extensions oTPA_Extensions = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_Extensions(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsBargainFinder oExtensionsBargainFinder = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsBargainFinder(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsBargainFinderRebook oRebook = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsBargainFinderRebook(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPriceRetention oPriceRetention = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPriceRetention(); //oRebook.Ind = false; //oPriceRetention.Default = true; //oExtensionsBargainFinder.Ind = false; oRebook.Ind = true; oPriceRetention.Default = true; oExtensionsBargainFinder.Ind = true; oExtensionsBargainFinder.Rebook = oRebook; oTPA_Extensions.BargainFinder = oExtensionsBargainFinder; oTPA_Extensions.PriceRetention = oPriceRetention; oTravelerInfoSummary.TPA_Extensions = oTPA_Extensions; #region [ PRICEREQUESTINFORMATION ] string sMonedaCotizar = vo_OTA_AirLowFareSearchLLSRQ.SCodMonedaCotizacion; string sTarifaNegociada = vo_OTA_AirLowFareSearchLLSRQ.SCodTarifaNegociada; OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformation Bargain_InfoPrice_ = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformation(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformationTPA_Extensions Bargain_InfoPriceTPA_ = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformationTPA_Extensions(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformationTPA_ExtensionsCorporate oTourCode = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformationTPA_ExtensionsCorporate(); OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformationTPA_ExtensionsAccount oAccountCode = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryPriceRequestInformationTPA_ExtensionsAccount(); if (clsValidaciones.getValidarString(sTarifaNegociada)) { oAccountCode.Code = sTarifaNegociada; //Bargain_InfoPriceTPA_.Corporate = oTourCode; Bargain_InfoPriceTPA_.Account = oAccountCode; Bargain_InfoPrice_.TPA_Extensions = Bargain_InfoPriceTPA_; if (clsValidaciones.getValidarString(sMonedaCotizar)) { Bargain_InfoPrice_.CurrencyCode = sMonedaCotizar; } oTravelerInfoSummary.PriceRequestInformation = Bargain_InfoPrice_; } else { if (clsValidaciones.getValidarString(sMonedaCotizar)) { Bargain_InfoPrice_.CurrencyCode = sMonedaCotizar; } oTravelerInfoSummary.PriceRequestInformation = Bargain_InfoPrice_; } #endregion System.Collections.Generic.List <VO_Pasajero> lvo_Pasajeros = vo_OTA_AirLowFareSearchLLSRQ.Lvo_Pasajeros; // Para tomar tarifa de niños como en la busqueda normal, pero no retorna resultados reales int iContPaxTotal = 0; if (lvo_Pasajeros != null) { foreach (VO_Pasajero vo_PasajeroTotal in lvo_Pasajeros) { if (vo_PasajeroTotal.SCodigo.Equals("CNN")) { iContPaxTotal += int.Parse(vo_PasajeroTotal.SCantidad); } else { iContPaxTotal++; } } } OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType[] oPassengerType_ = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType[iContPaxTotal]; if (lvo_Pasajeros != null) { int iContador = 0; foreach (VO_Pasajero vo_Pasajero in lvo_Pasajeros) { if (!(vo_Pasajero.SCantidad.Equals("0"))) { if (vo_Pasajero.SCodigo.Equals("CNN")) { foreach (VO_ClasificaPasajero vo_CatPasajero in vo_Pasajero.LvPasajeroNino) { OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType oPassengerType = null; oPassengerType = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType(); oPassengerType.Quantity = vo_CatPasajero.SCantidad; oPassengerType.Code = vo_CatPasajero.SCodigo; oPassengerType.AlternatePassengerType = true; oPassengerType.AlternatePassengerTypeSpecified = true; oPassengerType_.SetValue(oPassengerType, iContador++); } } else { OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType oPassengerType = null; oPassengerType = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType(); oPassengerType.Quantity = vo_Pasajero.SCantidad; oPassengerType.Code = vo_Pasajero.SCodigo; oPassengerType.AlternatePassengerType = true; oPassengerType.AlternatePassengerTypeSpecified = true; oPassengerType_.SetValue(oPassengerType, iContador++); } } } } //int iContPaxTotal = 0; //if (lvo_Pasajeros != null) //{ // iContPaxTotal = lvo_Pasajeros.Count; //} //OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType[] oPassengerType_ = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType[iContPaxTotal]; //if (lvo_Pasajeros != null) //{ // int iContador = 0; // foreach (VO_Pasajero vo_Pasajero in lvo_Pasajeros) // { // if (!(vo_Pasajero.SCantidad.Equals("0"))) // { // OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType oPassengerType = null; // oPassengerType = new OTA_AirPriceRQ.OTA_AirPriceRQTravelerInfoSummaryTPA_ExtensionsPassengerType(); // oPassengerType.Quantity = vo_Pasajero.SCantidad; // oPassengerType.Code = vo_Pasajero.SCodigo; // oPassengerType.AlternatePassengerType = true; // oPassengerType.AlternatePassengerTypeSpecified = true; // oPassengerType_.SetValue(oPassengerType, iContador++); // } // } //} Bargain_.TravelerInfoSummary = oTravelerInfoSummary; Bargain_.TravelerInfoSummary.TPA_Extensions.PassengerType = oPassengerType_; //Bargain_.TravelerInfoSummary = oTravelerInfoSummary; //Bargain_.TravelerInfoSummary.TPA_Extensions.PassengerType = oPassengerType_; Bargain_.Version = clsSabreBase.SABRE_VERSION_OTA_AIRPRICE; OTA_AirPriceRQ.OTA_AirPriceService BargainServicio_ = new OTA_AirPriceRQ.OTA_AirPriceService(); BargainServicio_.MessageHeaderValue = Mensaje_; BargainServicio_.SecurityValue = Seguridad_; BargainServicio_.Url = objvo_Credentials.UrlWebServices; BargainResultado_ = BargainServicio_.OTA_AirPriceRQ(Bargain_); // Para verificar la tarifa // //string sComand = "WPP" + "JCB" + "¥NCB"; //string sVenta = Negocios_WebServiceSabreCommand._EjecutarComando(sComand); // Termina if (BargainResultado_.Errors != null) { cParametros.Id = 0; cParametros.Code = BargainResultado_.Errors.Error.ErrorCode; cParametros.Info = BargainResultado_.Errors.Error.ErrorInfo.Message; cParametros.Message = BargainResultado_.Errors.Error.ErrorMessage; cParametros.Severity = BargainResultado_.Errors.Error.Severity; cParametros.Complemento = "HostCommand: " + BargainResultado_.TPA_Extensions.HostCommand; cParametros.Metodo = "_Sabre_BuscarTarifa"; 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 "; } cParametros.TipoLog = Enum_Error.Log; ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = BargainResultado_.Success; 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 = "_Sabre_BuscarTarifa"; cParametros.Complemento = "HostCommand: " + BargainResultado_.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 = "_Sabre_BuscarTarifa"; cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } return(BargainResultado_); }
public HotelShopRS getHoteles(VO_HotelValuedAvailRQ vo_HotelValuedAvailRQ, string strMoneda, string Ruta) { clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); HotelShopRQ oHotelShopRQ = new HotelShopRQ(); HotelShopRS oHotelShopRS = new HotelShopRS(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); vo_HotelValuedAvailRQ.Credentials = vo_Credentials; bool bSoloTT = false; try { bSoloTT = bool.Parse(clsValidaciones.GetKeyOrAdd("bSoloTT", "False")); } catch { } try { string sAdulto = clsValidaciones.GetKeyOrAdd("AdultoHB", "AD"); string sInfante = clsValidaciones.GetKeyOrAdd("InfanteHB", "CH"); int iRoom = vo_HotelValuedAvailRQ.lHotelOccupancy.Count; Room[] oRoomArray = new Room[iRoom]; for (int i = 0; i < iRoom; i++) { Room oRoom = new Room(); int iPax = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList.Count; Pax[] oPaxArray = new Pax[iPax]; for (int j = 0; j < iPax; j++) { Pax oPax = new Pax(); oPax.Age = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Age; if (vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Type.Equals(sAdulto)) { oPax.PaxType = PaxType.Adult; } else { oPax.PaxType = PaxType.Child; } oPaxArray[j] = oPax; } oRoom.Paxes = oPaxArray; oRoomArray[i] = oRoom; } oHotelShopRQ.CityTo = vo_HotelValuedAvailRQ.Destination; oHotelShopRQ.DateFrom = DateTime.Parse(clsValidaciones.ConverFechaSinSeparadorYMD(vo_HotelValuedAvailRQ.CheckInDate)); oHotelShopRQ.DateTo = DateTime.Parse(clsValidaciones.ConverFechaSinSeparadorYMD(vo_HotelValuedAvailRQ.CheckOutDate)); oHotelShopRQ.Rooms = oRoomArray; oHotelShopRQ.Username = vo_Credentials.LoginUser; oHotelShopRQ.Password = vo_Credentials.PasswordUser; oHotelShopRQ.Currency = strMoneda; oHotelShopRQ.Language = "ES"; int iResultados = Convert.ToInt32(clsValidaciones.GetKeyOrAdd("CantidadRHoteles", "500")); try { if (HttpContext.Current.Session["$CantHoteles"] != null) { iResultados = Convert.ToInt32(HttpContext.Current.Session["$CantHoteles"].ToString()); } } catch { } oHotelShopRQ.MaxResults = iResultados; if (bSoloTT) { oHotelShopRQ.ContentType = ContentType.Exclusive; } else { oHotelShopRQ.ContentType = ContentType.NonExclusive; } HotelShopService oHotelShopService = new HotelShopService(); oHotelShopService.Url = clsEsquema.setConexionWs(oHotelShopService.Url); string sRutaGen = Ruta; string sHotelShopRQ = "HotelShopRQ"; string sHotelShopRS = "HotelShopRS"; try { clsXML.ClaseXML(oHotelShopRQ, sRutaGen + sHotelShopRQ + "hilo.xml"); } catch { } oHotelShopRS = oHotelShopService.HotelShop(oHotelShopRQ); try { clsXML.ClaseXML(oHotelShopRS, sRutaGen + sHotelShopRS + "hilo.xml"); } catch { } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Resultados de Hoteles"; cParametros.Source = Ex.Source; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "501"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(oHotelShopRS); }
/// <summary> /// getBargainFinderMaxRQ returns up to 200 diferent options for the availability /// </summary> /// <param name="vo_BargainFinderMax_ADRQ"></param> public override object getExecuteSWS(params object[] ota_AirPriceRQ) { VO_BargainFinderMax_ADRQ vo_BargainFinderMax_ADRQ = (VO_BargainFinderMax_ADRQ)ota_AirPriceRQ[0]; OTA_AirLowFareSearchRQ ota_AirLowFareSearchRQ = new OTA_AirLowFareSearchRQ(); session_ = AutenticacionSabre.GET_SabreSession(); objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials(); SWS_BargainFinderMaxRQ.Security security = new SWS_BargainFinderMaxRQ.Security(); security.BinarySecurityToken = session_;// vo_BargainFinderMax_ADRQ.Vo_SessionCreateRQ.; //exluimos aerolineas //hceron //29042013 csVuelos cVuelos = new csVuelos(); List <string> lsExcluirAerol = cVuelos.ExcluirAerolineas(); #region [ POS ] //Source SourceType[] sourceTypes = new SourceType[1]; SourceType sourceType = new SourceType(); VO_SessionCreateRQ vo_SessionCreateRQ = vo_BargainFinderMax_ADRQ.Vo_SessionCreateRQ; sourceType.PseudoCityCode = objvo_Credentials.Ipcc; //RequestorID UniqueID_Type uniqueID_Type = new UniqueID_Type(); uniqueID_Type.ID = "1"; //"ID" (required) Not used for processing. Use a value of "1". uniqueID_Type.Type = "1"; //"Type" (required) Not used for processing. Use a value of "1". CompanyNameType companyNameType = new CompanyNameType(); companyNameType.Code = "TN"; uniqueID_Type.CompanyName = companyNameType; //"Code" (required) Customer code. Use the value "TN". sourceType.RequestorID = uniqueID_Type; sourceTypes[0] = sourceType; ota_AirLowFareSearchRQ.POS = sourceTypes; #endregion #region [ VERSION ] ota_AirLowFareSearchRQ.Version = WS_SsoftSabre.Air.Constant.SWS_Sevirce_Versions.BARGAINFINDERMAXRQ; #endregion #region [ ORIGINDESTINATIONINFORMATION ] List <string> lsContadorOpciones = new List <string>(); List <VO_OriginDestinationInformation> lvo_OriginDestinationInformation = vo_BargainFinderMax_ADRQ.Lvo_Segments; if (lvo_OriginDestinationInformation == null) { throw new Exception("lvo_OriginDestinationInformation is null,Pls check"); } else { int iSegmentsCounter = 0; OTA_AirLowFareSearchRQOriginDestinationInformation[] aota_AirLowFareSearchRQOriginDestinationInformation = new OTA_AirLowFareSearchRQOriginDestinationInformation[lvo_OriginDestinationInformation.Count]; int iOriginDestinationInformation = 0; foreach (VO_OriginDestinationInformation vo_OriginDestinationInformation in lvo_OriginDestinationInformation) { WS_SsoftSabre.SWS_BargainFinderMaxRQ.OTA_AirLowFareSearchRQOriginDestinationInformation ota_AirLowFareSearchRQOriginDestinationInformation = new WS_SsoftSabre.SWS_BargainFinderMaxRQ.OTA_AirLowFareSearchRQOriginDestinationInformation(); TimeInstantType timeInstantType = new TimeInstantType(); timeInstantType.Value = Convert.ToDateTime(vo_OriginDestinationInformation.SFechaSalida).ToString(Constant.FORMATO_TIME_STAMP); ota_AirLowFareSearchRQOriginDestinationInformation.Item = timeInstantType; ota_AirLowFareSearchRQOriginDestinationInformation.ItemElementName = ItemChoiceType.DepartureDateTime; ota_AirLowFareSearchRQOriginDestinationInformation.DepartureWindow = vo_OriginDestinationInformation.SIntervaloSalida; ota_AirLowFareSearchRQOriginDestinationInformation.ArrivalWindow = vo_OriginDestinationInformation.SIntervaloSalida; //OriginLocation LocationType originLocationType = new LocationType(); originLocationType.CodeContext = vo_OriginDestinationInformation.Vo_AeropuertoOrigen.SContexto; originLocationType.LocationCode = vo_OriginDestinationInformation.Vo_AeropuertoOrigen.SCodigo; ota_AirLowFareSearchRQOriginDestinationInformation.OriginLocation = originLocationType; //DestinationLocation LocationType destinationLocationType = new LocationType(); destinationLocationType.LocationCode = vo_OriginDestinationInformation.Vo_AeropuertoDestino.SCodigo; destinationLocationType.CodeContext = vo_OriginDestinationInformation.Vo_AeropuertoDestino.SContexto; ota_AirLowFareSearchRQOriginDestinationInformation.DestinationLocation = destinationLocationType; #region [ TPA_EXTENSIONS ] OTA_AirLowFareSearchRQOriginDestinationInformationTPA_Extensions originDestinationInformationTPA_Extensions = new OTA_AirLowFareSearchRQOriginDestinationInformationTPA_Extensions(); //SegmentType OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsSegmentType oTPA_ExtensionsSegmentType = new OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsSegmentType(); oTPA_ExtensionsSegmentType.CodeSpecified = true; switch (vo_OriginDestinationInformation.OTipoSegmento.ToString()) { case TipoSegmento.O: oTPA_ExtensionsSegmentType.Code = OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsSegmentTypeCode.O; break; case TipoSegmento.ARUNK: oTPA_ExtensionsSegmentType.Code = OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsSegmentTypeCode.ARUNK; break; case TipoSegmento.X: oTPA_ExtensionsSegmentType.Code = OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsSegmentTypeCode.X; break; } // oTPA_ExtensionsSegmentType.Code = (OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsSegmentTypeCode)vo_OriginDestinationInformation.; originDestinationInformationTPA_Extensions.SegmentType = oTPA_ExtensionsSegmentType; //AlternateTime string StrAlternateTime = vo_OriginDestinationInformation.STiempoAlternativo; if (!String.IsNullOrEmpty(StrAlternateTime)) { OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsAlternateTime oTPA_ExtensionsAlternateTime = new OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsAlternateTime(); oTPA_ExtensionsAlternateTime.PlusMinus = StrAlternateTime; originDestinationInformationTPA_Extensions.AlternateTime = oTPA_ExtensionsAlternateTime; } //CabinPrefrencial //VO_CabinPref vo_CabinPref = vo_OriginDestinationInformation.; //if (vo_CabinPref != null) //{ //CabinPrefType cabinPrefType = new CabinPrefType(); //cabinPrefType.Cabin = (CabinType)vo_CabinPref.Enum_CabinType; //cabinPrefType.CabinSpecified = true; //cabinPrefType.PreferLevel = (PreferLevelType)vo_CabinPref.Enum_PreferLevelType; //originDestinationInformationTPA_Extensions.CabinPref = cabinPrefType; // } //ConnectionTime por definir usa //hceron int intConnectionTimeMax = 0; //vo_OriginDestinationInformation.IntConnectionTimeMax; int intConnectionTimeMin = 0; //vo_OriginDestinationInformation.IntConnectionTimeMin; if (intConnectionTimeMax > 0 && intConnectionTimeMin > 0) { OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsConnectionTime connectionTime = new OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsConnectionTime(); connectionTime.Max = intConnectionTimeMax.ToString(); connectionTime.Min = intConnectionTimeMin.ToString(); originDestinationInformationTPA_Extensions.ConnectionTime = connectionTime; } //VendorPref por definr //hceron VO_VendorPref[] vo_VendorPrefs = null;// vo_BargainFinderMax_ADRQ.Vo_VendorPref; if (vo_VendorPrefs != null && vo_VendorPrefs.Length > 0) { int iContadorAerolinea = 0; OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsIncludeVendorPref[] includeVendorPrefs = new OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsIncludeVendorPref[vo_VendorPrefs.Length]; foreach (string sOpcion in lsContadorOpciones) { foreach (VO_VendorPref Vo_VendorPref in vo_VendorPrefs) { OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsIncludeVendorPref includeVendorPref = new OTA_AirLowFareSearchRQOriginDestinationInformationTPA_ExtensionsIncludeVendorPref(); includeVendorPref.Code = Vo_VendorPref.StrCode; includeVendorPrefs.SetValue(includeVendorPref, iContadorAerolinea); iContadorAerolinea++; } } originDestinationInformationTPA_Extensions.IncludeVendorPref = includeVendorPrefs; } //TPA_Extensions ota_AirLowFareSearchRQOriginDestinationInformation.TPA_Extensions = originDestinationInformationTPA_Extensions; #endregion iOriginDestinationInformation = iSegmentsCounter + 1; lsContadorOpciones.Add(iOriginDestinationInformation.ToString()); ota_AirLowFareSearchRQOriginDestinationInformation.RPH = iOriginDestinationInformation.ToString(); aota_AirLowFareSearchRQOriginDestinationInformation[iSegmentsCounter] = ota_AirLowFareSearchRQOriginDestinationInformation; iSegmentsCounter++; } ota_AirLowFareSearchRQ.OriginDestinationInformation = aota_AirLowFareSearchRQOriginDestinationInformation; } #endregion #region [ TRAVELPREFERENCES ] AirSearchPrefsType airSearchPrefsType = new AirSearchPrefsType(); AirSearchPrefsType airSearchExcluPrefsType = new AirSearchPrefsType(); string sMaximasParadas = vo_BargainFinderMax_ADRQ.SMaxStopsQuantity; if (!String.IsNullOrEmpty(sMaximasParadas)) { if (!sMaximasParadas.Equals("0")) { airSearchPrefsType.MaxStopsQuantity = sMaximasParadas; } } VO_CabinPref[] vo_CabinPrefs = null;//vo_BargainFinderMax_ADRQ.Vo_CabinPrefs; if (vo_CabinPrefs != null && vo_CabinPrefs.Length > 0) { int intCounterCabinPref = 0; CabinPrefType[] CabinPrefTypes = new CabinPrefType[vo_CabinPrefs.Length]; foreach (VO_CabinPref vo_CabinPref in vo_CabinPrefs) { CabinPrefType cabinPrefType = new CabinPrefType(); cabinPrefType.Cabin = (CabinType)vo_CabinPref.Enum_CabinType; cabinPrefType.CabinSpecified = true; cabinPrefType.PreferLevel = (PreferLevelType)vo_CabinPref.Enum_PreferLevelType; CabinPrefTypes.SetValue(cabinPrefType, intCounterCabinPref); intCounterCabinPref++; } airSearchPrefsType.CabinPref = CabinPrefTypes; } //VendorPref VO_VendorPref[] lvo_VendorPref = null;//vo_BargainFinderMax_ADRQ.Vo_VendorPref; if (lvo_VendorPref != null && lvo_VendorPref.Length > 0) { int intCounterVendorPref = 0; CompanyNamePrefType[] companyNamePrefTypes = new CompanyNamePrefType[lvo_VendorPref.Length]; foreach (VO_VendorPref vo_VendorPref in lvo_VendorPref) { CompanyNamePrefType companyNamePrefType = new CompanyNamePrefType(); companyNamePrefType.PreferLevel = (PreferLevelType)vo_VendorPref.Enum_PreferLevelType; companyNamePrefType.Code = vo_VendorPref.StrCode; companyNamePrefTypes.SetValue(companyNamePrefType, intCounterVendorPref); intCounterVendorPref++; } airSearchPrefsType.VendorPref = companyNamePrefTypes; } //Excluir Aerolineas // #region [ Exlude Airline ] if (lsExcluirAerol.Count > 0) { List <AirSearchPrefsTypeTPA_ExtensionsExcludeVendorPref> companyNameExcludeTypes = new List <AirSearchPrefsTypeTPA_ExtensionsExcludeVendorPref>(); foreach (string sExludeCode in lsExcluirAerol) { AirSearchPrefsTypeTPA_ExtensionsExcludeVendorPref companyNamePrefType = new AirSearchPrefsTypeTPA_ExtensionsExcludeVendorPref(); companyNamePrefType.Code = sExludeCode; companyNameExcludeTypes.Add(companyNamePrefType); } airSearchPrefsType.TPA_Extensions = new AirSearchPrefsTypeTPA_Extensions(); airSearchPrefsType.TPA_Extensions.ExcludeVendorPref = companyNameExcludeTypes.ToArray(); } #endregion //TravelPreferences ota_AirLowFareSearchRQ.TravelPreferences = airSearchPrefsType; ota_AirLowFareSearchRQ.TravelPreferences.ValidInterlineTicket = true; #endregion #region [ TRAVELERINFORMATION ] TravelerInfoSummaryType travelerInfoSummaryType = new TravelerInfoSummaryType(); List <VO_Pasajero> lvo_Passengers = vo_BargainFinderMax_ADRQ.Lvo_Passengers; if (lvo_Passengers == null) { throw new Exception("lvo_Passengers mandatory"); } else { TravelerInformationType travelerInformationType = new TravelerInformationType(); int iContPasajeros = 0; int iContPaxTotal = 0; foreach (VO_Pasajero vo_PasajeroTotal in lvo_Passengers) { if (vo_PasajeroTotal.SCodigo.Equals("CNN")) { iContPaxTotal += int.Parse(vo_PasajeroTotal.SCantidad); } else { iContPaxTotal++; } } //best to get search //hceron 06062013 PassengerTypeQuantityType[] passengerTypeQuantityTypes = new PassengerTypeQuantityType[iContPaxTotal]; #region paxes MAX foreach (VO_Pasajero vo_Pasajero in lvo_Passengers) { if (vo_Pasajero.SCodigo.Equals("CNN")) { foreach (VO_ClasificaPasajero vo_CatPasajero in vo_Pasajero.LvPasajeroNino) { PassengerTypeQuantityType passengerTypeQuantityType = new PassengerTypeQuantityType(); passengerTypeQuantityType.Code = vo_CatPasajero.SCodigo; passengerTypeQuantityType.Quantity = vo_CatPasajero.SCantidad; passengerTypeQuantityTypes[iContPasajeros] = passengerTypeQuantityType; iContPasajeros++; } } else { PassengerTypeQuantityType passengerTypeQuantityType = new PassengerTypeQuantityType(); passengerTypeQuantityType.Code = vo_Pasajero.SCodigo; passengerTypeQuantityType.Quantity = vo_Pasajero.SCantidad; passengerTypeQuantityTypes[iContPasajeros] = passengerTypeQuantityType; iContPasajeros++; } } #endregion //foreach (VO_Pasajero vo_Passenger in lvo_Passengers) //{ // PassengerTypeQuantityType passengerTypeQuantityType = new PassengerTypeQuantityType(); // passengerTypeQuantityType.Code = "ADT";//vo_Passenger.; // passengerTypeQuantityType.Quantity = "1";// vo_Passenger.ToString(); // passengerTypeQuantityTypes[iContPasajeros] = passengerTypeQuantityType; // iContPasajeros++; //} travelerInformationType.PassengerTypeQuantity = passengerTypeQuantityTypes; TravelerInformationType[] travelerInformationTypes = new TravelerInformationType[] { travelerInformationType }; travelerInfoSummaryType.AirTravelerAvail = travelerInformationTypes; } PriceRequestInformationType priceRequestInformationType = new PriceRequestInformationType(); if (vo_BargainFinderMax_ADRQ.StrNegotiatedFareCode != null && vo_BargainFinderMax_ADRQ.StrNegotiatedFareCode.Length > 0) { PriceRequestInformationTypeNegotiatedFareCode[] NegotiatedFareCode = new PriceRequestInformationTypeNegotiatedFareCode[1]; int intContadorCorporateID = 0; foreach (string strCorporateID in vo_BargainFinderMax_ADRQ.StrNegotiatedFareCode) { NegotiatedFareCode[intContadorCorporateID] = new PriceRequestInformationTypeNegotiatedFareCode(); NegotiatedFareCode[intContadorCorporateID].Code = vo_BargainFinderMax_ADRQ.StrNegotiatedFareCode[intContadorCorporateID]; NegotiatedFareCode[intContadorCorporateID].Supplier = new CompanyNameType[] { new CompanyNameType() { Code = "AAA" } }; intContadorCorporateID++; } priceRequestInformationType.Items = NegotiatedFareCode; } if (vo_BargainFinderMax_ADRQ.Vo_Priority.isValid()) { PriceRequestInformationTypeTPA_Extensions priceRequestInformationTypeTPA_Extensions = new PriceRequestInformationTypeTPA_Extensions(); priceRequestInformationTypeTPA_Extensions.Priority = new PriceRequestInformationTypeTPA_ExtensionsPriority() { DirectFlights = new PriceRequestInformationTypeTPA_ExtensionsPriorityDirectFlights() { Priority = vo_BargainFinderMax_ADRQ.Vo_Priority.IntDirectFlights }, Price = new PriceRequestInformationTypeTPA_ExtensionsPriorityPrice() { Priority = vo_BargainFinderMax_ADRQ.Vo_Priority.IntPrice }, Time = new PriceRequestInformationTypeTPA_ExtensionsPriorityTime() { Priority = vo_BargainFinderMax_ADRQ.Vo_Priority.IntTime }, Vendor = new PriceRequestInformationTypeTPA_ExtensionsPriorityVendor() { Priority = vo_BargainFinderMax_ADRQ.Vo_Priority.IntVendor } }; priceRequestInformationType.TPA_Extensions = priceRequestInformationTypeTPA_Extensions; } PriceRequestInformationTypeTPA_Extensions priceRequestInformationTypeTPA_Extensions_tkt = new PriceRequestInformationTypeTPA_Extensions(); priceRequestInformationTypeTPA_Extensions_tkt.Indicators = new PriceRequestInformationTypeTPA_ExtensionsIndicators() { ResTicketing = new PriceRequestInformationTypeTPA_ExtensionsIndicatorsResTicketing() { Ind = true } }; priceRequestInformationType.TPA_Extensions = priceRequestInformationTypeTPA_Extensions_tkt; VO_OTA_AirLowFareSearchLLSRQ vo_OTA_AirLowFareSearchLLSRQ = clsSesiones.getParametrosAirBargain(); if (vo_BargainFinderMax_ADRQ != null) { priceRequestInformationType.CurrencyCode = vo_OTA_AirLowFareSearchLLSRQ.SCodMonedaCotizacion.ToString(); travelerInfoSummaryType.PriceRequestInformation = priceRequestInformationType; } else { travelerInfoSummaryType.PriceRequestInformation = priceRequestInformationType; } ota_AirLowFareSearchRQ.TravelerInfoSummary = travelerInfoSummaryType; #endregion OTA_AirLowFareSearchRQTPA_Extensions ota_AirLowFareSearchRQTPA_Extensions = new OTA_AirLowFareSearchRQTPA_Extensions(); TransactionType transactionType = new TransactionType(); TransactionTypeClientSessionID transactionTypeClientSessionID = new TransactionTypeClientSessionID(); transactionTypeClientSessionID.Value = session_; transactionType.ClientSessionID = transactionTypeClientSessionID; TransactionTypeRequestType transactionTypeRequestType = new TransactionTypeRequestType(); transactionTypeRequestType.Name = str200; switch (vo_BargainFinderMax_ADRQ.Enum_IntelliSellTransaction) { case Enum_IntelliSellTransaction.BFM_50: transactionTypeRequestType.Name = str50; break; case Enum_IntelliSellTransaction.BFM_100: transactionTypeRequestType.Name = str100; break; case Enum_IntelliSellTransaction.BFM_200: transactionTypeRequestType.Name = str200; break; } transactionType.RequestType = transactionTypeRequestType; ota_AirLowFareSearchRQTPA_Extensions.IntelliSellTransaction = transactionType; ota_AirLowFareSearchRQ.TPA_Extensions = ota_AirLowFareSearchRQTPA_Extensions; BargainFinderMaxService bargainFinderMaxService = new BargainFinderMaxService(); SWS_BargainFinderMaxRQ.MessageHeader messageHeader = (SWS_BargainFinderMaxRQ.MessageHeader)getMessageHeader(typeof(MessageHeader), vo_BargainFinderMax_ADRQ.Vo_MessageHeader); bargainFinderMaxService.MessageHeaderValue = messageHeader; bargainFinderMaxService.SecurityValue = security; OTA_AirLowFareSearchRS ota_AirLowFareSearchRS = bargainFinderMaxService.BargainFinderMaxRQ(ota_AirLowFareSearchRQ); //XmlSerializer mySerializer = new XmlSerializer(typeof(OTA_AirLowFareSearchRQ)); ////To write to a file, create a StreamWriter object. //System.IO.StreamWriter myWriter = new System.IO.StreamWriter("D://bfmRQ-Integradov5" + DateTime.Now.Hour + DateTime.Now.Minute + ".xml"); //mySerializer.Serialize(myWriter, ota_AirLowFareSearchRQ); //myWriter.Close(); //mySerializer = new XmlSerializer(typeof(OTA_AirLowFareSearchRS)); ////To write to a file, create a StreamWriter object. //myWriter = new System.IO.StreamWriter("D://bfmRS-Integradov6" + DateTime.Now.Hour + DateTime.Now.Minute + ".xml"); //mySerializer.Serialize(myWriter, ota_AirLowFareSearchRS); //myWriter.Close(); return(ota_AirLowFareSearchRS); }