public ActionResult RecuperaDestinosVen(cmVentaDet detVenta)
        {
            var resultado = new JObject();

            try
            {
                CD_Viajes         cdViaje       = new CD_Viajes();
                List <cmVentaDet> lsVentaDetDes = new List <cmVentaDet>();
                lsVentaDetDes = cdViaje.fnlsRecuperaDestino(detVenta);

                if (lsVentaDetDes.Count > 0)
                {
                    JToken arDestinos = new JArray(from d in lsVentaDetDes
                                                   select new JObject(
                                                       new JProperty("IdDest", d.idDestino),
                                                       new JProperty("Destino", d.sDestino)
                                                       ));
                    resultado["LsDestinos"] = arDestinos;
                    resultado["Exito"]      = true;
                }
            }
            catch (Exception x)
            {
                resultado["Exito"] = false;
            }
            return(Content(resultado.ToString()));
        }
Example #2
0
        public ActionResult RecuperaFechasVen(cmVentaDet detVenta)
        {
            if (Session["UserName"] == null)
            {
                return(RedirectToAction("TravelInicio", "Logueo"));
            }
            var resultado = new JObject();

            try
            {
                CD_Viajes         cdViaje       = new CD_Viajes();
                List <cmVentaDet> lsVentaDetFec = new List <cmVentaDet>();
                lsVentaDetFec = cdViaje.fnlsRecuperaFechaVen(detVenta);

                if (lsVentaDetFec.Count > 0)
                {
                    JToken arFecDest = new JArray(from d in lsVentaDetFec
                                                  select new JObject(
                                                      new JProperty("IdVenta", d.idVenta),
                                                      new JProperty("dtFecha", d.dtFecha)
                                                      ));
                    resultado["LsFechaVta"] = arFecDest;
                    resultado["Exito"]      = true;
                }
            }
            catch (Exception x)
            {
                resultado["Exito"] = false;
            }
            return(Content(resultado.ToString()));
        }
        public ActionResult InicialHome()
        {
            var resultado = new JObject();

            try
            {
                CD_Viajes         cdViaje       = new CD_Viajes();
                List <cmVentaDet> lsVentaDetSal = new List <cmVentaDet>();
                lsVentaDetSal = cdViaje.fnlsRecuperaSalida();

                if (lsVentaDetSal.Count > 0)
                {
                    JToken arSalidas = new JArray(from d in lsVentaDetSal
                                                  select new JObject(
                                                      new JProperty("Salida", d.idSalida),
                                                      new JProperty("Ciudad", d.sSalida)
                                                      ));
                    resultado["LsSalidas"] = arSalidas;
                    resultado["Exito"]     = true;
                }
            }
            catch (Exception x)
            {
                resultado["Exito"] = false;
            }
            return(Content(resultado.ToString()));
        }
Example #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()));
        }