public void cambiar_contrasenia(string Contrasenia, Label lblError) { clsCache cCache = new csCache().cCache(); csConsultasUsuarios Usuarios = new csConsultasUsuarios(); DataTable tblDatos = Usuarios.modificar_contrasenia_usuario(cCache.Contacto, Contrasenia); if (tblDatos != null) { int iFilasAfectadas = Convert.ToInt32(tblDatos.Rows[0][0].ToString()); if (iFilasAfectadas > 0) { lblError.Text = "Tu contraseña fue modificada con éxito!"; } else { lblError.Text = "Tu contraseña no pudo ser modificada"; } } else { lblError.Text = "Tu contraseña no pudo ser modificada"; } }
/// <summary> /// Metodo que ejecuta el command del boton del buscador de plan y que direcciona al metodo principal de busqueda /// </summary> /// <param name="PageSource"></param> /// <param name="source"></param> /// <param name="e"></param> /// <remarks> /// Autor: Juan Camilo Diaz /// Company: Ssoft Colombia /// Fecha: 2013-11-12 /// ------------------- /// Control de Cambios /// ------------------- /// </remarks> public void setCommand(UserControl PageSource, object source, CommandEventArgs e) { try { clsCache cCache = new csCache().cCache(); if (cCache != null) { switch (e.CommandName) { case "PlanesC": GuardarParametrosBusquedaCircular(PageSource); break; case "PlanesD": GuardarParametrosBusquedaCircularD(PageSource); break; } } } catch { } }
public void setCargar(UserControl PageSource) { try { clsCache cCache = new csCache().cCache(); if (cCache != null) { DataSet dsData = new DataSet(); string sAgencia = csReferencias.csEmpresa(); csReferencias cReferencia = new csReferencias(); dsData = cReferencia.csRemark(sAgencia); setFormulario(PageSource, dsData); setHabilitaEditar(PageSource, false); } else { csGeneralsPag.FinSesion(); } } 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 = "Gastos "; cParametros.ViewMessage.Add("Su sesion ha terminado"); cParametros.Sugerencia.Add("Por favor confirme con el administrador"); ExceptionHandled.Publicar(cParametros); new csCache().setError(PageSource, cParametros); } }
public void setEditar(UserControl PageSource) { try { clsCache cCache = new csCache().cCache(); if (cCache != null) { string sEmpresa = clsValidaciones.GetKeyOrAdd("Empresa", "EM"); DropDownList ddlEmpresa = (DropDownList)PageSource.FindControl("ddlEmpresa"); string sLink = "Contacto=" + ddlEmpresa.SelectedValue.ToString() + "&Tipo=" + sEmpresa; if (!ddlEmpresa.SelectedValue.ToString().Equals("0")) { clsValidaciones.RedirectPagina("ModificarUsuario.aspx?" + sLink); } } else { csGeneralsPag.FinSesion(); } } 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 = "Gastos "; cParametros.ViewMessage.Add("Su sesion ha terminado"); cParametros.Sugerencia.Add("Por favor confirme con el administrador"); ExceptionHandled.Publicar(cParametros); new csCache().setError(PageSource, cParametros); } }
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); } }
/// <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); } }
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 void setCargar(UserControl PageSource) { try { csGeneralsPag.Idioma(PageSource); clsCache cCache = new csCache().cCache(); if (cCache != null) { HtmlGenericControl buscador = (HtmlGenericControl)PageSource.FindControl("buscador"); HtmlGenericControl empresa = (HtmlGenericControl)PageSource.FindControl("empresa"); string sValue = csValue(PageSource); switch (sValue) { case "0": buscador.Visible = true; empresa.Visible = false; break; case "1": buscador.Visible = false; empresa.Visible = true; //csEmpresas(PageSource, cCache.ContactoPadre.ToString()); break; case "2": buscador.Visible = false; empresa.Visible = false; break; case "3": clsValidaciones.RedirectPagina("TareasProyectos.aspx", true); break; } } else { csGeneralsPag.FinSesion(); } } 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 = "Gastos "; cParametros.ViewMessage.Add("Su sesion ha terminado"); cParametros.Sugerencia.Add("Por favor confirme con el administrador"); ExceptionHandled.Publicar(cParametros); new csCache().setError(PageSource, cParametros); } }
public void setCerrar(string strSesion) { SessionCloseRS oServicioCerrar = new SessionCloseRS(); try { MessageHeader oMensaje = clsSabreBase.SessionClose(); clsParametros cParametros = new clsParametros(); if (oMensaje != null) { Security oSeguridad = new Security(); oSeguridad.BinarySecurityToken = strSesion; SessionCloseRQ oCerrarSesion = new SessionCloseRQ(); SessionCloseRQPOS oCerrarSesionPos = new SessionCloseRQPOS(); SessionCloseRQPOSSource oCerrarSesionSource = new SessionCloseRQPOSSource(); oCerrarSesionPos.Source = oCerrarSesionSource; oCerrarSesion.POS = oCerrarSesionPos; SessionCloseRQService oServicio = new SessionCloseRQService(); oServicio.MessageHeaderValue = oMensaje; oServicio.SecurityValue = oSeguridad; oServicioCerrar = oServicio.SessionCloseRQ(oCerrarSesion); if (oServicioCerrar.Errors != null) { cParametros.Id = 0; cParametros.Code = oServicioCerrar.Errors.Error.ErrorCode; cParametros.Info = oServicioCerrar.Errors.Error.ErrorInfo.Message; cParametros.Message = oServicioCerrar.Errors.Error.ErrorMessage; cParametros.Severity = oServicioCerrar.Errors.Error.Severity; cParametros.Complemento = "HostCommand: "; cParametros.Metodo = "CerrarSesion"; cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = oServicioCerrar.Success.ToString(); cParametros.Metodo = "_Remark_Observaciones"; cParametros.Complemento = "HostCommand: "; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Moderada; 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) { clsParametros cParametros = new clsParametros(); /*SI OCURRE UNA EXCEPCION CUALQUIERA*/ cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Metodo = Ex.TargetSite.Name; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.Complemento = "Error al abrir la sesion de sabre"; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Ex = Ex; ExceptionHandled.Publicar(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 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 OTA_TravelItineraryRS _Sabre_LeerInformacionPNR(string Record_) { OTA_TravelItineraryRS TravelResultado_ = new OTA_TravelItineraryRS(); clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); try { objvo_Credentials = clsSesiones.getCredentials(); OTA_TravelItineraryRead.MessageHeader Mensaje_ = clsSabreBase.OTA_TravelItineraryRead(); if (Mensaje_ != null) { OTA_TravelItineraryRead.Security Seguridad_ = new OTA_TravelItineraryRead.Security(); Seguridad_.BinarySecurityToken = Session_; OTA_TravelItineraryReadRQ Travel_ = new OTA_TravelItineraryReadRQ(); OTA_TravelItineraryReadRQPOS TravelPos_ = new OTA_TravelItineraryReadRQPOS(); OTA_TravelItineraryReadRQPOSSource TravelSource_ = new OTA_TravelItineraryReadRQPOSSource(); TravelSource_.PseudoCityCode = objvo_Credentials.Pcc; TravelPos_.Source = TravelSource_; Travel_.POS = TravelPos_; OTA_TravelItineraryReadRQUniqueID Travel_UniqueID_ = new OTA_TravelItineraryReadRQUniqueID(); OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction[] aTPA_ExtensionsTransaction = new OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction[1]; OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction oTPA_ExtensionsTransaction = new OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsTransaction(); OTA_TravelItineraryReadRQUniqueIDTPA_Extensions oIDTPA_Extensions = new OTA_TravelItineraryReadRQUniqueIDTPA_Extensions(); Travel_UniqueID_.ID = Record_; oTPA_ExtensionsTransaction.Code = "AIT"; aTPA_ExtensionsTransaction.SetValue(oTPA_ExtensionsTransaction, 0); oIDTPA_Extensions.Transaction = aTPA_ExtensionsTransaction; //Travel_UniqueID_.TPA_Extensions = oIDTPA_Extensions; Travel_.UniqueID = Travel_UniqueID_; OTA_TravelItineraryReadRQUniqueIDTPA_Extensions oUniqueIDTPA_Extensions = new OTA_TravelItineraryReadRQUniqueIDTPA_Extensions(); OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsRedisplay oUniqueIDTPA_ExtensionsRedisplay = new OTA_TravelItineraryReadRQUniqueIDTPA_ExtensionsRedisplay(); oUniqueIDTPA_ExtensionsRedisplay.Ind = false; oUniqueIDTPA_Extensions.Redisplay = oUniqueIDTPA_ExtensionsRedisplay; Travel_UniqueID_.TPA_Extensions = oUniqueIDTPA_Extensions; OTA_TravelItineraryReadRQTPA_Extensions oTPA_Extensions = new OTA_TravelItineraryReadRQTPA_Extensions(); OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetails oMessagingDetails = new OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetails(); OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetailsMDRSubset oMDRSubset = new OTA_TravelItineraryReadRQTPA_ExtensionsMessagingDetailsMDRSubset(); oMDRSubset.Code = "PN12"; oMessagingDetails.MDRSubset = oMDRSubset; oTPA_Extensions.MessagingDetails = oMessagingDetails; Travel_.TPA_Extensions = oTPA_Extensions; Travel_.Version = clsSabreBase.SABRE_VERSION_TRAVELITINERARYREADLLS; OTA_TravelItineraryService TravelServicio_ = new OTA_TravelItineraryService(); TravelServicio_.MessageHeaderValue = Mensaje_; TravelServicio_.SecurityValue = Seguridad_; TravelServicio_.Url = objvo_Credentials.UrlWebServices; TravelResultado_ = TravelServicio_.OTA_TravelItineraryReadRQ(Travel_); if (TravelResultado_.Errors != null) { cParametros.Id = 0; cParametros.Code = TravelResultado_.Errors.Error.ErrorCode; cParametros.Info = TravelResultado_.Errors.Error.ErrorInfo.Message; cParametros.Message = TravelResultado_.Errors.Error.ErrorMessage; cParametros.Severity = TravelResultado_.Errors.Error.Severity; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Recuperacion de la reserva " + Record_; cParametros.ViewMessage.Add("Error al intentar recuperar la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); consulta.AppendLine("Reserva: " + Record_); } } catch { } cParametros.TargetSite = consulta.ToString(); try { clsCache cCache = new csCache().cCache(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); try { Negocios_WebServiceSabreCommand.setEmailError(cParametros, "Error al Recuperar la reserva " + Record_); } catch { } } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = TravelResultado_.Success; cParametros.Metodo = "Informacion PNR"; cParametros.Complemento = "HostCommand: " + TravelResultado_.TPA_Extensions.HostCommand; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Moderada; consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); consulta.AppendLine("Reserva: " + Record_); } } catch { } cParametros.TargetSite = consulta.ToString(); try { clsCache cCache = new csCache().cCache(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } ExceptionHandled.Publicar(cParametros); } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = Ex.TargetSite.Name; cParametros.Complemento = "Recuperacion de la reserva " + Record_; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("Error al intentar recuperar la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); try { Negocios_WebServiceSabreCommand.setEmailError(cParametros, "Error al Recuperar la reserva " + Record_); } catch { } } return(TravelResultado_); }
public OTA_CancelRS _Sabre_CancelRecord() { OTA_CancelRS TravelResultado_ = new OTA_CancelRS(); clsResultados cResultados = new clsResultados(); clsParametros cParametros = new clsParametros(); StringBuilder consulta = new StringBuilder(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; try { objvo_Credentials = clsSesiones.getCredentials(); OTA_Cancel.MessageHeader Mensaje_ = clsSabreBase.OTA_Cancel(); if (Mensaje_ != null) { OTA_Cancel.Security Seguridad_ = new OTA_Cancel.Security(); Seguridad_.BinarySecurityToken = Session_; OTA_CancelRQ Travel_ = new OTA_CancelRQ(); OTA_CancelRQPOS TravelPos_ = new OTA_CancelRQPOS(); OTA_CancelRQPOSSource TravelSource_ = new OTA_CancelRQPOSSource(); TravelSource_.PseudoCityCode = objvo_Credentials.Pcc; TravelPos_.Source = TravelSource_; Travel_.POS = TravelPos_; OTA_CancelRQTPA_Extensions oTPA_Extensions = new OTA_CancelRQTPA_Extensions(); OTA_CancelRQTPA_ExtensionsMessagingDetails oMessagingDetails = new OTA_CancelRQTPA_ExtensionsMessagingDetails(); OTA_CancelRQTPA_ExtensionsMessagingDetailsMDRSubset oMDRSubset = new OTA_CancelRQTPA_ExtensionsMessagingDetailsMDRSubset(); //oMDRSubset.Code = "PN12"; //oMessagingDetails.MDRSubset = oMDRSubset; //oTPA_Extensions.MessagingDetails = oMessagingDetails; OTA_CancelRQTPA_ExtensionsSegmentCancel oSegmentCancel = new OTA_CancelRQTPA_ExtensionsSegmentCancel(); OTA_CancelRQTPA_ExtensionsSegmentCancelSegment oSegmentCancelSegment = new OTA_CancelRQTPA_ExtensionsSegmentCancelSegment(); OTA_CancelRQTPA_ExtensionsSegmentCancelSegment[] oSegmentCancelSegments = new OTA_CancelRQTPA_ExtensionsSegmentCancelSegment[1]; //oSegmentCancelSegment.Number = "1"; //oSegmentCancelSegment.EndNumber = iSegmentos.ToString(); //oSegmentCancelSegments[0] = oSegmentCancelSegment; //oSegmentCancel.Segment = oSegmentCancelSegments; // "Type" refers to the segment type that the user wants to cancel. Acceptable values for "Type" are "Air", "Car", "Hotel", "Other", or "Entire". These formats look like this: "XIA", "XIC", "XIH", "XIO", or "XI". oSegmentCancel.Type = "Entire"; oTPA_Extensions.SegmentCancel = oSegmentCancel; Travel_.TPA_Extensions = oTPA_Extensions; Travel_.Version = clsSabreBase.SABRE_VERSION_CANCEL; OTA_CancelService TravelServicio_ = new OTA_CancelService(); TravelServicio_.MessageHeaderValue = Mensaje_; TravelServicio_.SecurityValue = Seguridad_; TravelServicio_.Url = objvo_Credentials.UrlWebServices; TravelResultado_ = TravelServicio_.OTA_CancelRQ(Travel_); if (TravelResultado_.Errors != null) { cParametros.Id = 0; cParametros.Code = TravelResultado_.Errors.Error.ErrorCode; cParametros.Message = TravelResultado_.Errors.Error.ErrorMessage; cParametros.Severity = TravelResultado_.Errors.Error.Severity; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Cancelacion de la reserva"; cParametros.ViewMessage.Add("Error al intentar cancelar la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.TargetSite = consulta.ToString(); try { clsCache cCache = new csCache().cCache(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = TravelResultado_.Success; consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.TargetSite = consulta.ToString(); try { clsCache cCache = new csCache().cCache(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } cParametros.Metodo = "CancelRecord"; cParametros.Complemento = "HostCommand: " + TravelResultado_.TPA_Extensions.HostCommand; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Moderada; ExceptionHandled.Publicar(cParametros); } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = Ex.TargetSite.Name; cParametros.Complemento = "Cancelacion de la reserva"; cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("Error al intentar cancelar la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(TravelResultado_); }
public clsResultados 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); }
/// <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 HotelFare getHotelFare(DataSet dsData) { clsParametros cParametros = new clsParametros(); HotelFare oHotelFare = new HotelFare(); StringBuilder consulta = new StringBuilder(); VO_Credentials vo_Credentials = clsCredenciales.Credenciales(Enum_ProveedorWebServices.TotalTrip); bool bSoloTT = false; try { bSoloTT = bool.Parse(clsValidaciones.GetKeyOrAdd("bSoloTT", "False")); } catch { } try { VO_HotelValuedAvailRQ vo_HotelValuedAvailRQ = clsSesiones.getParametrosHotel(); DataTable dtHotelInfo = dsData.Tables[clsEsquema.TABLA_HOTEL_INFO]; DataTable dtHotelRoom = dsData.Tables[clsEsquema.TABLA_HOTEL_ROOM]; DataTable dtPriceDate = dsData.Tables[clsEsquema.TABLA_PRICE]; if (dtHotelInfo.Rows.Count > 0) { string sWhere = string.Empty; int sHotel = int.Parse(dtHotelInfo.Rows[0][clsEsquema.COLUMN_HOTELCODE].ToString()); string sCityCode = dtHotelInfo.Rows[0][clsEsquema.COLUMN_DESTINATION_CODE].ToString(); decimal dAgencyComision = clsValidaciones.getDecimalNotRound(dtHotelInfo.Rows[0][clsEsquema.COLUMN_AGENCY_COMISION].ToString()); decimal dIva = clsValidaciones.getDecimalNotRound(dtHotelInfo.Rows[0][clsEsquema.COLUMN_IVA].ToString()); int iSource = int.Parse(dtHotelInfo.Rows[0][clsEsquema.COLUMN_SOURCE].ToString()); Hotel oHotel = new Hotel(); string sAdulto = clsValidaciones.GetKeyOrAdd("AdultoHB", "AD"); string sInfante = clsValidaciones.GetKeyOrAdd("InfanteHB", "CH"); int iRoom = dtHotelRoom.Rows.Count; HotelRoom[] oRoomArray = new HotelRoom[iRoom]; oHotel.CityCode = sCityCode; oHotel.HotelCode = sHotel; oHotel.Source = iSource; for (int i = 0; i < iRoom; i++) { HotelRoomType[] oHotelRoomTypeArray = new HotelRoomType[1]; sWhere = clsEsquema.COLUMN_HOTEL_ROOM_ID + " = " + dtHotelRoom.Rows[i][clsEsquema.COLUMN_HOTEL_ROOM_ID].ToString(); HotelRoom oRoom = new HotelRoom(); HotelRoomType oHotelRoomType = new HotelRoomType(); int iPax = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList.Count; HotelRoomPax[] oPaxArray = new HotelRoomPax[iPax]; for (int j = 0; j < iPax; j++) { HotelRoomPax oPax = new HotelRoomPax(); oPax.Age = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Age; if (vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Type.Equals(sAdulto)) { oPax.PaxType = PaxType.Adult; } else { oPax.PaxType = PaxType.Child; } oPax.EmailAddress = "*****@*****.**"; oPax.FirstName = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].Name; oPax.LastName = vo_HotelValuedAvailRQ.lHotelOccupancy[i].Occupancy.lGuestList[j].LastName; oPax.PhoneNumber = "571"; oPaxArray[j] = oPax; } oRoom.Paxes = oPaxArray; DataRow[] drRoomsPrices = dtPriceDate.Select(sWhere); int iFechas = drRoomsPrices.Length; EffectiveDate[] eFechasArray = new EffectiveDate[iFechas]; int k = 0; foreach (DataRow drRoomPrice in drRoomsPrices) { EffectiveDate eFechas = new EffectiveDate(); eFechas.Date = DateTime.Parse(drRoomPrice[clsEsquema.COLUMN_DATE].ToString());; eFechas.AmountAfterTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_AMOUN_AFTER_TAX].ToString()); eFechas.AmountBeforeTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_AMOUN_BEFORE_TAX].ToString()); eFechas.DiscountAfterTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_DISCOUNT_AFTER_TAX].ToString()); eFechas.DiscountBeforeTax = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_PRICE_DISCOUNT_BEFORE_TAX].ToString()); try { eFechas.Currency = drRoomPrice[clsEsquema.COLUMN_CURRENCY].ToString(); eFechas.ProviderCurrency = drRoomPrice[clsEsquema.COLUMN_PROVIDER_CURRENCY].ToString(); eFechas.ROE = decimal.Parse(drRoomPrice[clsEsquema.COLUMN_ROE].ToString()); } catch { } eFechasArray[k] = eFechas; k++; } oHotelRoomType.EffectiveDates = eFechasArray; oHotelRoomType.InvBlockCode = dtHotelRoom.Rows[i][clsEsquema.COLUMN_CHARASTERISTIC].ToString(); oHotelRoomType.RatePlanType = dtHotelRoom.Rows[i][clsEsquema.COLUMN_CONFIRM_RATEPLANTYPE].ToString(); oHotelRoomType.RoomDesc = dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_TYPE_TEXT].ToString(); oHotelRoomType.RoomRate = dtHotelRoom.Rows[i][clsEsquema.COLUMN_SHRUI].ToString(); oHotelRoomType.RoomType = dtHotelRoom.Rows[i][clsEsquema.COLUMN_TYPE].ToString(); oHotelRoomType.AmountIncludedBoardSurcharge = decimal.Parse(dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_AMOUNT_SURCHARGE].ToString()); try { if (!dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_TTL].ToString().Equals("True")) { oHotelRoomType.TTL = DateTime.Parse(dtHotelRoom.Rows[i][clsEsquema.COLUMN_ROOM_TTL].ToString()); } } catch { } oHotelRoomTypeArray[0] = oHotelRoomType; oRoom.RoomTypes = oHotelRoomTypeArray; oRoomArray[i] = oRoom; } oHotelFare.Hot = oHotel; oHotelFare.Rooms = oRoomArray; oHotelFare.AgencyCommission = dAgencyComision; oHotelFare.Iva = dIva; if (bSoloTT) { oHotelFare.ContentType = ContentType.Exclusive; } else { oHotelFare.ContentType = ContentType.NonExclusive; } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Confirmacion de Hoteles"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.Source = Ex.Source; cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("No se confirmo la reserva"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); ExceptionHandled.Publicar(cParametros); } return(oHotelFare); }
public void actualizar_usuario(Repeater rptUsuario, Label lblError) { try { bool bGuardar = true; TextBox txtNombre = null; TextBox txtApellido = null; DropDownList ddlTipoIdent = null; TextBox txtIdentificacion = null; RadioButtonList rblSexo = null; TextBox txtNacimiento = null; TextBox txtDireccion = null; TextBox txtTel = null; TextBox txtCel = null; DropDownList ddlPais = null; DropDownList ddlCiudad = null; for (int i = 0; i < rptUsuario.Items.Count; i++) { #region Validacion vacios txtNombre = (TextBox)rptUsuario.Items[i].FindControl("txtNombre"); if (txtNombre != null) { if (txtNombre.Text.Trim().Equals("")) { bGuardar = false; } } txtApellido = (TextBox)rptUsuario.Items[i].FindControl("txtApellido"); if (txtApellido != null) { if (txtApellido.Text.Trim().Equals("")) { bGuardar = false; } } ddlTipoIdent = (DropDownList)rptUsuario.Items[i].FindControl("ddlTipoIdent"); if (ddlTipoIdent != null) { if (ddlTipoIdent.SelectedValue.Equals("") || ddlTipoIdent.SelectedValue.Equals("0")) { bGuardar = false; } } txtIdentificacion = (TextBox)rptUsuario.Items[i].FindControl("txtIdentificacion"); if (txtIdentificacion != null) { if (txtIdentificacion.Text.Trim().Equals("")) { bGuardar = false; } } rblSexo = (RadioButtonList)rptUsuario.Items[i].FindControl("rblSexo"); if (rblSexo != null) { if (rblSexo.SelectedValue.Equals("") || rblSexo.SelectedValue.Equals("0")) { bGuardar = false; } } txtNacimiento = (TextBox)rptUsuario.Items[i].FindControl("txtNacimiento"); if (txtNacimiento != null) { if (txtNacimiento.Text.Trim().Equals("")) { bGuardar = false; } } txtDireccion = (TextBox)rptUsuario.Items[i].FindControl("txtDireccion"); if (txtDireccion != null) { if (txtDireccion.Text.Trim().Equals("")) { bGuardar = false; } } txtTel = (TextBox)rptUsuario.Items[i].FindControl("txtTel"); if (txtTel != null) { if (txtTel.Text.Trim().Equals("")) { bGuardar = false; } } txtCel = (TextBox)rptUsuario.Items[i].FindControl("txtCel"); if (txtCel != null) { if (txtCel.Text.Trim().Equals("")) { bGuardar = false; } } ddlPais = (DropDownList)rptUsuario.Items[i].FindControl("ddlPais"); if (ddlPais != null) { if (ddlPais.SelectedValue.Equals("") || ddlPais.SelectedValue.Equals("0")) { bGuardar = false; } } ddlCiudad = (DropDownList)rptUsuario.Items[i].FindControl("ddlCiudad"); if (ddlCiudad != null) { if (ddlCiudad.SelectedValue.Equals("") || ddlCiudad.SelectedValue.Equals("0")) { bGuardar = false; } } #endregion } if (!bGuardar) { lblError.Text = "Por favor completa toda la informacion"; } else { clsCache cCache = new csCache().cCache(); csConsultasUsuarios Usuario = new csConsultasUsuarios(); string sFechaNacimiento = txtNacimiento.Text; try { sFechaNacimiento = clsValidaciones.ConverFecha(sFechaNacimiento, sFormatoFecha, sFormatoFechaBD); } catch { } DataTable dtResultados = Usuario.modificar_datos_usuario(cCache.Contacto, txtNombre.Text, txtApellido.Text, ddlTipoIdent.SelectedValue, txtIdentificacion.Text, rblSexo.SelectedValue, sFechaNacimiento, txtDireccion.Text, txtTel.Text, txtCel.Text, ddlCiudad.SelectedValue); if (dtResultados != null) { int iFilasAfectadas = Convert.ToInt32(dtResultados.Rows[0][0].ToString()); if (iFilasAfectadas > 0) { lblError.Text = "Tus datos fueron actualizados con éxito!"; } else { lblError.Text = "Tus datos no pudieron ser actualizados"; } } } } catch { } }
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 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); }
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 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_); }
private static string ComandoGen(string Comando_) { /*METODO BASE QUE SIRVE PARA EJECUTAR COMANDOS*/ string Datos_ = String.Empty; 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) { Datos_ = SabreCommandRespuesta_.Response; 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.Message = SabreErrores_.ErrorMessage; cParametros.TipoLog = Enum_Error.Log; cParametros.Tipo = clsTipoError.Library; cParametros.Severity = clsSeveridad.Alta; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Error al ejecutar Comando " + Comando_ + " Sabre"; ExceptionHandled.Publicar(cParametros); try { setEmailError(cParametros, "Error al Ejecutar Commando"); } catch { } } } } } else { cParametros.Id = 0; cParametros.Message = "Sesion no iniciada al ejecutar Comando " + Comando_ + " Sabre"; cParametros.Severity = clsSeveridad.Alta; cParametros.TipoLog = Enum_Error.Log; 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); Datos_ = "Sesion de sabre no iniciada, Por favor verifique las credenciales"; try { setEmailError(cParametros, "Error al Ejecutar Commando"); } 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.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); clsCache cCache = new csCache().cCache(); Page PageActual = (Page)HttpContext.Current.Handler; clsValidaciones.RedirectPagina("ErrorBusqueda.aspx", true); } try { setEmailError(cParametros, "Error al Ejecutar Commando"); } catch { } Datos_ = null; } return(Datos_); }
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 string getSesion(VO_SessionCreateRQ vo_SessionCreateRQ) { string strSession = null; MessageHeader oMensaje = clsSabreBase.SessionCreateRQ(); clsParametros cParametros = new clsParametros(); if (oMensaje != null) { string Usuario_ = vo_SessionCreateRQ.StrUsuario; string Clave_ = vo_SessionCreateRQ.StrClave; string IPCC_ = vo_SessionCreateRQ.StrIpcc; string PCC_ = vo_SessionCreateRQ.StrPcc; string Dominio_ = vo_SessionCreateRQ.StrDominio; Security Seguridad_ = new Security(); SecurityUsernameToken SeguridadUsuario_ = new SecurityUsernameToken(); SeguridadUsuario_.Username = Usuario_; SeguridadUsuario_.Password = Clave_; SeguridadUsuario_.Organization = IPCC_; SeguridadUsuario_.Domain = Dominio_; Seguridad_.UsernameToken = SeguridadUsuario_; SessionCreateRQ.SessionCreateRQ CrearSesion_ = new SessionCreateRQ.SessionCreateRQ(); SessionCreateRQPOS CrearSesionPos_ = new SessionCreateRQPOS(); SessionCreateRQPOSSource CrearSesionSource_ = new SessionCreateRQPOSSource(); CrearSesionSource_.PseudoCityCode = PCC_; CrearSesionPos_.Source = CrearSesionSource_; CrearSesion_.POS = CrearSesionPos_; SessionCreateRQService CrearSesionServicio_ = new SessionCreateRQService(); CrearSesionServicio_.MessageHeaderValue = oMensaje; CrearSesionServicio_.SecurityValue = Seguridad_; SessionCreateRS SessionResultado_ = CrearSesionServicio_.SessionCreateRQ(CrearSesion_); if (SessionResultado_.Errors != null) { 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!!!"); /*SI OCURRE UNA EXCEPCION CUALQUIERA*/ cParametros.Id = 0; cParametros.Message = SessionResultado_.Errors.Error.ErrorMessage; cParametros.Info = SessionResultado_.Errors.Error.ErrorInfo.Message; cParametros.Code = SessionResultado_.Errors.Error.ErrorCode; cParametros.Complemento = "Error al abrir la sesion de sabre"; cParametros.Severity = SessionResultado_.Errors.Error.Severity; cParametros.Tipo = clsTipoError.WebServices; cParametros.ViewMessage.Add(sMensaje); cParametros.Sugerencia.Add(sSugerencia); clsSesiones.setParametrosError(cParametros); ExceptionHandled.Publicar(cParametros); clsValidaciones.RedirectPagina("ErrorBusqueda.aspx", true); } else { Seguridad_ = CrearSesionServicio_.SecurityValue; strSession = Seguridad_.BinarySecurityToken; cParametros.Id = 1; cParametros.TipoLog = Enum_Error.Transac; cParametros.Message = "Cerrar Sesion"; cParametros.Metodo = "_Cerrar Sesion"; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Moderada; 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; } } return(strSession); }
public DesignatePrinterRS getDesignatePrinter(VO_PrintersTicketsRQ vo_PrintersTicketsRQ) { /*METODO PRINCICPAL QUE RETORNA EL OBJETO DE RESULTADOS DE SABRE*/ StringBuilder consulta = new StringBuilder(); clsParametros cParametros = new clsParametros(); cParametros.TipoWs = Enum_ProveedorWebServices.Sabre; DesignatePrinterRQ.DesignatePrinterRQ oDesignatePrinterRQ = new WS_SsoftSabre.DesignatePrinterRQ.DesignatePrinterRQ(); DesignatePrinterRS oDesignatePrinterRS = new DesignatePrinterRS(); objvo_Credentials = Ssoft.Utils.clsSesiones.getCredentials(); try { List <string> lsContadorOpciones = new List <string>(); DesignatePrinterRQ.MessageHeader Mensaje_ = clsSabreBase.DesignatePrinter(); if (Mensaje_ != null) { DesignatePrinterRQ.Security Seguridad_ = new DesignatePrinterRQ.Security(); Seguridad_.BinarySecurityToken = Session_; #region [ POS ] DesignatePrinterRQPOS oDesignatePrinterRQPOS = new DesignatePrinterRQPOS(); DesignatePrinterRQPOSSource oDesignatePrinterRQPOSSource = new DesignatePrinterRQPOSSource(); oDesignatePrinterRQPOSSource.PseudoCityCode = objvo_Credentials.Pcc;//ConfigurationManager.AppSettings["Sabre_Ipcc"]; oDesignatePrinterRQPOS.Source = oDesignatePrinterRQPOSSource; oDesignatePrinterRQ.POS = oDesignatePrinterRQPOS; #endregion #region [ VERSION ] oDesignatePrinterRQ.Version = clsSabreBase.SABRE_VERSION_DESIGNATEPRINTER; #endregion #region [ DESIGNATEPRINTERS ] DesignatePrinterRQPrinters oDesignatePrinterRQPrinters = new DesignatePrinterRQPrinters(); DesignatePrinterRQPrintersHardcopy oDesignatePrinterRQPrintersHardcopy = new DesignatePrinterRQPrintersHardcopy(); DesignatePrinterRQPrintersInvoiceItinerary oDesignatePrinterRQPrintersInvoiceItinerary = new DesignatePrinterRQPrintersInvoiceItinerary(); DesignatePrinterRQPrintersTicket oDesignatePrinterRQPrintersTicket = new DesignatePrinterRQPrintersTicket(); DesignatePrinterRQPrintersBoardingPass oDesignatePrinterRQPrintersBoardingPass = new DesignatePrinterRQPrintersBoardingPass(); oDesignatePrinterRQPrintersHardcopy.LineAddress = vo_PrintersTicketsRQ.PrtItinerario; oDesignatePrinterRQPrintersInvoiceItinerary.LineAddress = vo_PrintersTicketsRQ.PrtInvoice; oDesignatePrinterRQPrintersTicket.LineAddress = vo_PrintersTicketsRQ.PrtTicket; oDesignatePrinterRQPrintersTicket.CountryCode = vo_PrintersTicketsRQ.Countrycode; oDesignatePrinterRQPrinters.Hardcopy = oDesignatePrinterRQPrintersHardcopy; oDesignatePrinterRQPrinters.InvoiceItinerary = oDesignatePrinterRQPrintersInvoiceItinerary; oDesignatePrinterRQPrinters.Ticket = oDesignatePrinterRQPrintersTicket; oDesignatePrinterRQ.Printers = oDesignatePrinterRQPrinters; #endregion DesignatePrinterService oDesignatePrinterService = new DesignatePrinterService(); oDesignatePrinterService.MessageHeaderValue = Mensaje_; oDesignatePrinterService.SecurityValue = Seguridad_; oDesignatePrinterService.Url = objvo_Credentials.UrlWebServices; oDesignatePrinterRS = oDesignatePrinterService.DesignatePrinterRQ(oDesignatePrinterRQ); if (oDesignatePrinterRS.Errors != null) { cParametros.Id = 0; cParametros.Code = oDesignatePrinterRS.Errors.Error.ErrorCode; cParametros.Info = oDesignatePrinterRS.Errors.Error.ErrorInfo.Message; cParametros.Message = oDesignatePrinterRS.Errors.Error.ErrorMessage; cParametros.Severity = oDesignatePrinterRS.Errors.Error.Severity; cParametros.Complemento = "HostCommand: " + oDesignatePrinterRS.TPA_Extensions.HostCommand; cParametros.Metodo = "getDesignatePrinter"; cParametros.Tipo = clsTipoError.WebServices; consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.TargetSite = consulta.ToString(); try { clsCache cCache = new csCache().cCache(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } ExceptionHandled.Publicar(cParametros); } else { cParametros.Id = 1; cParametros.Message = oDesignatePrinterRS.Success; cParametros.TipoLog = Enum_Error.Transac; consulta.AppendLine("Credenciales: "); try { if (objvo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Ipcc: " + objvo_Credentials.Ipcc); consulta.AppendLine("Pcc: " + objvo_Credentials.Pcc); consulta.AppendLine("QNumber: " + objvo_Credentials.QNumber); consulta.AppendLine("Dominio: " + objvo_Credentials.Dominio); consulta.AppendLine("Session Sabre: " + Session_.ToString()); consulta.AppendLine("Url Sabre: " + objvo_Credentials.UrlWebServices); } } catch { } cParametros.TargetSite = consulta.ToString(); try { clsCache cCache = new csCache().cCache(); if (cCache != null) { cParametros.Source = "Sesion Local: " + cCache.SessionID.ToString(); } else { cParametros.Source = "Sesion Local: No hay cache "; } } catch { cParametros.Source = "Sesion Local: Error "; } cParametros.Metodo = "getBusqueda"; cParametros.Complemento = "HostCommand: " + oDesignatePrinterRS.TPA_Extensions.HostCommand; cParametros.Tipo = clsTipoError.WebServices; cParametros.Severity = clsSeveridad.Moderada; ExceptionHandled.Publicar(cParametros); } } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.StackTrace = Ex.StackTrace; cParametros.Source = Ex.Source; cParametros.TargetSite = Ex.TargetSite.ToString(); cParametros.Severity = clsSeveridad.Alta; cParametros.Metodo = "getBusqueda"; cParametros.Tipo = clsTipoError.WebServices; ExceptionHandled.Publicar(cParametros); } return(oDesignatePrinterRS); }
public void setBanner(UserControl PageSource) { clsParametros cParametros = new clsParametros(); csGeneralsPag.Idioma(PageSource); try { string sImagenGen = clsValidaciones.ObtenerUrlImages(); string sImagen = sImagenGen + "logo.png"; clsCache cCache = new csCache().cCache(); LinkButton lbCerrarSesion = (LinkButton)PageSource.FindControl("lbCerrarSesion"); Label lblUsuario = (Label)PageSource.FindControl("lblUsuario"); Label lblFecha = (Label)PageSource.FindControl("lblFecha"); Image imgBanner = (Image)PageSource.FindControl("imgBanner"); Panel pnUsuario = (Panel)PageSource.FindControl("pnUsuario"); Panel pnLogin = (Panel)PageSource.FindControl("pnLogin"); Label lblServCarro = (Label)PageSource.FindControl("lblServCarro"); Label lblServCar = (Label)PageSource.FindControl("lblServCar"); Label lblTelefono = (Label)PageSource.FindControl("lblTelefono"); Literal ltlUsuario = (Literal)PageSource.FindControl("ltlUsuario"); Literal ltlFecha = (Literal)PageSource.FindControl("ltlFecha"); Literal ltlPuntos = (Literal)PageSource.FindControl("ltlPuntos"); Literal ltlPuntosVence = (Literal)PageSource.FindControl("ltlPuntosVence"); Literal ltlExpiran = (Literal)PageSource.FindControl("ltlExpiran"); //HtmlGenericControl Expire = (HtmlGenericControl)PageSource.FindControl("Expire"); if (lblTelefono != null) { lblTelefono.Text = clsValidaciones.GetKeyOrAdd("Telefono_Agencia", "3791200"); } if (cCache != null) { bool bVerifica = true; try { bVerifica = cCache.Verifica; } catch { } if (bVerifica) { if (pnLogin != null && pnUsuario != null) { if (clsValidaciones.GetKeyOrAdd("RegistroFormReserva", "True").ToUpper().Equals("TRUE")) { if (clsValidaciones.GetKeyOrAdd("idContacto", "96") == cCache.Contacto) { pnUsuario.Visible = true; pnLogin.Visible = false; } else { pnUsuario.Visible = false; pnLogin.Visible = true; } } else { pnUsuario.Visible = false; pnLogin.Visible = true; } } if (lblServCarro != null) { csCarrito csCarCompUnion = new csCarrito("Reserva" + cCache.SessionID, "CarritoCompras"); DataTable TablaPlanes = csCarCompUnion.RecuperarTabla(); lblServCarro.Text = "(" + TablaPlanes.Rows.Count.ToString() + ")"; if (TablaPlanes.Rows.Count == 0) { lblServCarro.CssClass = "carroCompras"; if (lblServCar != null) { lblServCar.CssClass = "carroCompras"; } } else if (TablaPlanes.Rows.Count > 0) { lblServCarro.CssClass = ""; if (lblServCar != null) { lblServCar.CssClass = ""; } } } if (lbCerrarSesion != null) { lbCerrarSesion.Visible = true; } if (lblUsuario != null) { lblUsuario.Text = cCache.Nombres; } if (lblFecha != null) { lblFecha.Text = DateTime.Now.ToLongDateString(); } } else { if (pnLogin != null && pnUsuario != null) { pnLogin.Visible = false; pnUsuario.Visible = true; lblUsuario.Text = ""; }/*se valida que no sea nulo para evitar excepciones.*/ } } else { if (pnLogin != null && pnUsuario != null) { pnLogin.Visible = false; pnUsuario.Visible = true; lblUsuario.Text = ""; } if (imgBanner != null) { imgBanner.ImageUrl = sImagen; } } //csLogin clogin = new csLogin(); string[] sValor = csValue(); if (!sValor[0].Length.Equals(0)) { setIdioma(sValor[0]); } else { if (!sValor[1].Length.Equals(0)) { setParametrosLogin(PageSource); switch (sValor[1]) { case "Logout": setCerarSesion(PageSource); break; case "Login": setMiCuenta(PageSource); break; case "Idioma": setIdioma(sValor[1]); break; case "Carro": setCarro(PageSource); break; case "Buzon": setContactenos(PageSource); break; case "Link": clsValidaciones.RedirectPagina(sValor[1]); break; case "Entrar": //clogin.setEntrar(PageSource, Enum_Login.LoginGen); break; case "Olvido": //clogin.setOlvido(PageSource); break; case "Crear": //clogin.setCrear(PageSource, Enum_Login.LoginGen); break; } } } } catch (Exception Ex) { 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 = "Banner"; 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 { cResultados.dsResultados = clsSesiones.getReservaHotel(); VO_HotelValuedAvailRQ vo_HotelValuedAvailRQ = clsSesiones.getParametrosHotel(); HotelConfirmRQ oHotelConfirmRQ = new HotelConfirmRQ(); HotelConfirmRS oHotelConfirmRS = new HotelConfirmRS(); HotelFare oHotelFare = getHotelFare(cResultados.dsResultados); oHotelConfirmRQ.HotelFare = oHotelFare; oHotelConfirmRQ.Username = vo_Credentials.LoginUser; oHotelConfirmRQ.Password = vo_Credentials.PasswordUser; HotelConfirmService oHotelConfirmService = new HotelConfirmService(); oHotelConfirmService.Url = clsEsquema.setConexionWs(oHotelConfirmService.Url); string sRutaGen = clsValidaciones.XMLDatasetCrea(); string sHotelConfirmRQ = "HotelConfirmRQ"; string sHotelConfirmRS = "HotelConfirmRS"; clsCache cCache = new csCache().cCache(); try { if (cCache != null) { sHotelConfirmRQ += cCache.SessionID; sHotelConfirmRS += cCache.SessionID; } } catch { } try { clsXML.ClaseXML(oHotelConfirmRQ, sRutaGen + sHotelConfirmRQ + ".xml"); } catch { } oHotelConfirmRS = oHotelConfirmService.HotelConfirm(oHotelConfirmRQ); bool bCambioTarifa = getValidaCambioTarifa(oHotelFare, oHotelConfirmRS.HotelFare); try { clsXML.ClaseXML(oHotelConfirmRS, sRutaGen + sHotelConfirmRS + ".xml"); } catch { } cParametros = new clsEsquema().GetDatasetConfirmaReserva(cResultados.dsResultados, oHotelConfirmRS, bCambioTarifa); if (!cParametros.Id.Equals(0)) { clsSesiones.setReservaHotel(cResultados.dsResultados); cResultados.Error = cParametros; } else { cParametros.Id = 0; cParametros.Message = cResultados.dsResultados.Tables[clsEsquema.TABLA_ERROR].Rows[0][clsEsquema.COLUMN_MESSAGE].ToString(); cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = "HotelConfirmRQ"; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.Complemento = "Resultados de Hoteles"; cParametros.ViewMessage.Add("No existen resultados para esta búsqueda"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "502"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } } catch (Exception Ex) { cParametros.Id = 0; cParametros.Message = Ex.Message; cParametros.Severity = clsSeveridad.Alta; cParametros.Tipo = clsTipoError.WebServices; cParametros.Metodo = System.Reflection.MethodBase.GetCurrentMethod().Name; cParametros.Complemento = "Confirmacion de reserva de Hoteles"; cParametros.Source = Ex.Source; consulta.AppendLine("Credenciales: "); try { if (vo_Credentials != null) { consulta.AppendLine("User: "******"Password: "******"Url: " + vo_Credentials.UrlWebServices); clsCache cCache = new csCache().cCache(); if (cCache != null) { consulta.AppendLine("Sesion Local: " + cCache.SessionID.ToString()); } } } catch { } cParametros.Info = consulta.ToString(); cParametros.StackTrace = Ex.StackTrace; cParametros.ViewMessage.Add("La reserva no se confirmo"); cParametros.Sugerencia.Add("Por favor intente de nuevo"); cParametros.Code = "502"; cParametros.ValidaInfo = false; cParametros.MessageBD = true; cParametros.TipoWs = Enum_ProveedorWebServices.TotalTrip; cResultados.Error = cParametros; ExceptionHandled.Publicar(cParametros); } return(cResultados); }
/// <summary> /// Manejo de Meta tags y Titulos de la pagina /// </summary> /// <param name="sPagina">Nombre de la pagina</param> /// <param name="bSoloActivo">se indica si muestra solamente los activos</param> /// <returns></returns> public DataSet MetaTag(string sPagina, bool bSoloActivo) { DataSet dsData = new DataSet(); try { string sIdioma = clsSesiones.getIdioma(); string sAplicacion = clsSesiones.getAplicacion().ToString(); string sTipoRefereTag = clsValidaciones.GetKeyOrAdd("MetaTag", "MetaTag"); string sTipoRefereEquiv = clsValidaciones.GetKeyOrAdd("HttpEquiv", "HttpEquiv"); string sIdEmpresa = clsValidaciones.GetKeyOrAdd("idEmpresa", "2"); string sPaginaNew = sPagina; if (sPaginaNew.Contains(".")) { sPaginaNew = sPaginaNew.Substring(0, sPagina.IndexOf(".")); } else { sPaginaNew = sPaginaNew + ".aspx"; } clsCache cCache = new csCache().cCache(); if (cCache != null) { sIdEmpresa = cCache.Empresa; } StringBuilder Consulta = new StringBuilder(); Consulta.AppendLine(" SELECT strDetalle As Title "); Consulta.AppendLine(" FROM tblRefere "); Consulta.AppendLine(" WHERE (strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (intidRefere = " + sAplicacion + ") "); Consulta.AppendLine(" AND (intAplicacion = " + sAplicacion + ") "); Consulta.AppendLine(" "); Consulta.AppendLine(" "); Consulta.AppendLine(" SELECT tblRefere.strRefere As Name, tblRefere.strValor As Content "); Consulta.AppendLine(" FROM tblRefere INNER JOIN "); Consulta.AppendLine(" tblTipoRefere ON tblRefere.intidTipoRefere = tblTipoRefere.intidTipoRefere "); Consulta.AppendLine(" WHERE (tblTipoRefere.strTipoRefere = '" + sTipoRefereTag + "') "); Consulta.AppendLine(" AND (tblRefere.strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (tblRefere.intAplicacion = " + sAplicacion + ") "); if (bSoloActivo) { Consulta.AppendLine(" AND (tblRefere.bitActivo = 1) "); } Consulta.AppendLine(" "); Consulta.AppendLine(" "); Consulta.AppendLine(" SELECT tblRefere.strRefere As HttpEquiv, tblRefere.strValor As Content "); Consulta.AppendLine(" FROM tblRefere INNER JOIN "); Consulta.AppendLine(" tblTipoRefere ON tblRefere.intidTipoRefere = tblTipoRefere.intidTipoRefere "); Consulta.AppendLine(" WHERE (tblTipoRefere.strTipoRefere = '" + sTipoRefereEquiv + "') "); Consulta.AppendLine(" AND (tblRefere.strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (tblRefere.intAplicacion = " + sAplicacion + ") "); if (bSoloActivo) { Consulta.AppendLine(" AND (tblRefere.bitActivo = 1) "); } Consulta.AppendLine(" "); Consulta.AppendLine(" "); Consulta.AppendLine(" SELECT tblRefere.strRefere As Name, tblRelaRefere.strDetalle AS Content "); Consulta.AppendLine(" FROM tblRefere AS tblRefere_1 INNER JOIN tblRelaRefere INNER JOIN "); Consulta.AppendLine(" tblRefere ON tblRelaRefere.intidRefere = tblRefere.intidRefere AND tblRelaRefere.intIdTipoRefere = tblRefere.intidTipoRefere AND "); Consulta.AppendLine(" tblRelaRefere.intAplicacion = tblRefere.intAplicacion INNER JOIN "); Consulta.AppendLine(" tblTipoRefere ON tblRefere.intidTipoRefere = tblTipoRefere.intidTipoRefere ON tblRefere_1.intidRefere = tblRelaRefere.intConsecutivo "); Consulta.AppendLine(" WHERE (tblTipoRefere.strTipoRefere = '" + sTipoRefereTag + "') "); Consulta.AppendLine(" AND (tblRefere.strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (tblRelaRefere.strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (tblRefere.intAplicacion = " + sAplicacion + ") "); Consulta.AppendLine(" AND (tblRefere_1.strRefere = '" + sPagina + "') "); Consulta.AppendLine(" AND (tblRelaRefere.intCodigo = " + sIdEmpresa + ") "); if (bSoloActivo) { Consulta.AppendLine(" AND (tblRelaRefere.bitActivo = 1) "); } Consulta.AppendLine(" "); Consulta.AppendLine(" "); Consulta.AppendLine(" SELECT tblcontactos.* "); Consulta.AppendLine(" FROM tblcontactos "); Consulta.AppendLine(" WHERE (intContacto = " + sIdEmpresa + ") "); if (bSoloActivo) { Consulta.AppendLine(" AND (bitActivo = 1) "); } Consulta.AppendLine(" "); Consulta.AppendLine(" "); Consulta.AppendLine(" SELECT tblRefere.strRefere As Name, tblRelaRefere.strDetalle AS Content "); Consulta.AppendLine(" FROM tblRefere AS tblRefere_1 INNER JOIN tblRelaRefere INNER JOIN "); Consulta.AppendLine(" tblRefere ON tblRelaRefere.intidRefere = tblRefere.intidRefere AND tblRelaRefere.intIdTipoRefere = tblRefere.intidTipoRefere AND "); Consulta.AppendLine(" tblRelaRefere.intAplicacion = tblRefere.intAplicacion INNER JOIN "); Consulta.AppendLine(" tblTipoRefere ON tblRefere.intidTipoRefere = tblTipoRefere.intidTipoRefere ON tblRefere_1.intidRefere = tblRelaRefere.intConsecutivo "); Consulta.AppendLine(" WHERE (tblTipoRefere.strTipoRefere = '" + sTipoRefereTag + "') "); Consulta.AppendLine(" AND (tblRefere.strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (tblRelaRefere.strIdioma = '" + sIdioma + "') "); Consulta.AppendLine(" AND (tblRefere.intAplicacion = " + sAplicacion + ") "); Consulta.AppendLine(" AND (tblRefere_1.strRefere = '" + sPaginaNew + "') "); Consulta.AppendLine(" AND (tblRelaRefere.intCodigo = " + sIdEmpresa + ") "); if (bSoloActivo) { Consulta.AppendLine(" AND (tblRelaRefere.bitActivo = 1) "); } dsData = ConsultaTabla(Consulta.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.Metodo = "Meta Tag - Consulta "; ExceptionHandled.Publicar(cParametros); } return(dsData); }
/// <summary> /// Metodo general de carga de buscador de planes y llenado de controles /// </summary> /// <param name="PageSource"></param> /// <remarks> /// Autor: Juan Camilo Diaz /// Company: Ssoft Colombia /// Fecha: 2013-11-12 /// ------------------- /// Control de Cambios /// ------------------- /// </remarks> public void setPlan(UserControl PageSource) { try { //CargarCategoriaPlan(PageSource); //CargarTipologia(PageSource); /*NECESARIO PARA EL BUSCADOR DE IROTAMA*/ //CargarTiposDePlan(PageSource); clsCache cCache = new csCache().cCache(); List <string> listaValores = cCache.DatosAdicionales; AjaxControlToolkit.CascadingDropDown cddZona = PageSource.FindControl("cddZona") as AjaxControlToolkit.CascadingDropDown; AjaxControlToolkit.CascadingDropDown cddPais = PageSource.FindControl("cddPais") as AjaxControlToolkit.CascadingDropDown; AjaxControlToolkit.CascadingDropDown cddCiudad = PageSource.FindControl("cddCiudad") as AjaxControlToolkit.CascadingDropDown; DropDownList ddlTipologia = PageSource.FindControl("ddlTipologia") as DropDownList; DropDownList ddlTipoPlan = PageSource.FindControl("ddlTipoPlan") as DropDownList; TextBox txtFechaViaje = (TextBox)PageSource.FindControl("txtFechaViaje"); if (cCache != null && cCache.DatosAdicionales != null) { DateTime dt = new DateTime(); if (DateTime.TryParse(listaValores[5].ToString(), out dt) || listaValores[5].ToString() == "") { if (cddZona != null) { try { cddZona.SelectedValue = listaValores[0]; } catch { } } if (cddPais != null) { try { cddPais.SelectedValue = listaValores[1]; } catch { } } if (cddCiudad != null) { try { cddCiudad.SelectedValue = listaValores[2]; } catch { } } //if (ddlTipologia != null) //{ // try // { // ddlTipologia.SelectedValue = listaValores[3]; // } // catch { } //} //if (ddlTipoPlan != null) //{ // try // { // ddlTipoPlan.SelectedValue = listaValores[4]; // } // catch { } //} //if (txtFechaViaje != null) //{ // try // { // txtFechaViaje.Text = listaValores[5]; // } // catch { } //} } } Boolean esNacionales = PageSource.Request.QueryString["TIPODESTINO"] != null && PageSource.Request.QueryString["TIPODESTINO"].Equals("NACIONAL"); Boolean esInternacionales = PageSource.Request.QueryString["TIPODESTINO"] != null && PageSource.Request.QueryString["TIPODESTINO"].Equals("INTERNACIONAL"); if (esNacionales) { try { csConsultasPlanes cConsPlanes = new csConsultasPlanes(); DataTable tblZonas = cConsPlanes.ConReferenciaZonasGeograficas("SUA"); if (tblZonas != null) { cddZona.SelectedValue = tblZonas.Rows[0]["IntIdZona"].ToString(); } string sPaisDefault = clsValidaciones.GetKeyOrAdd("PaisDefault", "COL"); DataTable tblPaises = cConsPlanes.ConReferenciaPaises(sPaisDefault); if (tblPaises != null) { cddPais.SelectedValue = tblPaises.Rows[0]["IntCode"].ToString(); } } catch { } } } catch { } }