public static List <VO_Remarks> RecuperaRemark(clsCache cCache)
        {
            List <VO_Remarks> clRemark = new List <VO_Remarks>();

            try
            {
                //if (cCache.Corporativo != null)
                //{
                //    int iTotal = cCache.Corporativo.Count;
                //    for (int i = 0; i < iTotal; i++)
                //    {
                //        if (cCache.Corporativo[i].ProveedorWs.Equals(Enum_ProveedorWebServices.Sabre))
                //        {
                //            if (cCache.Corporativo[i].Remark != null)
                //            {
                //                int iTotalRemark = cCache.Corporativo[i].Remark.Count;
                //                for (int j = 0; j < iTotalRemark; j++)
                //                {
                //                    if (cCache.Corporativo[i].Remark[j].Operador.Equals(Enum_ProveedorWebServices.Sabre))
                //                    {
                //                        clRemark = cCache.Corporativo[i].Remark[j].Remark;
                //                    }
                //                }
                //            }
                //        }
                //    }
                //}
            }
            catch
            {
            }
            return(clRemark);
        }
        private static void RemarksCache(List <VO_Remarks> lRemark, clsCache cCache)
        {
            clsRemark        cRemark  = new clsRemark();
            List <clsRemark> clRemark = new List <clsRemark>();

            //clsCorporativo cCorporativo = new clsCorporativo();
            //List<clsCorporativo> clCorporativo = new List<clsCorporativo>();

            //if (cCache.Corporativo != null)
            //{
            //    int iTotal = cCache.Corporativo.Count;
            //    for (int i = 0; i < iTotal; i++)
            //    {
            //        if (cCache.Corporativo[i].ProveedorWs.Equals(Enum_ProveedorWebServices.Sabre))
            //        {
            //            if (cCache.Corporativo[i].Remark != null)
            //            {
            //                int iTotalRemark = cCache.Corporativo[i].Remark.Count;
            //                for (int j = 0; j < iTotalRemark; j++)
            //                {
            //                    if (cCache.Corporativo[i].Remark[j].Operador.Equals(Enum_ProveedorWebServices.Sabre))
            //                    {
            //                        cCache.Corporativo[i].Remark[j].Remark = lRemark;
            //                    }
            //                }
            //            }
            //            else
            //            {
            //                cRemark.Operador = Enum_ProveedorWebServices.Sabre;
            //                cRemark.Remark = lRemark;
            //                clRemark.Add(cRemark);
            //                cCorporativo.Remark = clRemark;
            //            }
            //        }
            //    }
            //}
            //else
            //{
            //    cRemark.Operador = Enum_ProveedorWebServices.Sabre;
            //    cRemark.Remark = lRemark;
            //    clRemark.Add(cRemark);
            //    cCorporativo.Remark = clRemark;
            //    clCorporativo.Add(cCorporativo);
            //    cCache.Corporativo = clCorporativo;
            //}
            csCache.ActualizarCache(cCache);
        }
        public string setLeerCarrito(clsCache cCache)
        {
            string sCarrito = "(0)";

            try
            {
                string sSesion = new clsCacheControl().RecuperarSesionId();;
                csGeneralsPag.ValidarSesionPag();
                if (sSesion != null)
                {
                    csCarrito csCarCompUnion = new csCarrito("Reserva" + sSesion, "CarritoCompras");
                    DataTable TablaPlanes    = csCarCompUnion.RecuperarTabla();
                    sCarrito = "(" + TablaPlanes.Rows.Count.ToString() + ")";
                }
            }
            catch
            {
            }
            return(sCarrito);
        }
        public void mostrar_detalle_reserva(/*Repeater rptReservaHoteles,*/ Repeater rptReservaPlanes, Repeater rptReservaAereas,
                                            /*Repeater rptReservaAutos, Repeater rptReservaTrenes,*/ string strLocalizador, Label lblLocalizador)
        {
            try
            {
                csConsultasReserva Reservas = new csConsultasReserva();
                clsCache           cCache   = new clsCache();
                lblLocalizador.Text = strLocalizador;

                DataSet dt      = new DataSet();
                string  sIdioma = clsSesiones.getIdioma();
                dt = Reservas.consulta_detalle_general(strLocalizador);
                if (dt != null && dt.Tables.Count > 0)
                {
                    //cargar_reserva_tipo_servicio(dt, rptReservaHoteles, "Hoteles", cCache, strLocalizador);
                    cargar_reserva_tipo_servicio(dt, rptReservaPlanes, "Plan", cCache, strLocalizador);
                    cargar_reserva_tipo_servicio(dt, rptReservaAereas, "Aereo", cCache, strLocalizador);
                    //cargar_reserva_tipo_servicio(dt, rptReservaAutos, "Auto", cCache, strLocalizador);
                    //cargar_reserva_tipo_servicio(dt, rptReservaTrenes, "Trenes", cCache, strLocalizador);
                }
            }
            catch { }
        }
        public void cargar_reserva_tipo_servicio(DataSet dtRes, Repeater rptReserva, string Tipo, clsCache cCache, string strLocalizador)
        {
            try
            {
                csConsultasReserva Reservas = new csConsultasReserva();
                DataTable          dt       = dtRes.Tables[0].Copy();
                DataTable          dt2      = new DataTable();
                //if (Tipo.Equals("Plan"))
                //    dt2 = dtRes.Tables[1].Copy();
                //else
                dt2 = dtRes.Tables[1].Copy();
                string    sIdioma      = clsSesiones.getIdioma();
                DataTable dtgv         = new DataTable();
                string    sReservaAir  = clsValidaciones.GetKeyOrAdd("Aereo_WS", "AIR");
                string    sReservaTT   = clsValidaciones.GetKeyOrAdd("WS_HOTEL_TT", "WS_TT");
                string    sReservaHB   = clsValidaciones.GetKeyOrAdd("WS_HOTEL_HB", "HOTBED");
                string    sReservaHNal = clsValidaciones.GetKeyOrAdd("TipoPlanHotelWS", "HOT");
                string    sReservaTame = clsValidaciones.GetKeyOrAdd("Aereo_WSTame", "AIR_TAME");
                string    sReservaCar  = clsValidaciones.GetKeyOrAdd("TIPOPLANCARWS", "CAR");
                string    sReservaTren = clsValidaciones.GetKeyOrAdd("Trenes_Ws", "TREN");

                #region Eliminacion Registros Servicio
                switch (Tipo)
                {
                case "Plan":
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["strcodigo"].ToString().Equals(sReservaAir) ||
                            dt.Rows[i]["strcodigo"].ToString().Equals(sReservaTame) ||
                            dt.Rows[i]["strcodigo"].ToString().Equals(sReservaTT) ||
                            dt.Rows[i]["strcodigo"].ToString().Equals(sReservaHB) ||
                            dt.Rows[i]["strcodigo"].ToString().Equals(sReservaHNal) ||
                            dt.Rows[i]["strcodigo"].ToString().Equals(sReservaCar))
                        {
                            dt.Rows.Remove(dt.Rows[i]);
                            dt2.Rows.Remove(dt2.Rows[i]);
                            i--;
                            dt.AcceptChanges();
                        }
                    }
                    break;

                case "Aereo":
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["strcodigo"].ToString() != sReservaAir &&
                            dt.Rows[i]["strcodigo"].ToString() != sReservaTame)
                        {
                            dt.Rows.Remove(dt.Rows[i]);
                            dt2.Rows.Remove(dt2.Rows[i]);
                            i--;
                            dt.AcceptChanges();
                        }
                    }
                    break;

                case "Auto":
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["strcodigo"].ToString() != sReservaCar)
                        {
                            dt.Rows.Remove(dt.Rows[i]);
                            dt2.Rows.Remove(dt2.Rows[i]);
                            i--;
                            dt.AcceptChanges();
                        }
                    }
                    break;

                case "Trenes":
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["strRefere"].ToString() != sReservaTren)
                        {
                            dt.Rows.Remove(dt.Rows[i]);
                            dt2.Rows.Remove(dt2.Rows[i]);
                            i--;
                            dt.AcceptChanges();
                        }
                    }
                    break;

                case "Hoteles":
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["strcodigo"].ToString() != sReservaHB &&
                            dt.Rows[i]["strcodigo"].ToString() != sReservaTT &&
                            dt.Rows[i]["strcodigo"].ToString() != sReservaHNal)
                        {
                            dt.Rows.Remove(dt.Rows[i]);
                            dt2.Rows.Remove(dt2.Rows[i]);
                            i--;
                            dt.AcceptChanges();
                        }
                    }
                    break;
                }

                #endregion

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    if (dt.Rows[x]["texto1"].ToString() == "")
                    {
                        dt.Rows[x]["label1"] = string.Empty;
                    }
                    if (dt.Rows[x]["texto2"].ToString() == "")
                    {
                        dt.Rows[x]["label2"] = string.Empty;
                    }
                    //if (dt.Rows[x]["texto102"].ToString() == "")
                    //    dt.Rows[x]["label102"] = string.Empty;
                    //if (dt.Rows[x]["texto103"].ToString() == "")
                    //    dt.Rows[x]["label103"] = string.Empty;
                    //if (dt.Rows[x]["texto104"].ToString() == "")
                    //    dt.Rows[x]["label104"] = string.Empty;
                    //if (dt.Rows[x]["texto105"].ToString() == "")
                    //    dt.Rows[x]["label105"] = string.Empty;
                }
                dt = validar_fecha_pagos(dt, "dtmFechaPagoProv", "dtmFechaPagoProv2");
                dt = validar_fecha_pagos(dt, "dtmFechaPagoComision", "dtmFechaPagoCom");
                rptReserva.DataSource = dt.DefaultView;
                rptReserva.DataBind();
                //CargarCombos(rptReserva);
                //SeleccionarCombosRepetidores(rptReserva, dt);
                //CargarMultiples();
                DataTable tblRegValor = dt2.Clone();
                for (int i = 0; i < rptReserva.Items.Count; i++)
                {
                    tblRegValor.Rows.Clear();
                    tblRegValor.Rows.Add(dt2.Rows[i].ItemArray);
                    ((Repeater)(rptReserva.Items[i].FindControl("rptValor"))).DataSource = tblRegValor.DefaultView;
                    ((Repeater)(rptReserva.Items[i].FindControl("rptValor"))).DataBind();

                    dt = Reservas.consulta_detalle_tipo_servicio(strLocalizador, ((Label)(rptReserva.Items[i].FindControl("lblReserva"))).Text, ((Label)(rptReserva.Items[i].FindControl("lblRefereTipoPlan"))).Text);
                    ((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).DataSource = dt.DefaultView;
                    ((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).DataBind();

                    if (Tipo.Equals("Plan"))
                    {
                        if (((Label)(rptReserva.Items[i].FindControl("lblRefereTipoPlan"))).Text != clsValidaciones.GetKeyOrAdd("TipoPlanTraslados", "Tras"))
                        {
                            for (int x = 0; x < ((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items.Count; x++)
                            {
                                string iSegmento = ((Label)((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items[x].FindControl("lblSegmento")).Text;
                                dtgv = Reservas.consulta_pasajeros_reserva(((Label)(rptReserva.Items[i].FindControl("lblReserva"))).Text, iSegmento);
                                if (dtgv == null || dtgv.Rows.Count == 0)
                                {
                                    dtgv = Reservas.consulta_pasajeros_reserva(((Label)(rptReserva.Items[i].FindControl("lblReserva"))).Text, "0");
                                }
                                ((Repeater)((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items[x].FindControl("rptPasajeros")).Visible    = true;
                                ((Repeater)((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items[x].FindControl("rptPasajeros")).DataSource = dtgv;
                                ((Repeater)((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items[x].FindControl("rptPasajeros")).DataBind();
                            }
                            ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Visible = false;
                        }
                        else
                        {
                            for (int x = 0; x < ((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items.Count; x++)
                            {
                                if (((Label)(rptReserva.Items[x].FindControl("lblRefereTipoPlan"))).Text == clsValidaciones.GetKeyOrAdd("Aereo_WSTame", "AIR_TAME"))
                                {
                                    ((Button)(rptReserva.Items[x].FindControl("btnEmisionTAME"))).Visible = true;
                                }

                                ((Repeater)((Repeater)(rptReserva.Items[i].FindControl("rptPlan"))).Items[x].FindControl("rptPasajeros")).Visible = true;
                            }
                            ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Visible = true;
                            dtgv = Reservas.consulta_pasajeros_reserva(((Label)(rptReserva.Items[i].FindControl("lblReserva"))).Text, "1");
                            ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).DataSource = dtgv;
                            ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).DataBind();
                        }
                    }
                    else
                    {
                        dtgv = Reservas.consulta_pasajeros_reserva(((Label)(rptReserva.Items[i].FindControl("lblReserva"))).Text, "1");
                        ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).DataSource = dtgv;
                        ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).DataBind();
                    }

                    if (Tipo.Equals("Aereo"))
                    {
                        for (int x = 0; x < ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Items.Count; x++)
                        {
                            if (((TextBox)((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Items[x].FindControl("txtNumTiquete")).Text != "" &&
                                ((TextBox)((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Items[x].FindControl("txtNumTiquete")).Text != "0")
                            {
                                ((TextBox)((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Items[x].FindControl("txtNumTiquete")).Enabled = false;
                            }
                        }
                        //ValidarEmision(rptReserva);
                    }
                    if (((Label)(rptReserva.Items[i].Controls[3])).Text.Equals(clsValidaciones.GetKeyOrAdd("TipoPlanTarjetas", "TJAS")))
                    {
                        ((Repeater)(rptReserva.Items[i].FindControl("rptPasajeros"))).Visible = false;
                    }
                    //DesactivarControlesHoteles(rptReserva, i, ((Label)(rptReserva.Items[i].FindControl("lblRefereTipoPlan"))).Text);
                }
            }
            catch { }
        }
        private static clsParametros Remarks(string sRemark, string sComando, clsCache cCache)
        {
            ///pendiente por una revision mas detallada
            clsParametros cParametros = new clsParametros();

            try
            {
                cParametros.DatoAdic = sComando;
                string sTipoVariable = clsValidaciones.GetKeyOrAdd("VariablesRemarks", "VariablesRemarks");
                string sSV           = clsValidaciones.GetKeyOrAdd("SV", "SV");
                string sMNE          = clsValidaciones.GetKeyOrAdd("MNE", "MNE");
                string sSC           = clsValidaciones.GetKeyOrAdd("SC", "SC");
                string sCC1          = clsValidaciones.GetKeyOrAdd("CC1", "CC1");
                string sCC2          = clsValidaciones.GetKeyOrAdd("CC2", "CC2");
                string sCC3          = clsValidaciones.GetKeyOrAdd("CC3", "CC3");
                string sCC4          = clsValidaciones.GetKeyOrAdd("CC4", "CC4");
                string sCC5          = clsValidaciones.GetKeyOrAdd("CC5", "CC5");
                string sCC           = clsValidaciones.GetKeyOrAdd("CC", "CC");
                string sDP           = clsValidaciones.GetKeyOrAdd("DP", "DP");
                string sAE           = clsValidaciones.GetKeyOrAdd("AE", "AE");
                string sPR           = clsValidaciones.GetKeyOrAdd("PR", "PR");
                string sCAE          = clsValidaciones.GetKeyOrAdd("CAE", "CAE");
                string sPRC          = clsValidaciones.GetKeyOrAdd("PRC", "PRC");
                string sPRA          = clsValidaciones.GetKeyOrAdd("PRA", "PRA");
                string sTR           = clsValidaciones.GetKeyOrAdd("TR", "TR");
                string sTM           = clsValidaciones.GetKeyOrAdd("TM", "TM");
                string sTA           = clsValidaciones.GetKeyOrAdd("TA", "TA");

                cParametros.Id = 1;
                if (sRemark.Equals(sSV))
                {
                    cParametros.DatoAdic = sComando;
                }

                if (sRemark.Equals(sSC))
                {
                    string sCodeSC = RecuperarSnapCode();
                    if (sCodeSC != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeSC;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCC1))
                {
                    string sCodeC1 = "";
                    if (sCodeC1 != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeC1;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCC2))
                {
                    string sCodeC2 = "";
                    if (sCodeC2 != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeC2;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCC3))
                {
                    string sCodeC3 = "";
                    if (sCodeC3 != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeC3;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCC4))
                {
                    string sCodeC4 = "";
                    if (sCodeC4 != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeC4;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCC5))
                {
                    string sCodeC5 = "";
                    if (sCodeC5 != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeC5;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCC))
                {
                    string sCodeC = "";
                    if (sCodeC != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeC;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sDP))
                {
                    cParametros.DatoAdic = sComando;
                    string sCodeDP = "";
                    if (sCodeDP != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeDP;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sAE))
                {
                    string sCodeAE = "";
                    if (sCodeAE != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeAE;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sCAE))
                {
                    string sCodeAE = "";
                    if (sCodeAE != null)
                    {
                        cParametros.DatoAdic = sComando + sCodeAE;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sPR))
                {
                    cParametros.DatoAdic = sComando + clsSesiones.getProyecto();
                }
                if (sRemark.Equals(sPRC))
                {
                    string sCodeAE = "";
                    if (sCodeAE != null)
                    {
                        cParametros.DatoAdic = sComando + clsSesiones.getProyecto() + "-" + sCodeAE;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
                if (sRemark.Equals(sPRA))
                {
                    string sCodeAE = "";
                    if (sCodeAE != null)
                    {
                        cParametros.DatoAdic = sComando + clsSesiones.getProyecto() + "-" + sCodeAE;
                    }
                    else
                    {
                        cParametros.Id = 0;
                    }
                }
            }
            catch
            {
            }
            return(cParametros);
        }