Ejemplo n.º 1
0
        public ActionResult InicialEncuesta()
        {
            var resultado = new JObject();

            try
            {
                CD_Destinos        cdDestino  = new CD_Destinos();
                List <TO_Destino>  lsDestinos = new List <TO_Destino>();
                CD_Encuesta        cdEncuesta = new CD_Encuesta();
                List <TO_Encuesta> lsEncuesta = new List <TO_Encuesta>();
                lsEncuesta = cdEncuesta.fnlsObtienePreguntas();
                lsDestinos = cdDestino.lsObtieneDestinos();
                if (lsDestinos.Count > 0)
                {
                    JToken arDestinos = new JArray(from d in lsDestinos
                                                   select new JObject(
                                                       new JProperty("Viaje", d.IdViaje),
                                                       new JProperty("Destino", d.Destino)
                                                       ));
                    resultado["LsDestinos"] = arDestinos;
                    resultado["LsEncuesta"] = new JArray(from p in lsEncuesta
                                                         select new JObject(
                                                             new JProperty("IdPregunta", p.IdPregunta),
                                                             new JProperty("nvPregunta", p.nvPregunta),
                                                             new JProperty("iTipoPreg", p.iTipoPreg)
                                                             ));
                    resultado["Exito"] = true;
                }
            }
            catch (Exception x)
            {
                resultado["Exito"] = false;
            }
            return(Content(resultado.ToString()));
        }
Ejemplo n.º 2
0
        public ActionResult ObtieneCarrDestino(cmDestinos Destino)
        {
            var resultado = new JObject();

            try
            {
                CD_Destinos cDes = new CD_Destinos();
                Destino = cDes.cmObtieneImgDestinos(Destino);
                if (Destino.sTitulo != null)
                {
                    resultado["Exito"]      = true;
                    resultado["DestinoDet"] = JToken.FromObject(Destino);
                    List <cmCarruselDestino> carrDest = new List <cmCarruselDestino>();
                    carrDest = cDes.cmObtieneCarrDestino(Destino);
                    resultado["LsCarrDestinos"] = JToken.FromObject(carrDest);
                }
                else
                {
                    resultado["Exito"] = false;
                }
            }
            catch (Exception x)
            {
            }
            return(Content(resultado.ToString()));
        }
Ejemplo n.º 3
0
        public ActionResult InicioDestinos()
        {
            CD_Viajeros oViajeros = new CD_Viajeros();

            oViajeros.LimpiaViajeros();
            var resultado = new JObject();

            try
            {
                CD_Destinos       cDes       = new CD_Destinos();
                List <cmDestinos> lsDestinos = new List <cmDestinos>();
                lsDestinos = cDes.lsObtieneImgDestinos();
                if (lsDestinos.Count() > 0)
                {
                    resultado["Exito"]         = true;
                    resultado["lsDestinosImg"] = JToken.FromObject(lsDestinos);
                }
                else
                {
                    resultado["Exito"] = false;
                }
            }
            catch (Exception x)
            {
            }
            return(Content(resultado.ToString()));
        }
Ejemplo n.º 4
0
        public ActionResult ConfirmarPago(DatosCorreo datosCorreo)
        {
            JObject resultado = new JObject();

            try
            {
                CD_Viajeros cdViajeros = new CD_Viajeros();
                if (cdViajeros.ConfirmarViaje(Session["UserID"].ToString()))
                {
                    resultado["Exito"] = true;
                }


                //                clsCorreo test = new clsCorreo();
                //                test.pruebaCorreo(Session["UserID"].ToString());

                //EMPIEZA EL ENVÍO DEL CORREO


                TO_Usuario usuarioObtenido = new TO_Usuario();
                CD_Usuario objetoUsuario   = new CD_Usuario();

                TO_Salida objetoSalida = new TO_Salida();
                CD_Salida salida       = new CD_Salida();


                TO_Viajes objetoViaje = new TO_Viajes();
                CD_Viajes viajes      = new CD_Viajes();

                objetoViaje = viajes.obtenerViaje(datosCorreo.fechaSalida);


                TO_Destino  objetoDestino = new TO_Destino();
                CD_Destinos destino       = new CD_Destinos();

                usuarioObtenido = objetoUsuario.fnObtenerDatosUsuario(Session["UserID"].ToString());
                objetoSalida    = salida.obtenerNombreSalida(datosCorreo.lugarSalida);
                objetoDestino   = destino.obtenerNombreDestino(objetoViaje.Id_Destino);

                clsCorreo test = new clsCorreo();
                test.pruebaCorreo(Session["UserID"].ToString(), usuarioObtenido.Nombre, usuarioObtenido.Apellidos, usuarioObtenido.Telefono, datosCorreo.numeroViajeros, datosCorreo.montoOperacion, objetoSalida.Ciudad, objetoDestino.Destino, objetoViaje.dtFechaSalida.ToString());


                //TERMINA EL ENVÍO DEL CORREO
            }
            catch (Exception x)
            {
                resultado["Exito"] = false;
            }
            return(Content(resultado.ToString()));
        }
Ejemplo n.º 5
0
        public ActionResult InicioComunidad()
        {
            var resultado = new JObject();

            try
            {
                CD_Destinos        cdDestino       = new CD_Destinos();
                List <TO_Destino>  lsDestinos      = new List <TO_Destino>();
                CD_Comunidad       ComunidadTravel = new CD_Comunidad();
                List <cmComunidad> ComunidadT      = new List <cmComunidad>();
                lsDestinos = cdDestino.lsObtieneDestinos();
                if (lsDestinos.Count > 0)
                {
                    JToken arDestinos = new JArray(from d in lsDestinos
                                                   select new JObject(
                                                       new JProperty("Viaje", d.IdViaje),
                                                       new JProperty("Destino", d.Destino)
                                                       ));
                    resultado["LsDestinos"] = arDestinos;
                    resultado["Exito"]      = true;
                    ComunidadT = ComunidadTravel.lsObtieneComunidad();
                    resultado["LsComunidad"] =
                        new JArray(
                            from c in ComunidadT
                            select new JObject(
                                new JProperty("Nom", c.sNombre),
                                new JProperty("Tes", c.sTestimonio),
                                new JProperty("Cal", c.iCalificacion),
                                new JProperty("IDes", c.IdViaje),
                                new JProperty("Des", c.sDestino),
                                new JProperty("FR", c.dtFechaRegistro),
                                new JProperty("Img", String.Format("data:image/gif;base64,{0}", (Convert.ToBase64String(c.ImgDestino))))
                                ));
                }
            }
            catch (Exception x)
            {
                resultado["Exito"] = false;
            }
            return(Content(resultado.ToString()));
        }