public clsParametros _CerrarReserva(ref String Record_) { #region [ CERRAR RESERVA ] string Return_ = "XXXXXX"; string ReturnTotal_ = "YYYYYY"; string NotComplete_ = "ZZZZZZ"; clsParametros cParametros = new clsParametros(); objvo_Credentials = clsSesiones.getCredentials(); bool bReservaNormal = true; cParametros.DatoAdic = Record_; List <VO_SabreErrors> SabreErrors_ = WS_SsoftSabre.Utilidades.clsValidacionesVuelos._SabreErrors(); int iCount = 0; while (!Ssoft.Utils.clsValidaciones.IS_ALPHABETIC(cParametros.DatoAdic)) { cParametros = _GuardarReserva(); if (cParametros.Message.Contains("Unable to connect")) { if (iCount < 3) { cParametros.DatoAdic = Record_; iCount++; } else { cParametros.DatoAdic = NotComplete_; } } else { if (cParametros.DatoAdic == null) { cParametros.DatoAdic = String.Empty; } if (cParametros.DatoAdic.Length != 6 || !Ssoft.Utils.clsValidaciones.IS_ALPHABETIC(cParametros.DatoAdic)) { for (int i = 0; i < SabreErrors_.Count; i++) { if (cParametros.DatoAdic.Trim().CompareTo(SabreErrors_[i].Error_) == 0) { #region [ FILTRAR ] if (SabreErrors_[i].Solucion_[0].CompareTo("RETURN") == 0) { cParametros.DatoAdic = Return_; } else if (SabreErrors_[i].Solucion_[0].CompareTo("RETURNCOMPLETE") == 0) { cParametros.DatoAdic = ReturnTotal_; } else { foreach (string Solucion_ in SabreErrors_[i].Solucion_) { if (SabreErrors_[i].Error_.Contains("NEED ADDRESS - USE W-")) { Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_ + objvo_Credentials.Agencia_Nombre); } else { if (SabreErrors_[i].Error_.Contains("NEED PHONE FIELD - USE 9")) { Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_ + objvo_Credentials.Agencia_Telefono); } else { if (SabreErrors_[i].Error_.Contains("INFANT DETAILS REQUIRED IN SSR - ENTER 3INFT/...")) { Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_); bReservaNormal = false; } else { Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Solucion_); } } } System.Threading.Thread.Sleep(50); } if (bReservaNormal) { cParametros = _GuardarReserva(); } else { string sComando = "*P6"; cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComando); cParametros.Complemento = "Command de reserva: " + cParametros.Message; ExceptionHandled.Publicar(cParametros); cParametros.DatoAdic = clsValidacionesVuelos.setResultComado(cParametros.Message.ToString(), 1, 27, 6); } if (cParametros.DatoAdic == null) { cParametros.DatoAdic = String.Empty; } if (cParametros.DatoAdic.Length != 6 || !Ssoft.Utils.clsValidaciones.IS_ALPHABETIC(cParametros.DatoAdic)) { if (iCount < 3) { iCount++; i = -1; } else { cParametros.DatoAdic = Return_; i = SabreErrors_.Count; } } else { break; } } #endregion } if (i.CompareTo(SabreErrors_.Count - 1) == 0) { cParametros.DatoAdic = NotComplete_; } } } } } #endregion Record_ = cParametros.DatoAdic; if ((cParametros.DatoAdic == Return_) || (cParametros.DatoAdic == ReturnTotal_) || (cParametros.DatoAdic == NotComplete_)) { cParametros.Data = "La reserva no se pudo confirmar"; Record_ = cParametros.Data; } return(cParametros); }
public static clsParametros _ADDPerfil(string PseudoPerfil, string PerfilComunidad) { clsParametros cParametros = new clsParametros(); string sTexto = string.Empty; string sValue = "0"; string sComando = "N*-" + PseudoPerfil + "-" + PerfilComunidad; string sComandoRemark = "NM"; try { cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComando); //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE")) //{ cParametros.TipoLog = Enum_Error.Transac; cParametros.Complemento = "Ejecucion del comando del perfil de sabre - Comunidad"; cParametros.Metodo = sComando; ExceptionHandled.Publicar(cParametros); //} sTexto = " -" + PerfilComunidad.Substring(0, 4); sValue = clsValidaciones.RetornaNumero(clsValidacionesVuelos.setResultComado(cParametros.Message, sTexto).Substring(0, 5)); if (!sValue.Equals("0")) { sComandoRemark += "X" + sValue; } //else //{ // int iCant = 3; // int iCantInicio = 3; // for (int i = 0; i < iCant; i++) // { // if (i.Equals(0)) // { // sTexto = " -" + PerfilComunidad.Substring(0, iCantInicio) + " "; // } // else // { // sTexto = " -" + PerfilComunidad.Substring(0, iCantInicio) + " " + PerfilComunidad.Substring(iCantInicio + 1, i); // } // sValue = clsValidaciones.RetornaNumero(clsValidacionesVuelos.setResultComado(cParametros.Message, sTexto).Substring(0, 5)); // if (!sValue.Equals("0")) // { // sComandoRemark += "X" + sValue; // break; // } // iCantInicio--; // } //} cParametros = Negocios_WebServiceSabreCommand._EjecutarComandoGen(sComandoRemark); //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE")) //{ cParametros.TipoLog = Enum_Error.Transac; cParametros.Complemento = "Ejecucion del comando de confirmacion del perfil de sabre - Comunidad"; cParametros.Metodo = sComandoRemark; ExceptionHandled.Publicar(cParametros); //} } catch (Exception Ex) { cParametros.Id = 0; cParametros.TipoLog = Enum_Error.Log; cParametros.Complemento = Ex.Message.ToString(); cParametros.Source = Ex.Source.ToString(); cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Alta; cParametros.StackTrace = Ex.StackTrace.ToString(); cParametros.Info = "Error al ejecutar comando de sabre para los perfiles. Comandos; " + sComando + " ... Segubdo: " + sComandoRemark + " .... Value: " + sValue + " .... Texto " + sTexto; ExceptionHandled.Publicar(cParametros); } return(cParametros); }
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); }
public static bool setValidaReserva(string sItinerarioRes, string sItinerarioOld) { bool bResp = true; clsParametros cParametros = new clsParametros(); try { string[] strResponseOld = null; string[] strResponseNew = null; if (sItinerarioRes.Contains("\n")) { strResponseNew = sItinerarioRes.Split('\n'); } if (sItinerarioOld.Contains("\n")) { strResponseOld = sItinerarioOld.Split('\n'); } int iPosGen = strResponseNew.Length; string[] strResponse = null; if (!strResponseNew.Length.Equals(strResponseOld.Length)) { int iPosOld = strResponseOld.Length; strResponse = new string[iPosOld]; int j = 0; for (int i = 0; i < iPosGen; i++) { if (strResponseNew[i].ToString().Length > 4) { if (!strResponseNew[i].ToString().Substring(0, 3).Equals(strResponseOld[i].ToString().Substring(0, 3))) { strResponse[j] = strResponseNew[i]; } } j++; } } else { strResponse = strResponseNew; } for (int i = 0; i < iPosGen; i++) { if (strResponse[i].ToString().Length > 25) { if (!strResponse[i].ToString().Substring(0, 25).Equals(strResponseOld[i].ToString().Substring(0, 25))) { bResp = false; cParametros.Id = 0; cParametros.Message = "Diferencia en itinerarios"; cParametros.Metodo = "setValidaReserva "; cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Moderada; cParametros.Complemento = "Itinerario de la reserva " + sItinerarioRes + "/n" + "Itinerario de la busqueda " + sItinerarioOld; ExceptionHandled.Publicar(cParametros); break; } } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message.ToString(); cParametros.Metodo = "setValidaReserva "; cParametros.Source = Ex.Source.ToString(); cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Moderada; cParametros.StackTrace = Ex.StackTrace.ToString(); cParametros.Complemento = "Itinerario de la reserva " + sItinerarioRes + "/n" + "Itinerario de la busqueda " + sItinerarioOld; ExceptionHandled.Publicar(cParametros); } return(bResp); }
//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 static void csActualizaPcc(string sPais, bool bDefault) { try { clsCache cCache = new csCache().cCache(); clsCacheControl cCacheControl = new clsCacheControl(); int iTotal = 0; iTotal = 0; try { //if (cCache.Corporativo != null) // iTotal = cCache.Corporativo.Count; } catch { } string sPcc = string.Empty; int iPseudo = 0; string sPccPais = clsValidaciones.GetKeyOrAdd("PaisDefault", "COL"); if (!sPais.Length.Equals(0)) { for (int i = 0; i < iTotal; i++) { int iConfig = 0; try { //if (cCache.Corporativo[i].Configuracion != null) // iConfig = cCache.Corporativo[i].Configuracion.Count; } catch { } for (int j = 0; j < iConfig; j++) { //if (cCache.Corporativo[i].Configuracion[j].Operador.Equals(Enum_ProveedorWebServices.Sabre)) //{ // int iCount = cCache.Corporativo[i].Configuracion[j].lPseudos.Count; // for (int k = 0; k < iCount; k++) // { // if (cCache.Corporativo[i].Configuracion[j].lPseudos[k].IdPais.Equals(int.Parse(sPais))) // { // sPcc = cCache.Corporativo[i].Configuracion[j].lPseudos[k].Pseudo; // iPseudo = cCache.Corporativo[i].Configuracion[j].lPseudos[k].IdPseudo; // sPccPais = cCache.Corporativo[i].Configuracion[j].lPseudos[k].Pais; // } // } //} } } } iTotal = 0; try { //if (cCache.Corporativo != null) // iTotal = cCache.Corporativo.Count; } catch { } for (int i = 0; i < iTotal; i++) { //if (cCache.Corporativo[i].ProveedorWs.Equals(Enum_ProveedorWebServices.Sabre)) //{ // if (bDefault) // { // cCache.Corporativo[i].Credentials.Pcc = cCache.Corporativo[i].Credentials.PccDefault; // cCache.Corporativo[i].Credentials.Pseudo = cCache.Corporativo[i].Credentials.PseudoDefault; // cCache.Corporativo[i].Credentials.PccPais = cCache.Corporativo[i].Credentials.PccDefaultPais; // } // else // { // if (!sPcc.Length.Equals(0)) // { // cCache.Corporativo[i].Credentials.Pcc = sPcc; // cCache.Corporativo[i].Credentials.Pseudo = iPseudo; // cCache.Corporativo[i].Credentials.PccPais = sPccPais; // } // else // { // cCache.Corporativo[i].Credentials.Pcc = cCache.Corporativo[i].Credentials.PccDefault; // cCache.Corporativo[i].Credentials.Pseudo = cCache.Corporativo[i].Credentials.PseudoDefault; // cCache.Corporativo[i].Credentials.PccPais = cCache.Corporativo[i].Credentials.PccDefaultPais; // } // } // clsSesiones.setCredentials(cCache.Corporativo[i].Credentials); //} } cCache = cCacheControl.ActualizaXML(cCache); } 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); } }
public clsParametros EnviarMensaje(string pstrMensaje, string pstrSubject, OperacionEmail Operacion, string pstrTo, string pstrCC, string pstrCCO, FormatMail pmailFormat, string pstrFrom, string strAdjunto) { clsParametros cParametros = new clsParametros(); cParametros.Id = 1; try { Message objEmail = new Message(); switch (Operacion) { case OperacionEmail.Ambos: break; case OperacionEmail.Email: objEmail.mTo = pstrTo; objEmail.mCc = pstrCC; objEmail.mCco = pstrCCO; objEmail.mFrom = Message.ReadNode("MailFrom"); objEmail.mSubject = pstrSubject; if (pmailFormat == FormatMail.HTML) { objEmail.MailFormat = true; string sCodigoHTML = pstrMensaje; objEmail.mBody = sCodigoHTML; } else { if (pmailFormat == FormatMail.PlantillaHTML) { objEmail.MailFormat = true; StreamReader oPlantilla = new StreamReader(pstrMensaje); string sCodigoHTML = oPlantilla.ReadToEnd(); oPlantilla.Close(); objEmail.mBody = sCodigoHTML; } else { objEmail.MailFormat = false; objEmail.mBody = pstrMensaje; } } try { if (!strAdjunto.Length.Equals(0)) { Attachment oAttch = new Attachment(strAdjunto); List <Attachment> lstrAttachments = new List <Attachment>(); lstrAttachments.Add(oAttch); objEmail.Attachments = lstrAttachments; } } catch { } cParametros = objEmail.Send(pstrFrom); break; case OperacionEmail.InsertarBD: break; } } catch (Exception Ex) { StringBuilder lstrMensaje = new StringBuilder(); lstrMensaje.Append("Error Correo_ "); lstrMensaje.Append("Mensaje: " + pstrMensaje); lstrMensaje.Append("Subject: " + pstrSubject); lstrMensaje.Append("To: " + pstrTo); lstrMensaje.Append("From: " + pstrFrom); lstrMensaje.Append("Adjunto: " + strAdjunto); 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 = lstrMensaje.ToString(); cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.ViewMessage.Add(lstrMensaje.ToString()); cParametros.Sugerencia.Add(""); ExceptionHandled.Publicar(cParametros); } return(cParametros); }
public static string setGaleria1(DataTable dtData) { StringBuilder sGaleria = new StringBuilder(); try { sGaleria.AppendLine("<div id='thumbs' class='navigation'>"); sGaleria.AppendLine("<ul class='thumbs noscript'>"); int iCount = dtData.Rows.Count; for (int i = 0; i < iCount; i++) { // <a class="thumb" href="http://farm2.static.flickr.com/1260/930424599_e75865c0d6.jpg" title="Title #23"> // <img src="http://farm2.static.flickr.com/1260/930424599_e75865c0d6_s.jpg" alt="Title #23" /> // </a> // <div class="caption"> // <div class="download"> // <a href="http://farm2.static.flickr.com/1260/930424599_e75865c0d6_b.jpg">Download Original</a> // </div> // <div class="image-title">Title #23</div> // <div class="image-desc">Description</div> // </div> //</li> sGaleria.AppendLine("<li>"); if (i.Equals(0)) { sGaleria.AppendLine("<a class='thumb' name='" + POS1 + "' href='" + dtData.Rows[i][IMAGE].ToString() + "' title='" + dtData.Rows[i][TITLE].ToString() + "' width='75' height='75'>"); } else { if (i.Equals(1)) { sGaleria.AppendLine("<a class='thumb' name='" + POS2 + "' href='" + dtData.Rows[i][IMAGE].ToString() + "' title='" + dtData.Rows[i][TITLE].ToString() + "'>"); } else { if (i.Equals(2)) { sGaleria.AppendLine("<a class='thumb' name='" + POS3 + "' href='" + dtData.Rows[i][IMAGE].ToString() + "' title='" + dtData.Rows[i][TITLE].ToString() + "'>"); } else { if (i.Equals(3)) { sGaleria.AppendLine("<a class='thumb' name='" + POS4 + "' href='" + dtData.Rows[i][IMAGE].ToString() + "' title='" + dtData.Rows[i][TITLE].ToString() + "'>"); } else { sGaleria.AppendLine("<a class='thumb' href='" + dtData.Rows[i][IMAGE].ToString() + "' title='" + dtData.Rows[i][TITLE].ToString() + "'>"); } } } } sGaleria.AppendLine("<img src='" + dtData.Rows[i][IMAGE].ToString() + "' alt='Title #" + i.ToString() + "' width='75' height='75' />"); sGaleria.AppendLine("</a>"); sGaleria.AppendLine("<div class='caption'>"); sGaleria.AppendLine("<div class='download'>"); sGaleria.AppendLine("<a href='" + dtData.Rows[i][IMAGE].ToString() + "'>Ampliar Imagen</a>"); sGaleria.AppendLine("</div>"); sGaleria.AppendLine("<div class='image-title'>" + dtData.Rows[i][TITLE].ToString() + "</div>"); sGaleria.AppendLine("<div class='image-desc'><strong>Comentario del Autor: </strong>" + dtData.Rows[i][DESCRIPTION].ToString() + "<br />"); sGaleria.AppendLine("Seudonimo del autor: " + dtData.Rows[i][SEUDONIMO].ToString() + "<br />"); sGaleria.AppendLine("Lugar donde fue tomada: " + dtData.Rows[i][LUGAR].ToString() + "<br />"); sGaleria.AppendLine("Temática: " + dtData.Rows[i][TEMATICA].ToString() + "<br />"); if (!string.IsNullOrEmpty(dtData.Rows[i][OBSERVACIONES].ToString())) { sGaleria.AppendLine("<strong>Observación: </strong>" + dtData.Rows[i][OBSERVACIONES].ToString() + "<br />"); } if (!string.IsNullOrEmpty(dtData.Rows[i][ESTATUS].ToString())) { sGaleria.AppendLine("<strong>Estatus: " + dtData.Rows[i][ESTATUS].ToString() + "</strong><br />"); } sGaleria.AppendLine("</div>"); sGaleria.AppendLine("</div>"); sGaleria.AppendLine("</li>"); } sGaleria.AppendLine("</ul>"); sGaleria.AppendLine("</div>"); } 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 = "Galeria_1"; ExceptionHandled.Publicar(cParametros); } return(sGaleria.ToString()); }
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_); }
/// <summary> /// Método para eliminar un registro de la tabla /// </summary> /// <summary> /// Métodp para inicializar el objeto /// </summary> public void Inicialize(clsParametros cParametros) { try { intAplicacion.Value = clsSesiones.getAplicacion().ToString(); } catch { } try { intId.Value = cParametros.Id.ToString(); } catch { intId.Value = "0"; } try { strCode.Value = cParametros.Code.ToString(); } catch { strCode.Value = string.Empty; } try { strTipoLog.Value = cParametros.TipoLog.ToString(); } catch { strTipoLog.Value = string.Empty; } try { strTipo.Value = cParametros.TipoLog.ToString(); } catch { strTipo.Value = string.Empty; } try { strSeverity.Value = cParametros.Severity.ToString(); } catch { strSeverity.Value = string.Empty; } try { strMetodo.Value = cParametros.Metodo.ToString(); } catch { strMetodo.Value = string.Empty; } try { strMessage.Value = cParametros.Message.ToString(); } catch { strMessage.Value = string.Empty; } try { strInfo.Value = cParametros.Info.ToString(); } catch { strInfo.Value = string.Empty; } try { strSource.Value = cParametros.Source.ToString(); } catch { strSource.Value = string.Empty; } try { strStackTrace.Value = cParametros.StackTrace.ToString(); } catch { strStackTrace.Value = string.Empty; } try { strTargetSite.Value = cParametros.TargetSite.ToString(); } catch { strTargetSite.Value = string.Empty; } try { strInnerException.Value = cParametros.InnerException.ToString(); } catch { strInnerException.Value = string.Empty; } try { strComplemento.Value = cParametros.Complemento.ToString(); } catch { strComplemento.Value = string.Empty; } try { if (cParametros.ViewMessage.Count > 0) { for (int i = 0; i < cParametros.ViewMessage.Count; i++) { if (i > 0) { strViewMessage.Value += " - "; } strViewMessage.Value += cParametros.ViewMessage[i].ToString(); } } } catch { strViewMessage.Value = string.Empty; } try { if (cParametros.Sugerencia.Count > 0) { for (int i = 0; i < cParametros.Sugerencia.Count; i++) { if (i > 0) { strSugerencia.Value += " - "; } strSugerencia.Value += cParametros.Sugerencia[i].ToString(); } } } catch { strSugerencia.Value = string.Empty; } try { strIp.Value = clsValidaciones.ObtenerIp(); } catch { strIp.Value = string.Empty; } try { strExplorer.Value = clsValidaciones.ObtenerBrowserUser(); } catch { strExplorer.Value = string.Empty; } try { strPage.Value = clsValidaciones.ObtenerUrl(); } catch { strPage.Value = string.Empty; } try { strHostName.Value = clsValidaciones.ObtenerHostName(); } catch { strHostName.Value = string.Empty; } try { strPlataform.Value = clsValidaciones.ObtenerBrowserPlataform(); } catch { strPlataform.Value = string.Empty; } try { strSesion.Value = new clsCacheControl().RecuperarSesionId(); } catch { strSesion.Value = string.Empty; } try { clsCache cCache = new csCache().cCache(); if (cCache != null) { if (cCache.Viajero != null) { if (!cCache.Viajero.Length.Equals(0)) { intContactoUser.Value = cCache.Viajero; } else { if (cCache.Empresa != null) { if (!cCache.Empresa.Length.Equals(0)) { intContactoUser.Value = cCache.Empresa; } } } } } } catch { intContactoUser.Value = string.Empty; } }
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 void Save(clsParametros cParametros) { int iNumeroCampos = 23; //int iKeys = 0; string[] pstrFields = new string[iNumeroCampos]; string[] pstrValues = new string[iNumeroCampos]; TipoCampo[] pstrTipo = new TipoCampo[iNumeroCampos]; int iContador = 0; string pstrSql = string.Empty; string pstrFrom = null; string pstrWhere = null; string pstrOrder = null; Inicialize(cParametros); pclsDataSql.Conexion = Conexion; try { pstrFrom = gstrNameTable; iContador = 0; pstrFields[iContador++] = intAplicacion.Name.ToString(); pstrFields[iContador++] = intId.Name.ToString(); pstrFields[iContador++] = strCode.Name.ToString(); pstrFields[iContador++] = strTipoLog.Name.ToString(); pstrFields[iContador++] = strTipo.Name.ToString(); pstrFields[iContador++] = strSeverity.Name.ToString(); pstrFields[iContador++] = strMetodo.Name.ToString(); pstrFields[iContador++] = strMessage.Name.ToString(); pstrFields[iContador++] = strInfo.Name.ToString(); pstrFields[iContador++] = strSource.Name.ToString(); pstrFields[iContador++] = strStackTrace.Name.ToString(); pstrFields[iContador++] = strTargetSite.Name.ToString(); pstrFields[iContador++] = strInnerException.Name.ToString(); pstrFields[iContador++] = strComplemento.Name.ToString(); pstrFields[iContador++] = strViewMessage.Name.ToString(); pstrFields[iContador++] = strSugerencia.Name.ToString(); pstrFields[iContador++] = strIp.Name.ToString(); pstrFields[iContador++] = strExplorer.Name.ToString(); pstrFields[iContador++] = strPage.Name.ToString(); pstrFields[iContador++] = strPlataform.Name.ToString(); pstrFields[iContador++] = strHostName.Name.ToString(); pstrFields[iContador++] = strSesion.Name.ToString(); //pstrFields[iContador++] = dtmMFecha.Name.ToString(); pstrFields[iContador++] = intContactoUser.Name.ToString(); iContador = 0; pstrTipo[iContador++] = intAplicacion.TypeDat; pstrTipo[iContador++] = intId.TypeDat; pstrTipo[iContador++] = strCode.TypeDat; pstrTipo[iContador++] = strTipoLog.TypeDat; pstrTipo[iContador++] = strTipo.TypeDat; pstrTipo[iContador++] = strSeverity.TypeDat; pstrTipo[iContador++] = strMetodo.TypeDat; pstrTipo[iContador++] = strMessage.TypeDat; pstrTipo[iContador++] = strInfo.TypeDat; pstrTipo[iContador++] = strSource.TypeDat; pstrTipo[iContador++] = strStackTrace.TypeDat; pstrTipo[iContador++] = strTargetSite.TypeDat; pstrTipo[iContador++] = strInnerException.TypeDat; pstrTipo[iContador++] = strComplemento.TypeDat; pstrTipo[iContador++] = strViewMessage.TypeDat; pstrTipo[iContador++] = strSugerencia.TypeDat; pstrTipo[iContador++] = strIp.TypeDat; pstrTipo[iContador++] = strExplorer.TypeDat; pstrTipo[iContador++] = strPage.TypeDat; pstrTipo[iContador++] = strPlataform.TypeDat; pstrTipo[iContador++] = strHostName.TypeDat; pstrTipo[iContador++] = strSesion.TypeDat; //pstrTipo[iContador++] = dtmMFecha.TypeDat; pstrTipo[iContador++] = intContactoUser.TypeDat; iContador = 0; pstrValues[iContador++] = intAplicacion.Value; pstrValues[iContador++] = intId.Value; pstrValues[iContador++] = strCode.Value; pstrValues[iContador++] = strTipoLog.Value; pstrValues[iContador++] = strTipo.Value; pstrValues[iContador++] = strSeverity.Value; pstrValues[iContador++] = strMetodo.Value; pstrValues[iContador++] = strMessage.Value; pstrValues[iContador++] = strInfo.Value; pstrValues[iContador++] = strSource.Value; pstrValues[iContador++] = strStackTrace.Value; pstrValues[iContador++] = strTargetSite.Value; pstrValues[iContador++] = strInnerException.Value; pstrValues[iContador++] = strComplemento.Value; pstrValues[iContador++] = strViewMessage.Value; pstrValues[iContador++] = strSugerencia.Value; pstrValues[iContador++] = strIp.Value; pstrValues[iContador++] = strExplorer.Value; pstrValues[iContador++] = strPage.Value; pstrValues[iContador++] = strPlataform.Value; pstrValues[iContador++] = strHostName.Value; pstrValues[iContador++] = strSesion.Value; //pstrValues[iContador++] = dtmMFecha.Value; pstrValues[iContador++] = intContactoUser.Value; pstrSql = pstrSql + pclsSql.SqlSentencia(TipoComando.Insert, pstrFields, pstrValues, pstrTipo, pstrFrom, pstrWhere, pstrOrder, iNumeroCampos) + " "; pclsDataSql.UpdateInsert(pstrSql); cParametros.Complemento = "SQL: " + pstrSql; ExceptionHandled.EventoTexto(cParametros); } catch (Exception Ex) { ExceptionHandled.EventoTexto(cParametros); cParametros.Message = Ex.Message.ToString(); cParametros.Info = "Log en BD"; cParametros.Tipo = clsTipoError.DataBase; cParametros.Severity = clsSeveridad.Alta; cParametros.Complemento = "Los datos no se guardaron, SQL: " + pstrSql; ExceptionHandled.EventoTexto(cParametros); } }
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 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 static void _CerrarSesion() { clsCache cCache = new csCache().cCache(); clsParametros cParametros = new clsParametros(); 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 { clsSessionClose objClsSessionClose = new clsSessionClose(); /*CERRAMOS LA SESSION OBTENIENDO LA SESSION DE SABRE*/ WebService_SessionClose.SessionCloseRS CerrarSesionRespuesta_ = null; try { string sValidaSesion = AutenticacionSabre.GET_SabreSessionValida(); if (sValidaSesion != null) { CerrarSesionRespuesta_ = objClsSessionClose.CerrarSesion(sValidaSesion); } } catch { } if (CerrarSesionRespuesta_ != null) { if (CerrarSesionRespuesta_.status.CompareTo("Approved") == 0) { AutenticacionSabre.SET_SabreSession(null); } else { WebService_SessionClose.SessionCloseRSErrorsError Error_ = CerrarSesionRespuesta_.Errors.Error; WebService_SessionClose.SessionCloseRSErrorsErrorErrorInfo ErrorInfo_ = Error_.ErrorInfo; if (CerrarSesionRespuesta_.Errors != null) { cParametros.Id = 0; cParametros.Message = CerrarSesionRespuesta_.Errors.Error.ErrorMessage; cParametros.Code = CerrarSesionRespuesta_.Errors.Error.ErrorCode; cParametros.Info = CerrarSesionRespuesta_.Errors.Error.ErrorInfo.Message; cParametros.Severity = CerrarSesionRespuesta_.Errors.Error.Severity; cParametros.Tipo = clsTipoError.Library; try { if (cCache != null) { cParametros.ErrorConfigura[0] = cCache.Empresa; } else { cParametros.ErrorConfigura[0] = "0"; } } catch { } cParametros.ValidaInfo = true; cParametros.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; cParametros.Complemento = "_CerrarSesion"; ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = CerrarSesionRespuesta_.Success.ToString(); cParametros.Metodo = System.Reflection.MethodInfo.GetCurrentMethod().Name; cParametros.Complemento = "HostCommand: "; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Moderada; try { if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } ExceptionHandled.Publicar(cParametros); cParametros.TipoLog = Enum_Error.Log; } } } } catch { } }
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 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_); }
///crucero /// /// </remarks> public DataTable ReglasConsultaPlanesCrucero(UserControl PageSource, Enum_TipoDestino eTipoDestino, bool bIncluyeExcursiones, string sClasificacionPlan, bool bControlCupos, bool bBuscador, string sTipoPlanUnico, string scategoria, string sTipologia) { clsCache cCache = new csCache().cCache(); clsParametros cParametros = new clsParametros(); DataTable dtPLanesOfer = null; /*LLENAMOS LOS COMBOS DE LOS FILTROS*/ try { String cadenaConexion = clsValidaciones.GetKeyOrAdd("strConexion"); #region [Validaciones] string sPais = null; string sCiudad = null; string sFechaConsulta = null; #region Validacion tipo de destino if (eTipoDestino != Enum_TipoDestino.Todos) { DataTable dtData = cConsPlanes.ConReferenciaPaisesId(clsValidaciones.GetKeyOrAdd("PaisDefault", "COL")); if (dtData != null) { sPais = dtData.Rows[0]["strDescripcion"].ToString(); } if (eTipoDestino == Enum_TipoDestino.Vacio) { if (PageSource.Request.QueryString["TIPODESTINO"].ToString() != "0") { if (PageSource.Request.QueryString["TIPODESTINO"].ToString() == "NACIONAL") { eTipoDestino = Enum_TipoDestino.Nacional; } else if (PageSource.Request.QueryString["TIPODESTINO"].ToString() == "INTERNACIONAL") { eTipoDestino = Enum_TipoDestino.Internacional; } else { eTipoDestino = Enum_TipoDestino.Todos; } } if (PageSource.Request.QueryString["Clasif"] != null) { sClasificacionPlan = PageSource.Request.QueryString["Clasif"]; } if (PageSource.Request.QueryString["bExc"] != null) { if (PageSource.Request.QueryString["bExc"] == "F") { bIncluyeExcursiones = false; } else { bIncluyeExcursiones = true; } } } } else { Label lblPaisDestino = (Label)PageSource.FindControl("lblPaisDestino"); if (lblPaisDestino != null) { sPais = lblPaisDestino.Text; } else { if (PageSource.Request.QueryString["PaisDestino"] != "0") { sPais = PageSource.Request.QueryString["PaisDestino"]; } if (cCache.DatosAdicionales != null && cCache.DatosAdicionales.Count > 9) { sCiudad = cCache.DatosAdicionales[9]; } } } #endregion /*SI VIENE DEL LINK DE OFERTAS*/ #region Validacion tipos de plan string[] sReferesTipoPlan = null; try { if (cCache.DatosAdicionales.Count > 0 && PageSource.Request.QueryString["TipoPlanDestino"] != "CASA") { if (cCache.DatosAdicionales[5].Length > 0) { string sTipoPlan = "CIRC"; sReferesTipoPlan = new string[1]; if (cCache.DatosAdicionales[5].ToString().Equals("PAQ")) { sTipoPlan = "CIRC"; } else { if (cCache.DatosAdicionales[5].ToString().Equals("TRA")) { sTipoPlan = "EXC"; } else { if (cCache.DatosAdicionales[5].ToString().Equals("SOU")) { sTipoPlan = "SOUV"; } else { if (!bBuscador) { sTipoPlan = cCache.DatosAdicionales[5].ToString(); sFechaConsulta = DateTime.Now.ToString(clsValidaciones.GetKeyOrAdd("FormatoFecha")); } else { sFechaConsulta = cCache.DatosAdicionales[5].ToString(); } } } } sReferesTipoPlan[0] = sTipoPlan; } else { if (sTipoPlanUnico != null && sTipoPlanUnico != "") { sReferesTipoPlan = new string[1]; sReferesTipoPlan[0] = sTipoPlanUnico; } else { if (bIncluyeExcursiones) { sReferesTipoPlan = new string[4]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); sReferesTipoPlan[2] = clsValidaciones.GetKeyOrAdd("TipoPlanExcursion", "EXC"); sReferesTipoPlan[3] = clsValidaciones.GetKeyOrAdd("TipoPlanTraslados", "TRAS"); } else { sReferesTipoPlan = new string[2]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); } } } } else { if (PageSource.Request.QueryString["TipoPlanDestino"] != "0" && PageSource.Request.QueryString["TipoPlanDestino"] != null) { sReferesTipoPlan = new string[1]; sReferesTipoPlan[0] = PageSource.Request.QueryString["TipoPlanDestino"]; } else { if (sTipoPlanUnico != null && sTipoPlanUnico != "") { sReferesTipoPlan = new string[1]; sReferesTipoPlan[0] = sTipoPlanUnico; } else { if (bIncluyeExcursiones) { sReferesTipoPlan = new string[4]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); sReferesTipoPlan[2] = clsValidaciones.GetKeyOrAdd("TipoPlanExcursion", "EXC"); sReferesTipoPlan[3] = clsValidaciones.GetKeyOrAdd("TipoPlanTraslados", "TRAS"); } else { sReferesTipoPlan = new string[2]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); } } } } } catch { if (sTipoPlanUnico != null && sTipoPlanUnico != "") { sReferesTipoPlan = new string[1]; sReferesTipoPlan[0] = sTipoPlanUnico; } else if (bIncluyeExcursiones) { sReferesTipoPlan = new string[4]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); sReferesTipoPlan[2] = clsValidaciones.GetKeyOrAdd("TipoPlanExcursion", "EXC"); sReferesTipoPlan[3] = clsValidaciones.GetKeyOrAdd("TipoPlanTraslados", "TRAS"); } else { sReferesTipoPlan = new string[2]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); } } #endregion string[] sReferesControlCupos = null; if (bControlCupos) { sReferesControlCupos = new string[2]; sReferesControlCupos[0] = clsValidaciones.GetKeyOrAdd("ControlCuposCon", "ConControl"); sReferesControlCupos[1] = clsValidaciones.GetKeyOrAdd("ControlCuposSin", "SinControl"); } #endregion #region [Consulta] if (!bBuscador) { if (PageSource.Request.QueryString["ORIGEN"] != null) { if (PageSource.Request.QueryString["ORIGEN"].ToUpper().Contains("BUSCADOR")) { bBuscador = true; } } } if (bBuscador) { if (cCache.DatosAdicionales.Count > 6) { #region Busqueda por presupuesto if (cCache.DatosAdicionales[cCache.DatosAdicionales.Count - 1].ToUpper().Equals("PRESUPUESTO")) { //dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( // clsSesiones.getIdioma(), // clsSesiones.getAplicacion().ToString(), // cCache.DatosAdicionales[1], // "1", // sReferesTipoPlan, // eTipoDestino, // sClasificacionPlan, // cCache.DatosAdicionales[3], // sReferesControlCupos, // null, // null, // cCache.DatosAdicionales[4], // cCache.DatosAdicionales[0], // cCache.DatosAdicionales[2], // sFechaConsulta, // cCache.DatosAdicionales[6], // cCache.DatosAdicionales[7]); } else { //dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( // clsSesiones.getIdioma(), // clsSesiones.getAplicacion().ToString(), // cCache.DatosAdicionales[1], // "1", // sReferesTipoPlan, // eTipoDestino, // sClasificacionPlan, // cCache.DatosAdicionales[3], // sReferesControlCupos, // null, // null, // cCache.DatosAdicionales[4], // cCache.DatosAdicionales[0], // cCache.DatosAdicionales[2], // cCache.DatosAdicionales[6]); } #endregion } else { if (cCache.DatosAdicionales.Count > 0) { string sZona = ""; //string sTipologia = ""; if (cCache.DatosAdicionales[0] == "" || cCache.DatosAdicionales[0] == "0") { if (PageSource.Request.QueryString["ZonaGeo"] != "0") { sZona = PageSource.Request.QueryString["ZonaGeo"]; } } else { sZona = cCache.DatosAdicionales[0]; } if (cCache.DatosAdicionales[3] != "" && cCache.DatosAdicionales[3] != "0") { sTipologia = cCache.DatosAdicionales[3]; } if (sTipologia != "" || sZona != "") { if (sTipoPlanUnico != null && sTipoPlanUnico != "" && sTipoPlanUnico == "TJAS") { dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( "0", sReferesTipoPlan, eTipoDestino, sClasificacionPlan, "0", cCache.DatosAdicionales[1], cCache.Empresa , "0", sZona); } else { dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( cCache.DatosAdicionales[1], sReferesTipoPlan, eTipoDestino, sClasificacionPlan, cCache.DatosAdicionales[2], sFechaConsulta, cCache.Empresa , sTipologia, sZona); } } else { dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( cCache.DatosAdicionales[1], sReferesTipoPlan, eTipoDestino, sClasificacionPlan, cCache.DatosAdicionales[2], sFechaConsulta, cCache.Empresa); } } else { string sZona = ""; if (PageSource.Request.QueryString["ZonaGeo"] != "0") { sZona = PageSource.Request.QueryString["ZonaGeo"]; } dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanesCrucero( sPais, sReferesTipoPlan, eTipoDestino, sClasificacionPlan, null, sFechaConsulta, cCache.Empresa, null, scategoria, sTipologia, null ); } } } else if (PageSource.Request.QueryString["PaisDestino"] != "0" && PageSource.Request.QueryString["PaisDestino"] != null) { sPais = PageSource.Request.QueryString["PaisDestino"].ToString(); if (sPais != "") { if (bIncluyeExcursiones) { sReferesTipoPlan = new string[4]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); sReferesTipoPlan[2] = clsValidaciones.GetKeyOrAdd("TipoPlanExcursion", "EXC"); sReferesTipoPlan[3] = clsValidaciones.GetKeyOrAdd("TipoPlanTraslados", "TRAS"); } else { sReferesTipoPlan = new string[2]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); } dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( sPais, sReferesTipoPlan, eTipoDestino, sClasificacionPlan, sCiudad, sFechaConsulta, cCache.Empresa); } } else if (PageSource.Request.QueryString["ICiudad"] != null) { sCiudad = PageSource.Request.QueryString["ICiudad"].ToString(); if (sCiudad != "") { if (bIncluyeExcursiones) { sReferesTipoPlan = new string[4]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); sReferesTipoPlan[2] = clsValidaciones.GetKeyOrAdd("TipoPlanExcursion", "EXC"); sReferesTipoPlan[3] = clsValidaciones.GetKeyOrAdd("TipoPlanTraslados", "TRAS"); } else { sReferesTipoPlan = new string[2]; sReferesTipoPlan[0] = clsValidaciones.GetKeyOrAdd("TipoPlanCircuito", "CIRC"); sReferesTipoPlan[1] = clsValidaciones.GetKeyOrAdd("TipoPlanCruceros", "CRUCE"); } dtPLanesOfer = cConsPlanes.ConsultaResultadoPlanes( sPais, sReferesTipoPlan, eTipoDestino, sClasificacionPlan, sCiudad, sFechaConsulta, cCache.Empresa); } } if (dtPLanesOfer != null && dtPLanesOfer.Rows.Count == 0) { dtPLanesOfer = null; } #endregion } catch (Exception Ex) { dtPLanesOfer = null; 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 = "CargarPlanes"; ExceptionHandled.Publicar(cParametros); } return(dtPLanesOfer); }
protected void btnEntrar_Click(object sender, EventArgs e) { cParametros = csVuelos.SetEntrar(txtUsuario.Text, txtPassword.Text, this); }
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 clsParametros EnviarMensaje(string pstrSubject, OperacionEmail Operacion, string pstrTo, string pstrCC, string pstrCCO, FormatMail pmailFormat, string pstrFrom, string sHtml) { clsParametros cParametros = new clsParametros(); cParametros.Id = 1; try { Message objEmail = new Message(); switch (Operacion) { case OperacionEmail.Ambos: break; case OperacionEmail.Email: objEmail.mTo = pstrTo; objEmail.mCc = pstrCC; objEmail.mCco = pstrCCO; objEmail.mFrom = Message.ReadNode("MailFrom"); objEmail.mSubject = pstrSubject; if (pmailFormat == FormatMail.HTML) { objEmail.MailFormat = true; objEmail.mBody = sHtml; } else { if (pmailFormat == FormatMail.PlantillaHTML) { objEmail.MailFormat = true; objEmail.mBody = sHtml; } else { objEmail.MailFormat = false; objEmail.mBody = sHtml; } } cParametros = objEmail.Send(pstrFrom); break; case OperacionEmail.InsertarBD: break; } } catch (Exception Ex) { StringBuilder lstrMensaje = new StringBuilder(); lstrMensaje.Append("Error Correo_ "); lstrMensaje.Append("To: " + pstrTo); lstrMensaje.Append("From: " + pstrFrom); 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 = lstrMensaje.ToString(); cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.ViewMessage.Add(lstrMensaje.ToString()); cParametros.Sugerencia.Add(""); ExceptionHandled.Publicar(cParametros); } return(cParametros); }
private void csControl(Control ctrControl, DataRow dtrEtiquetas) { string sText = "Etiqueta"; string sControl = "Etiqueta_c"; string sControlType = "Etiqueta_t"; try { sText = dtrEtiquetas[TEXT].ToString(); sControl = ctrControl.ClientID.ToString(); sControlType = dtrEtiquetas[CONTROLVALUE].ToString(); } catch { } try { Enum_Controls eControls = eControles(dtrEtiquetas[CONTROLVALUE].ToString()); string sIdioma = clsSesiones.getIdioma(); if (!eControls.Equals(Enum_Controls.Nulo)) { if (eControls.Equals(Enum_Controls.Label)) { Label lbl = (Label)ctrControl; lbl.Text = dtrEtiquetas[TEXT].ToString(); lbl.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } else if (eControls.Equals(Enum_Controls.Literal)) { Literal ltr = (Literal)ctrControl; ltr.Text = dtrEtiquetas[TEXT].ToString(); } else if (eControls.Equals(Enum_Controls.Button)) { Button But = (Button)ctrControl; But.Text = dtrEtiquetas[TEXT].ToString(); But.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } else if (eControls.Equals(Enum_Controls.LinkButton)) { LinkButton But = (LinkButton)ctrControl; But.Text = dtrEtiquetas[TEXT].ToString(); But.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } else if (eControls.Equals(Enum_Controls.HiperLink)) { HyperLink HLnk = (HyperLink)ctrControl; HLnk.Text = dtrEtiquetas[TEXT].ToString(); HLnk.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); if (dtrEtiquetas[LINK].ToString() != null || dtrEtiquetas[LINK].ToString() != "") { HLnk.NavigateUrl = dtrEtiquetas[LINK].ToString(); } } else if (eControls.Equals(Enum_Controls.RadioButton)) { RadioButton Rdb = (RadioButton)ctrControl; Rdb.Text = dtrEtiquetas[TEXT].ToString(); Rdb.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } else if (eControls.Equals(Enum_Controls.ImageButton)) { ImageButton Img = (ImageButton)ctrControl; Img.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); if (dtrEtiquetas[IMAGEN].ToString() != null || dtrEtiquetas[IMAGEN].ToString() != "") { try { try { Img.ImageUrl = clsValidaciones.ObtenerUrlImages(sIdioma) + dtrEtiquetas[IMAGEN].ToString(); if (!String.IsNullOrEmpty(dtrEtiquetas[LINKCLIENTE].ToString())) { Img.OnClientClick = "window.open('" + dtrEtiquetas[LINKCLIENTE].ToString() + "');return false;"; } if (!String.IsNullOrEmpty(dtrEtiquetas[LINK].ToString())) { Img.PostBackUrl = dtrEtiquetas[LINK].ToString(); } } catch { Img.ImageUrl = clsValidaciones.ObtenerUrlImages(sIdioma) + dtrEtiquetas[IMAGEN].ToString(); } } catch { Img.ImageUrl = clsValidaciones.ObtenerUrlImages() + dtrEtiquetas[IMAGEN].ToString(); } } } else if (eControls.Equals(Enum_Controls.TextBox)) { TextBox Tbox = (TextBox)ctrControl; if (dtrEtiquetas[TEXT].ToString() != null || dtrEtiquetas[TEXT].ToString() != "") { Tbox.Text = dtrEtiquetas[TEXT].ToString(); } Tbox.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } else if (eControls.Equals(Enum_Controls.CheckBox)) { CheckBox check = (CheckBox)ctrControl; if (dtrEtiquetas[TEXT].ToString() != null || dtrEtiquetas[TEXT].ToString() != "") { check.Text = dtrEtiquetas[TEXT].ToString(); } check.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } else if (eControls.Equals(Enum_Controls.RadioButtonList)) { CheckBox check = (CheckBox)ctrControl; if (dtrEtiquetas[TEXT].ToString() != null || dtrEtiquetas[TEXT].ToString() != "") { check.Text = dtrEtiquetas[TEXT].ToString(); } check.ToolTip = dtrEtiquetas[TOOLTIP].ToString(); } } } 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 = "Cambio de idioma al control " + sControl + " Text " + sText + " Type " + sControlType; ExceptionHandled.Publicar(cParametros); } }
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 SabreCommandLLSRS getEjecutarComando(VO_SabreCommandLLSRS vo_SabreCommandLLSRS) { SabreCommandLLSRS SabreCommandRespuesta_ = new SabreCommandLLSRS(); MessageHeader srMensaje = clsSabreBase.SabreCommandLLS(); clsParametros cParametros = new clsParametros(); clsCache cCache = new csCache().cCache(); VO_Credentials objvo_Credentials; objvo_Credentials = clsSesiones.getCredentials(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; if (srMensaje != null) { Security Seguridad_ = new Security(); Seguridad_.BinarySecurityToken = StrSesion; SabreCommandLLSRQ SabreCommand_ = new SabreCommandLLSRQ(); SabreCommandLLSRQRequest oSabreCommandLLSRQRequest = new SabreCommandLLSRQRequest(); //oSabreCommandLLSRQRequest.Output = vo_SabreCommandLLSRS.ESalida; oSabreCommandLLSRQRequest.CDATA = vo_SabreCommandLLSRS.BCDATA; oSabreCommandLLSRQRequest.HostCommand = vo_SabreCommandLLSRS.StrComando; SabreCommand_.Request = oSabreCommandLLSRQRequest; SabreCommand_.Version = clsSabreBase.COMMANDLLS_VERSION; SabreCommandLLSService SabreCommandServicio_ = new SabreCommandLLSService(); SabreCommandServicio_.MessageHeaderValue = srMensaje; SabreCommandServicio_.SecurityValue = Seguridad_; SabreCommandServicio_.Url = objvo_Credentials.UrlWebServices; SabreCommandRespuesta_ = SabreCommandServicio_.SabreCommandLLSRQ(SabreCommand_); if (SabreCommandRespuesta_.ErrorRS != null) { cParametros.Id = 0; cParametros.Code = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorCode; cParametros.Info = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorInfo.Message; cParametros.Message = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorMessage; cParametros.Severity = SabreCommandRespuesta_.ErrorRS.Errors.Error.Severity; cParametros.Tipo = clsTipoError.WebServices; cParametros.ViewMessage.Add(""); cParametros.Sugerencia.Add(""); cParametros.Message = SabreCommandRespuesta_.ErrorRS.Errors.Error.ErrorMessage; cParametros.Complemento = "SabreCommand"; cParametros.InnerException = "HostCommand: " + vo_SabreCommandLLSRS.StrComando; cParametros.TipoLog = Enum_Error.Log; try { cParametros.TargetSite = "Response: " + SabreCommandRespuesta_.Response; } catch { } consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + strSesion.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.StackTrace = consulta.ToString(); try { cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } ExceptionHandled.Publicar(cParametros); } else { //if (clsValidaciones.GetKeyOrAdd("ValidaLogTransac", "False").ToUpper().Equals("TRUE")) //{ cParametros.Id = 1; cParametros.Complemento = "SabreCommand"; cParametros.Message = "HostCommand: " + vo_SabreCommandLLSRS.StrComando; cParametros.Info = "Response: " + SabreCommandRespuesta_.Response; cParametros.Severity = clsSeveridad.Moderada; cParametros.Tipo = clsTipoError.WebServices; cParametros.TipoLog = Enum_Error.Transac; consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + strSesion.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.StackTrace = consulta.ToString(); try { cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.StackTrace = "Session Sabre: " + strSesion.ToString(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } ExceptionHandled.Publicar(cParametros); //} } } return(SabreCommandRespuesta_); }
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); }
/// <summary> /// Metodo que guarda los parametros de busqueda de planes en el objeto correspondiente y direcciona a la pagina de resultados /// </summary> /// <param name="PageSource"></param> /// <remarks> /// Autor: Juan Camilo Diaz /// Company: Ssoft Colombia /// Fecha: 2013-11-12 /// ------------------- /// Control de Cambios /// ------------------- /// </remarks> public void GuardarParametrosBusquedaCircular(UserControl PageSource) { try { TextBox txtFiltroTexto = (TextBox)PageSource.FindControl("txtFiltroTexto"); csGeneralsPag.Idioma(PageSource); clsCache cCache = new csCache().cCache(); if (cCache != null) { if (!csGeneralsPag.Externo()) { List <string> listaValores = new List <string>(); DropDownList ddlZonaGeo = (DropDownList)PageSource.FindControl("ddlZonaGeo"); DropDownList ddlPais = (DropDownList)PageSource.FindControl("ddlPais"); DropDownList ddlCiudad = (DropDownList)PageSource.FindControl("ddlCiudad"); DropDownList ddlTipologia = (DropDownList)PageSource.FindControl("ddlTipologia"); DropDownList ddlTipoPlan = (DropDownList)PageSource.FindControl("ddlTipoPlan"); RadioButtonList modal_plan = (RadioButtonList)PageSource.FindControl("modal_plan"); TextBox txtFechaViaje = (TextBox)PageSource.FindControl("txtFechaViaje"); cCache.DatosAdicionales = null; if (ddlZonaGeo != null) { if (ddlZonaGeo.SelectedItem != null) { listaValores.Add(ddlZonaGeo.SelectedItem.Value); } else { listaValores.Add(""); } } else { listaValores.Add(""); } if (ddlPais != null) { if (ddlPais.SelectedItem != null) { listaValores.Add(ddlPais.SelectedItem.Value); } else { listaValores.Add(""); } } else { listaValores.Add(""); } if (ddlCiudad != null) { if (ddlCiudad.SelectedItem != null) { listaValores.Add(ddlCiudad.SelectedItem.Value); } else { listaValores.Add(""); } } else { listaValores.Add(""); } if (ddlTipologia != null) { if (ddlTipologia.SelectedItem != null) { listaValores.Add(ddlTipologia.SelectedItem.Value); } else { listaValores.Add(""); } } else { listaValores.Add(""); } if (ddlTipoPlan != null) { if (ddlTipoPlan.SelectedItem != null) { listaValores.Add(ddlTipoPlan.SelectedItem.Value); } else { listaValores.Add(""); } } else { listaValores.Add(""); } if (modal_plan != null) { if (modal_plan.SelectedItem != null) { listaValores.Add(modal_plan.SelectedItem.Value); } else { listaValores.Add(""); } } if (txtFechaViaje != null && !(txtFechaViaje.Text.ToUpper().Contains("MM"))) { listaValores.Add(txtFechaViaje.Text.Trim()); } cCache.DatosAdicionales = listaValores; csCache.ActualizarCache(cCache); } } string sFiltroPais = ""; string sFiltroZona = ""; string sFiltroTipoPlan = ""; string filtroTexto = ""; if (HttpContext.Current.Request.QueryString["PaisDestino"] != null) { sFiltroPais = "&PaisDestino=" + HttpContext.Current.Request.QueryString["PaisDestino"]; } if (HttpContext.Current.Request.QueryString["ZonaGeo"] != null) { sFiltroZona = "&ZonaGeo=" + HttpContext.Current.Request.QueryString["ZonaGeo"]; } if (HttpContext.Current.Request.QueryString["TipoPlan"] != null) { sFiltroTipoPlan = "&TipoPlan=" + HttpContext.Current.Request.QueryString["TipoPlan"]; } if (HttpContext.Current.Request.QueryString["FiltroTexto"] != null) { filtroTexto = "&FiltroTexto=" + HttpContext.Current.Request.QueryString["FiltroTexto"]; } //if (HttpContext.Current.Request.QueryString["FiltroTexto"] != null) // filtroTexto = "&FiltroTexto=" + HttpContext.Current.Request.QueryString["FiltroTexto"]; //filtro de texto //if (txtFiltroTexto != null && // !string.IsNullOrWhiteSpace(txtFiltroTexto.Text)) //{ filtroTexto = "&FiltroTexto=" + txtFiltroTexto.Text; //} clsValidaciones.RedirectPagina("ResultadoPlanes.aspx?ORIGEN=BUSCADOR" + sFiltroPais + sFiltroZona + sFiltroTipoPlan + filtroTexto); } 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.Metodo = "setGuardarParametrosBusqueda"; cParametros.Complemento = "Error en al guardar los parametros de busqueda en traslados"; ExceptionHandled.Publicar(cParametros); } }
/// <summary> /// Metodo para incluir el segmento futuro despues de cerrada la reserva /// Se debe tener en el web.config, la llave SegmentoFuturo, dentro del espacio de credenciales de sabre, si esta en 0, no lo toma /// </summary> /// <param name="sPNR">Record</param> /// <remarks> /// Autor: José Faustino Posas /// Company: Ssoft Colombia /// Fecha: 2012-02-14 /// ------------------- /// Control de Cambios /// ------------------- /// Autor: /// Fecha: /// Descripción: /// </remarks> public static void _ADDSegmentoFuturo(string sPNR) { clsParametros objParametros = new clsParametros(); try { int iDias = 280; try { iDias = clsSesiones.getCredentials().SegmentoFuturo; } catch { } if (iDias.Equals(0)) { objParametros.Id = 0; objParametros.Code = "0"; objParametros.Info = "Segmento no incluido por ser valor 0"; objParametros.Message = "No icluye OTH"; objParametros.Severity = clsSeveridad.Baja; objParametros.Metodo = "clsRulesFromPrice.getRulesSegment()"; objParametros.Tipo = clsTipoError.WebServices; Ssoft.ManejadorExcepciones.ExceptionHandled.Publicar(objParametros); } else { string sCommand = "I"; string sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand); sCommand = "*" + sPNR; sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand); DateTime dtm_Fecha_Segmento = DateTime.Now; /*SE SUMAN LOS 330 DIAS*/ dtm_Fecha_Segmento = dtm_Fecha_Segmento.AddDays(iDias); /*OBTENEMOS EL MES EN LETRAS, EN INGLES*/ string str_Mes_Letras = clsValidaciones.RetornaMesLetrasCorto(dtm_Fecha_Segmento.Month.ToString(), "en"); String str_Dia = dtm_Fecha_Segmento.Day.ToString(); if (str_Dia.Length == 1) { str_Dia = "0" + str_Dia; } sCommand = "0OTHAAGK1BOG" + str_Dia + str_Mes_Letras.ToUpper(); sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand); sCommand = "6WEB"; sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand); sCommand = "ET"; sRespuesta = Negocios_WebServiceSabreCommand._EjecutarComando(sCommand); } } catch (Exception Ex) { objParametros.Id = 0; objParametros.Code = "0"; objParametros.Info = "Segmento no incluido por ser error al ejecutar comando"; objParametros.Message = Ex.Message.ToString(); objParametros.Complemento = "No icluye OTH"; objParametros.Severity = clsSeveridad.Baja; objParametros.Metodo = "clsRulesFromPrice.getRulesSegment()"; objParametros.Tipo = clsTipoError.WebServices; Ssoft.ManejadorExcepciones.ExceptionHandled.Publicar(objParametros); } }
public void GuardarParametrosBusquedaSeguros(UserControl PageSource) { try { csGeneralsPag.Idioma(PageSource); clsCache cCache = new csCache().cCache(); if (cCache != null) { List <string> listaValores = new List <string>(); DropDownList ddlZonaGeo = (DropDownList)PageSource.FindControl("ddlZonaGeo"); DropDownList ddlCantidadPax = (DropDownList)PageSource.FindControl("ddlCantidadPax"); TextBox txtFechaSalidaTarjetas = (TextBox)PageSource.FindControl("txtFechaSalidaTarjetas"); TextBox txt2TFechaRegresoTarjetas = (TextBox)PageSource.FindControl("txt2TFechaRegresoTarjetas"); Repeater rptEdadPax = (Repeater)PageSource.FindControl("rptEdadPax"); if (ddlZonaGeo.SelectedValue.Equals("") || ddlZonaGeo.SelectedValue.Equals("0") || txtFechaSalidaTarjetas.Text.Trim().Equals("") || txt2TFechaRegresoTarjetas.Text.Trim().Equals("") || getVaciosFechasNac(rptEdadPax)) { Label lblErrorSeguros = (Label)PageSource.FindControl("lblErrorSeguros"); if (lblErrorSeguros != null) { lblErrorSeguros.Text = "Por favor completa todos los parametros de búsqueda"; } } else { cCache.DatosAdicionales = null; if (ddlZonaGeo != null) { if (ddlZonaGeo.SelectedItem != null) { listaValores.Add(ddlZonaGeo.SelectedItem.Value); } else { listaValores.Add(""); } } if (txtFechaSalidaTarjetas != null) { listaValores.Add(txtFechaSalidaTarjetas.Text.Trim()); } if (txt2TFechaRegresoTarjetas != null) { listaValores.Add(txt2TFechaRegresoTarjetas.Text.Trim()); } if (ddlCantidadPax != null) { if (ddlCantidadPax.SelectedItem != null) { listaValores.Add(ddlCantidadPax.SelectedItem.Value); } else { listaValores.Add(""); } } string sFechasNac = ""; for (int i = 0; i < rptEdadPax.Items.Count; i++) { TextBox txtFecha = (TextBox)rptEdadPax.Items[i].FindControl("txtNacimientoFecha"); if (i == rptEdadPax.Items.Count - 1) { sFechasNac = sFechasNac + txtFecha.Text; } else { sFechasNac = sFechasNac + txtFecha.Text + ","; } } listaValores.Add(sFechasNac); string strUrl = ""; if (ddlZonaGeo != null) { if (ddlZonaGeo.SelectedItem != null) { strUrl = "&ZnaTex=" + ddlZonaGeo.SelectedItem.Text; } else { strUrl = ""; } } cCache.DatosAdicionales = listaValores; csCache.ActualizarCache(cCache); clsValidaciones.RedirectPagina("ResultadoSeguros.aspx?TipoPlan=" + clsValidaciones.GetKeyOrAdd("TipoPlanTarjetas", "TJAS") + "&id=1" + strUrl); } } } 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.Metodo = "setGuardarParametrosBusqueda"; cParametros.Complemento = "Error en al guardar los parametros de busqueda en traslados"; ExceptionHandled.Publicar(cParametros); } }
private static clsParametros Comando(string Comando_) { /*METODO BASE QUE SIRVE PARA EJECUTAR COMANDOS*/ clsParametros cParametros = new clsParametros(); try { clsSabreCommandLLS objClsSabreCommandLLS = new clsSabreCommandLLS(); /*ASIGNAMOS LA SESSION DE SABRE*/ objClsSabreCommandLLS.StrSesion = AutenticacionSabre.GET_SabreSession(); if (objClsSabreCommandLLS.StrSesion != null) { WebService_SabreCommandLLS.SabreCommandLLSRS SabreCommandRespuesta_ = objClsSabreCommandLLS._Sabre_EjecutarComando(Comando_); if (SabreCommandRespuesta_ != null) { if (SabreCommandRespuesta_.Response != null) { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = SabreCommandRespuesta_.Response; cParametros.Tipo = clsTipoError.Library; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Info = "Comando Sabre: " + Comando_; cParametros.Complemento = "Response: " + SabreCommandRespuesta_.Response; ExceptionHandled.Publicar(cParametros); } else { WebService_SabreCommandLLS.SabreCommandLLSRSErrorRSErrorsError SabreErrores_ = SabreCommandRespuesta_.ErrorRS.Errors.Error; WebService_SabreCommandLLS.SabreCommandLLSRSErrorRSErrorsErrorErrorInfo SabreErroresInfo_ = SabreErrores_.ErrorInfo; if (SabreErrores_ != null) { cParametros.Id = 0; cParametros.TipoLog = Enum_Error.Log; cParametros.Message = SabreErrores_.ErrorMessage; cParametros.Code = SabreErrores_.ErrorCode; cParametros.Info = SabreErrores_.ErrorInfo.Message; cParametros.Severity = SabreErrores_.Severity; cParametros.Tipo = clsTipoError.Library; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Error al ejecutar Comando " + Comando_ + " Sabre"; ExceptionHandled.Publicar(cParametros); try { setEmailError(cParametros, "Error al ejecutar comando"); } catch { } } } } } else { cParametros.Id = 0; cParametros.Message = "Sesion no iniciada al ejecutar Comando " + Comando_ + " Sabre"; cParametros.TipoLog = Enum_Error.Log; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.Library; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.ViewMessage.Add("Sesion de sabre no iniciada!!!"); cParametros.Sugerencia.Add("Por favor verifique las credenciales!!!"); ExceptionHandled.Publicar(cParametros); try { setEmailError(cParametros, "Error al ejecutar comando"); } catch { } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message.ToString(); cParametros.Source = Ex.Source.ToString(); cParametros.TipoLog = Enum_Error.Log; cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Alta; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.StackTrace = Ex.StackTrace.ToString(); cParametros.Complemento = "Error al ejecutar Comando " + Comando_ + " Sabre"; ExceptionHandled.Publicar(cParametros); if (cParametros.Message.Contains("limit of Host TAs allocated")) { cParametros.ViewMessage.Add("En este momento hay mas de 2000 usuarios consultado nuestras Promociones!!!"); cParametros.Sugerencia.Add("Por favor intente de nuevo en 5 minutos!!!"); clsSesiones.setParametrosError(cParametros); ExceptionHandled.Publicar(cParametros); Page PageActual = (Page)HttpContext.Current.Handler; clsValidaciones.RedirectPagina("ErrorBusqueda.aspx", true); } try { setEmailError(cParametros, "Error al Ejecutar Commando"); } catch { } } return(cParametros); }
public EndTransactionRQ.EndTransactionRS _Sabre_GuardarReserva() { objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials(); EndTransactionRQ.EndTransactionRS EndTransactionResultado_ = new EndTransactionRQ.EndTransactionRS(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { EndTransactionRQ.MessageHeader Mensaje_ = clsSabreBase.__ISabre_EndTransactionLLSUpdated(); if (Mensaje_ != null) { EndTransactionRQ.Security Seguridad_ = new EndTransactionRQ.Security(); Seguridad_.BinarySecurityToken = Session_; EndTransactionRQ.EndTransactionRQ EndTransaction_ = new EndTransactionRQ.EndTransactionRQ(); EndTransactionRQ.EndTransactionRQPOS EndTransactionPos_ = new EndTransactionRQ.EndTransactionRQPOS(); EndTransactionRQ.EndTransactionRQPOSSource EndTransactionSource_ = new EndTransactionRQ.EndTransactionRQPOSSource(); EndTransactionSource_.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; EndTransactionPos_.Source = EndTransactionSource_; EndTransaction_.POS = EndTransactionPos_; EndTransactionRQ.EndTransactionRQEndTransaction EndTransactionEnd_ = new EndTransactionRQ.EndTransactionRQEndTransaction(); EndTransactionRQ.EndTransactionRQUpdatedBy EndTransaction_Update_ = new EndTransactionRQ.EndTransactionRQUpdatedBy(); EndTransactionRQ.EndTransactionRQUpdatedByTPA_Extensions EndTransaction_UpdateTPA_ = new EndTransactionRQ.EndTransactionRQUpdatedByTPA_Extensions(); EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccess EndTransaction_UpdateTPAAccess_ = new EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccess(); EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccessAccessPerson EndTransaction_UpdateTPAAccessPerson_ = new EndTransactionRQ.EndTransactionRQUpdatedByTPA_ExtensionsAccessAccessPerson(); EndTransaction_UpdateTPAAccessPerson_.GivenName = "WEB"; EndTransaction_UpdateTPAAccess_.AccessPerson = EndTransaction_UpdateTPAAccessPerson_; EndTransaction_UpdateTPA_.Access = EndTransaction_UpdateTPAAccess_; EndTransaction_Update_.TPA_Extensions = EndTransaction_UpdateTPA_; EndTransaction_.UpdatedBy = EndTransaction_Update_; EndTransactionEnd_.Ind = true; EndTransactionEnd_.IndSpecified = true; /*PARA CONFIGURAR SI SE ENVIA CORREO DE NOTIFICACION*/ string sCorreo; try { sCorreo = ConfigurationManager.AppSettings["Sabre_VirtuallyThere"].ToString(); } catch { sCorreo = "True"; } if (sCorreo.Equals("True")) { EndTransactionRQ.EndTransactionRQEndTransactionSendEmail oSendEmail = new EndTransactionRQ.EndTransactionRQEndTransactionSendEmail(); oSendEmail.Ind = true; oSendEmail.IndSpecified = true; EndTransactionEnd_.SendEmail = oSendEmail; } EndTransaction_.EndTransaction = EndTransactionEnd_; EndTransaction_.Version = clsSabreBase.SABRE_VERSION_ENDTRANSACTION; EndTransactionRQ.EndTransactionService EndTransactionServicio_ = new EndTransactionRQ.EndTransactionService(); EndTransactionServicio_.MessageHeaderValue = Mensaje_; EndTransactionServicio_.SecurityValue = Seguridad_; try { string sConvenio = csVuelos.csConvenio(); if (!sConvenio.Length.Equals(0)) { string Comando_ = "WPAC*" + sConvenio + "¥RQ"; Negocios_WebServiceSabreCommand._EjecutarComandoSinRetorno(Comando_); } } catch { } EndTransactionServicio_.Url = objvo_Credentials.UrlWebServices; EndTransactionResultado_ = EndTransactionServicio_.EndTransactionRQ(EndTransaction_); //string sComando = "PQ"; //string sVenta = Negocios_WebServiceSabreCommand._EjecutarComando(sComando); if (EndTransactionResultado_.Errors != null) { cParametros.Id = 0; cParametros.TipoLog = Enum_Error.Log; cParametros.Code = EndTransactionResultado_.Errors.Error.ErrorCode; cParametros.Message = EndTransactionResultado_.Errors.Error.ErrorMessage; cParametros.Severity = EndTransactionResultado_.Errors.Error.Severity; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "_Sabre_GuardarReserva"; cParametros.Complemento = "HostCommand: " + EndTransactionResultado_.TPA_Extensions.HostCommand; cParametros.ViewMessage.Add("La reserva no pudo ser confirmada"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); consulta.AppendLine("Credenciales: "); if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } cParametros.TargetSite = consulta.ToString(); ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "_Sabre_GuardarReserva"; cParametros.Complemento = "HostCommand: " + EndTransactionResultado_.TPA_Extensions.HostCommand; try { if (EndTransactionResultado_.UniqueID != null) { cParametros.Message = EndTransactionResultado_.UniqueID.ID; } } catch { } consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.TargetSite = consulta.ToString(); ExceptionHandled.Publicar(cParametros); } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.StackTrace = Ex.StackTrace; cParametros.Source = Ex.Source; cParametros.TargetSite = Ex.TargetSite.ToString(); cParametros.Severity = clsSeveridad.Alta; cParametros.Metodo = "_Sabre_GuardarReserva"; cParametros.Tipo = clsTipoError.WebServices; consulta.AppendLine("Credenciales: "); if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } cParametros.TargetSite = consulta.ToString(); ExceptionHandled.Publicar(cParametros); } return(EndTransactionResultado_); }