示例#1
0
        async void ChatHotel(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(Application.Current.Properties["RutaChatHotel"].ToString()))
            {
                Application.Current.Properties["Hotel"] = 1;
            }
            else
            {
                Application.Current.Properties["Hotel"] = 0;
            }

            await Application.Current.SavePropertiesAsync();

            string ValorCasino = Application.Current.Properties["Casino"].ToString();

            if (ValorCasino == "0")
            {
                await Mensajes.Alerta("Ya se encuentra un chat abierto en casino");

                return;
            }


            VariablesGlobales.TipoChat = "hotel";
#if __ANDROID__
            await((MasterPage)Application.Current.MainPage).Detail.Navigation.PushAsync(new Chat());
#endif


#if __IOS__
            await((MasterPage)Application.Current.MainPage).Detail.Navigation.PushAsync(new ChatIos());
#endif
        }
        private async void LoadPromociones()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Mensajes.Alerta("Verificá tu conexión a Internet");

                return;
            }


            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair<string, string>("", ""),
            });


            var response = await this.apiService.Get<PromocionesReturn>("/promociones", "/indexApp", content);

            if (!response.IsSuccess)
            {
                await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");
                return;
            }

            this.listPromociones = (PromocionesReturn)response.Result;

            PromocionesDetalle = new ObservableCollection<PromocionesItemViewModel>(this.ToPromocionesItemViewModel());

        }
        private async Task <ValidaUsuarioReturn> ValidaUsuario(string CorreoElectronico)
        {
            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("usu_usuario", CorreoElectronico)
            });

            var response = await this.apiService.Get <ValidaUsuarioReturn>("/usuarios", "/usuario_valido", content);

            if (!response.IsSuccess)
            {
                await Mensajes.Alerta("Parece que no tenés conexión a internet, intentalo mas tarde");

                return(null);
            }

            listValidaUsuario = (ValidaUsuarioReturn)response.Result;


            if (listValidaUsuario.resultado == "Usuario disponible.")
            {
                return(null);
            }
            else
            {
                return(listValidaUsuario);
            }
        }
        private async void LoadSalasEventos()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Mensajes.Alerta("Verificá tu conexión a Internet");

                return;
            }


            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("", ""),
            });


            var response = await this.apiService.Get <SalasEventosReturn>("/convenciones_salas/galeria_ecs", "/indexApp", content);

            if (!response.IsSuccess)
            {
                // await Mensajes.Alerta("Error al cargar Galerias");

                return;
            }

            this.listSalasEventos = (SalasEventosReturn)response.Result;

            Imagen_Selected = VariablesGlobales.RutaServidor + this.listSalasEventos.resultado[0].gal_imagen;

            SalasEventosDetalle = new ObservableCollection <SalasEventosDetalle>(this.ToSalasEventosItemViewModel());
        }
        private async void CheckInReserva()
        {
            try
            {
                Plugin.Share.Abstractions.ShareMessage Compartir = new Plugin.Share.Abstractions.ShareMessage();

                var hasPermission = await Utils.CheckPermissions(Permission.Location);

                if (!hasPermission)
                {
                    return;
                }


                var Posicion = await Ubicacion.GetCurrentPosition();

                Compartir.Text  = "Ubicacion Actual";
                Compartir.Title = "Tu ubicacion";
                Compartir.Url   = "https://www.google.com/maps/@" + Posicion.Latitude + "," + Posicion.Longitude + "," + "16z";

                await CrossShare.Current.Share(Compartir);
            }
            catch (Exception ex)
            {
                await Mensajes.Alerta("Ubicación denegada, activa el GPS de tu dispositivo");
            }
        }
        private async Task <string> GuardaUsuarioGF(string UserNameGF, string EmailGF)
        {
            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("usu_usuario", EmailGF),
                new KeyValuePair <string, string>("usu_contrasena", ""),
                new KeyValuePair <string, string>("usu_tipo_contrasena", "1"),
                new KeyValuePair <string, string>("usu_usuario_bloquedado", "0"),
                new KeyValuePair <string, string>("usu_nombre", UserNameGF),
                new KeyValuePair <string, string>("usu_apellidos", ""),
                new KeyValuePair <string, string>("usu_email", EmailGF),
                new KeyValuePair <string, string>("usu_celular", ""),
                new KeyValuePair <string, string>("usu_telefono", ""),
                new KeyValuePair <string, string>("usu_ciudad", ""),
                new KeyValuePair <string, string>("usu_id_rol", "6"),
                new KeyValuePair <string, string>("usu_id_tarjeta_socio", "1"),
                new KeyValuePair <string, string>("usu_estatus", "1"),
                new KeyValuePair <string, string>("usu_id_tarjeta_socio", ""),
                new KeyValuePair <string, string>("usu_fecha_nacimiento", ""),
            });


            var response = await this.apiService.Get <RegistroReturn>("/usuarios", "/store", content);

            if (!response.IsSuccess)
            {
                await Mensajes.Alerta("Parece que no tenés conexión a internet, intentalo mas tarde");

                return("Error");
            }

            listRegistro = (RegistroReturn)response.Result;

            return(Convert.ToString(listRegistro.resultado.usu_id));
        }
示例#7
0
        private async void LoadPromociones()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta(connection.Message);

                    return;
                }

                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("pro_tipo", "hopa"),
                });


                var response = await this.apiService.Get <PromocionesReturn>("/promociones", "/indexTipoApp", content);

                if (!response.IsSuccess)
                {
                    // await Mensajes.Alerta("Error al cargar Promociones");

                    return;
                }

                this.listPromociones = (PromocionesReturn)response.Result;
#if __IOS__
                PromocionesDetalle = new ObservableCollection <PromocionesItemViewModel>(this.ToPromocionesItemViewModel());

                PromocionesDetalle2 = new ObservableCollection <PromocionesItemViewModel>(this.ToPromocionesItemViewModel());
#endif

#if __ANDROID__
                PromocionesDetalle = new ObservableCollection <PromocionesItemViewModel>(this.ToPromocionesItemViewModel2());

                PromocionesDetalle2 = new ObservableCollection <PromocionesItemViewModel>(this.ToPromocionesItemViewModel2());
#endif

                if (PromocionesDetalle.Count > 0)
                {
                    MuestraFlechasPromo = true;

                    VariablesGlobales.RegistrosHotelPromociones  = promocionesDetalle.Count - 1;
                    VariablesGlobales.RegistrosHotelPromociones2 = promocionesDetalle.Count - 1;
                }
                else
                {
                    MuestraFlechasPromo = false;
                }
            }
            catch (Exception)
            {
                MuestraFlechasPromo = false;
                // await Mensajes.Al("Hotel - Promociones" + ex.ToString());
            }
        }
示例#8
0
        async void Handle_Clicked(object sender, System.EventArgs e)
        {
            // Navigation.PushPopupAsync(new MensajeCarga());
            //Mensajes.Cargando("Iniciando Sesion");
            try
            {
                if (FechaInicio.Text == "00/00/0000")
                {
                    await Mensajes.Alerta("Fecha inicial requerida.");

                    return;
                }

                if (FechaFinal.Text == "00/00/0000")
                {
                    await Mensajes.Alerta("Fecha inicial requerida.");

                    return;
                }

                //DateTime fecha1 = Convert.ToDateTime(Application.Current.Properties["FechaNacimiento"].ToString());

                string Dia = FechaInicio.Text.Substring(0, 2);
                string Mes = FechaInicio.Text.Substring(3, 2);
                string Año = FechaInicio.Text.Substring(6, 4);


                string Dia2 = FechaFinal.Text.Substring(0, 2);
                string Mes2 = FechaFinal.Text.Substring(3, 2);
                string Año2 = FechaFinal.Text.Substring(6, 4);

                DateTime Fecha1 = Convert.ToDateTime(Año + "-" + Mes + "-" + Dia);
                DateTime Fecha2 = Convert.ToDateTime(Año2 + "-" + Mes2 + "-" + Dia2);

                if (Fecha2.Date < Fecha1.Date)
                {
                    await Mensajes.Alerta("La fecha final no puede ser menor a la fecha inicial");
                }
                else
                {
                    VariablesGlobales.FechaInicio = Fecha1.Date;
                    VariablesGlobales.FechaFin    = Fecha2.Date;

                    VariablesGlobales.NumeroHuespedes = Convert.ToInt32(NoPersona.Text);

                    //await Navigation.PushPopupAsync(_webHotel);
                    // #if __ANDROID__
                    await((MasterPage)Application.Current.MainPage).Detail.Navigation.PushAsync(_webHotel);
                    // #endif
                }
            }
            catch (Exception)
            {
                //await DisplayAlert("oj", ex.ToString(), "ok");
                await Mensajes.Alerta("No se pudo acceder a las reservaciones, intente mas tarde.");
            }
        }
        private async void GuardaFavorito()
        {
            try
            {
                bool isLoggedIn = Application.Current.Properties.ContainsKey("IsLoggedIn") ?
                                  (bool)Application.Current.Properties["IsLoggedIn"] : false;

                if (isLoggedIn)
                {
                    if (this.td.tor_guardado == false)
                    {
                        var content = new FormUrlEncodedContent(new[]
                        {
                            new KeyValuePair <string, string>("gua_id_usuario", Application.Current.Properties["IdUsuario"].ToString()),
                            new KeyValuePair <string, string>("gua_id_torneo", Convert.ToString(td.tor_id)),
                        });

                        var response = await this.apiService.Get <GuardaFavoritosReturn>("/guardados", "/store", content);

                        if (!response.IsSuccess)
                        {
                            await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");

                            return;
                        }

                        var list = (GuardaFavoritosReturn)response.Result;

                        this.td.tor_guardado    = true;
                        this.td.oculta          = false;
                        this.td.tor_id_guardado = list.resultado.gua_id;

                        var actualiza = MainViewModel.GetInstance().listTorneo.resultado.Where(l => l.tor_id == this.td.tor_id).FirstOrDefault();

                        actualiza.tor_guardado    = true;
                        actualiza.oculta          = false;
                        actualiza.tor_id_guardado = list.resultado.gua_id;

                        // Inicito.TorneoDetalle = new ObservableCollection<TorneoItemViewModel>(this.ToTorneosItemViewModel());

                        await Mensajes.Alerta("Tu selección fue guardada con éxito");
                    }
                    else
                    {
                        EliminaFavoritos();
                    }
                }
                else
                {
                    await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
                }
            }
            catch (Exception)
            {
                await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
            }
        }
示例#10
0
        private async Task <string> GuardaImagen(int IDusuario)
        {
            try
            {
                var dirotro = "";

                if (string.IsNullOrEmpty(VariablesGlobales.RutaImagene))
                {
                    //  await Mensajes.Alerta("Ninguna foto subida");

                    return("Error");
                }
                else
                {
                    byte[] ImagenSubir = File.ReadAllBytes(VariablesGlobales.RutaImagene);

                    int tamano = ImagenSubir.Length;

                    dirotro = Convert.ToBase64String(ImagenSubir);
                }

                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("usu_id", Convert.ToString(IDusuario)),
                    new KeyValuePair <string, string>("usu_imagenstr", dirotro)
                });


                var response = await this.apiService.Get <ImagenReturn>("/usuarios", "/carga_foto", content);


                if (!response.IsSuccess)
                {
                    await Mensajes.Alerta("Error al cargar la foto, intenta de nuevo");

                    UserDialogs.Instance.HideLoading();

                    return("Error");
                }

                ListImagen = (ImagenReturn)response.Result;

                //await Mensajes.Alerta("Imagen actualizada correctamente");

                // Application.Current.Properties["FotoPerfil"] = VariablesGlobales.RutaServidor + ListImagen.resultado;

                //  await Application.Current.SavePropertiesAsync();

                return(VariablesGlobales.RutaServidor + ListImagen.resultado);
            }
            catch (Exception ex)
            {
                return("");
            }
        }
        private async void EnviaCorreShow()
        {
            if (string.IsNullOrEmpty(this.Nombres))
            {
                await Mensajes.Alerta("Nombre y Apellido requeridos");

                return;
            }

            if (string.IsNullOrEmpty(this.Correos))
            {
                await Mensajes.Alerta("Correo electrónico requerido");

                return;
            }

            if (!ValidaEmailMethod.ValidateEMail(this.Correos))
            {
                await Mensajes.Alerta("Correo electrónico mal estructurado");

                return;
            }

            if (string.IsNullOrEmpty(this.Telefonos))
            {
                await Mensajes.Alerta("Teléfono requerido");

                return;
            }


            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("pro_id", Convert.ToString(this.pd.pro_id)),
                new KeyValuePair <string, string>("nombre", Convert.ToString(this.Nombres)),
                new KeyValuePair <string, string>("email", Convert.ToString(this.correos)),
                new KeyValuePair <string, string>("telefono", Convert.ToString(this.telefonos))
            });


            var response = await this.apiService.Get <GuardadoGenerico>("/es/promocion-reserva", "/correo_reserva", content);

            if (!response.IsSuccess)
            {
                await Mensajes.Alerta(response.Message);
            }


            this.Nombres   = string.Empty;
            this.Correos   = string.Empty;
            this.Telefonos = string.Empty;

            await Mensajes.Alerta("La información ha sido enviada correctamente");
        }
示例#12
0
        private async void LoadEventos()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Mensajes.Alerta("Verificá tu conexión a Internet");

                return;
            }

            string IDUsuario;

            try
            {
                IDUsuario = Application.Current.Properties["IdUsuario"].ToString();
            }
            catch (Exception)
            {
                IDUsuario = "";
            }


            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("usu_id", IDUsuario),
            });


            var response = await this.apiService.Get <EventosReturn>("/shows", "/indexApp", content);

            if (!response.IsSuccess)
            {
                await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");

                return;
            }

            if (MainViewModel.GetInstance().listEventos != null)
            {
                MainViewModel.GetInstance().listEventos.resultado.Clear();
            }

            MainViewModel.GetInstance().listEventos = (EventosReturn)response.Result;

            if (String.IsNullOrEmpty(VariablesGlobales.FechaShowInicio))
            {
                EventosDetalle = new ObservableCollection <EventosItemViewModel>(this.ToEventosItemViewModel());
            }
            else
            {
                EventosDetalle = new ObservableCollection <EventosItemViewModel>(this.ToEventosItemViewModel().Where(l => l.eve_fecha_hora_inicio >= Convert.ToDateTime(VariablesGlobales.FechaShowInicio) && l.eve_fecha_hora_inicio <= Convert.ToDateTime(VariablesGlobales.FechaShowFinal)));
            }
        }
示例#13
0
        private async void LoadPromociones()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    return;
                }

                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("pro_tipo", "cas"),
                });


                var response = await this.apiService.Get <PromocionesReturn>("/promociones", "/indexTipoApp", content);

                if (!response.IsSuccess)
                {
                    //await Mensajes.Error("Error al cargar Promociones");

                    return;
                }

                this.listPromociones = (PromocionesReturn)response.Result;

                //var test = MainViewModel.GetInstance().listPromociones;
#if __ANDROID__
                PromocionesDetalle = new ObservableCollection <PromocionesItemViewModel>(this.ToPromocionesItemViewModel2());
#endif

#if __IOS__
                PromocionesDetalle = new ObservableCollection <PromocionesItemViewModel>(this.ToPromocionesItemViewModel());
#endif
                if (PromocionesDetalle.Count > 0)
                {
                    MuestraFlechasPromo = true;

                    VariablesGlobales.RegistrosCasinoPromociones = PromocionesDetalle.Count - 1;
                }
                else
                {
                    MuestraFlechasPromo = false;
                }
            }
            catch (Exception)
            {
                MuestraFlechasPromo = false;
            }
        }
        private async void EliminaFavoritos()
        {
            try
            {
                bool isLoggedIn = Application.Current.Properties.ContainsKey("IsLoggedIn") ?
                                  (bool)Application.Current.Properties["IsLoggedIn"] : false;

                if (isLoggedIn)
                {
                    if (this.ds.eve_guardado == true)
                    {
                        var content = new FormUrlEncodedContent(new[]
                        {
                            new KeyValuePair <string, string>("gua_id", Convert.ToString(this.ds.eve_id_guardado)),
                        });

                        var response = await this.apiService.Get <GuardaFavoritosReturn>("/guardados", "/destroy", content);

                        if (!response.IsSuccess)
                        {
                            await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");

                            return;
                        }

                        this.ds.eve_guardado    = false;
                        this.ds.oculta          = true;
                        this.ds.eve_id_guardado = 0;

                        var actualiza = MainViewModel.GetInstance().listEventos.resultado.Where(l => l.eve_id == this.ds.eve_id).FirstOrDefault();

                        actualiza.eve_guardado    = false;
                        actualiza.oculta          = true;
                        actualiza.eve_id_guardado = 0;


                        await Mensajes.Alerta("Tu selección fue guardada con éxito");
                    }
                    else
                    {
                        GuardaFavorito();
                    }
                }
                else
                {
                    await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
                }
            }
            catch (Exception)
            {
                await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
            }
        }
示例#15
0
        async void Chat_click(object sender, System.EventArgs e)
        {
            bool isLoggedIn = Application.Current.Properties.ContainsKey("IsLoggedIn") ?
                              (bool)Application.Current.Properties["IsLoggedIn"] : false;

            if (isLoggedIn)
            {
                await((MasterPage)Application.Current.MainPage).Detail.Navigation.PushAsync(new SeleccionTipoChat());
            }
            else
            {
                await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
            }
        }
示例#16
0
        private async void LoadTarjetaUsuario()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    VerTarjeta = false;

                    return;
                }

                string idusuario = Application.Current.Properties["IdUsuario"].ToString();

                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("usu_id", idusuario)
                });


                var response = await this.apiService.Get <TarjetaUsuarioReturn>("/tarjetas", "/tarjetaUsuario", content);

                if (!response.IsSuccess)
                {
                    //  await Mensajes.Alerta("Ocurrio un error al cargar tarjeta win");

                    VerTarjeta = false;

                    return;
                }

                this.listaTarjetausuario = (TarjetaUsuarioReturn)response.Result;

                ImagenTarjeta = VariablesGlobales.RutaServidor + listaTarjetausuario.resultado.tar_imagen;
                GlobalResources.Current.ImagenTarjeta = VariablesGlobales.RutaServidor + listaTarjetausuario.resultado.tar_imagen;
                PuntosWin = listaTarjetausuario.resultado.tar_puntos;
                NoSocio   = listaTarjetausuario.resultado.tar_id;

                VerTarjeta = true;
            }
            catch (Exception)
            {
                VerTarjeta = false;
            }
        }
        private async void LoadRestaurantes()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    return;
                }


                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("", ""),
                });


                var response = await this.apiService.GetReal <RestaurantReturn>("/gastronomia", "/obtenerRestaurantBar", content);

                if (!response.IsSuccess)
                {
                    //await Mensajes.Alerta("Error al cargar Restaurantes/Bar");

                    return;
                }

                this.listRestaruant = (RestaurantReturn)response.Result;

                RestaurantDetalle = new ObservableCollection <GastronomiaItemViewModel>(this.ToRestaurantItemViewModel());

                int Contador = RestaurantDetalle.Count;

#if __IOS__
                TamanoRestaurant = (Contador * 230);
#endif

#if __ANDROID__
                TamanoRestaurant = (Contador * 235);
#endif
            }
            catch (Exception ex)
            {
                //await Mensajes.Error("Gastronomia - Restaurantes" + ex.ToString());
            }
        }
示例#18
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (showsito.EventosDetalle != null)
            {
                ListaShow.ItemsSource = null;

                ListaShow.ItemsSource = showsito.EventosDetalle;

                if (showsito.EventosDetalle.Count == 0)
                {
                    Mensajes.Alerta("No se encontro ningún evento");
                }
            }
        }
示例#19
0
        private async void LoadRestaurantes()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    return;
                }


                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("", ""),
                });


                var response = await this.apiService.GetReal <RestaurantReturn>("/gastronomia", "/obtenerRestaurantBar", content);

                if (!response.IsSuccess)
                {
                    //await Mensajes.Alerta("Error al cargar Restaurantes/Bar");

                    return;
                }

                this.listRestaruant = (RestaurantReturn)response.Result;

                RestaurantDetalle = new ObservableCollection <GastronomiaItemViewModel>(this.ToRestaurantItemViewModel());

                int contador = 0;

                foreach (var item in RestaurantDetalle)
                {
                    VariablesGlobales.ArregloRestaurantes[contador] = item.reb_nombre;

                    contador = contador + 1;
                }
                VariablesGlobales.NumeroArreglo = contador - 1;
            }
            catch (Exception ex)
            {
            }
        }
        private async void Restablece()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Mensajes.Alerta("Verificá tu conexión a Internet");

                return;
            }


            if (string.IsNullOrEmpty(this.CorreoElectronico))
            {
                await Mensajes.Alerta("Correo electrónico requerido");

                return;
            }


            if (!ValidaEmailMethod.ValidateEMail(this.CorreoElectronico))
            {
                await Mensajes.Alerta("Correo electronico mal estructurado");

                return;
            }


            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("usu_email", this.CorreoElectronico),
            });


            var response = await this.apiService.Get <ReiniciaPassReturn>("/usuarios", "/reinicia_contrasena", content);

            if (!response.IsSuccess)
            {
                await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");

                return;
            }

            this.CorreoElectronico = string.Empty;

            await Mensajes.Alerta("Contraseña temporal generada, se ha enviado a tu correo electrónico");
        }
示例#21
0
        async void Handle_Clicked(object sender, System.EventArgs e)
        {
            UserDialogs.Instance.ShowLoading("Iniciando Sesion...", MaskType.Black);


            MasterPage fpm = new MasterPage();

            //fpm.Master = new DetailPage(); // You have to create a Master ContentPage()
            //App.NavPage = new NavigationPage(new CustomTabPage()) { BarBackgroundColor = Color.FromHex("#23144B") };

            //fpm.Detail = App.NavPage; // You have to create a Detail ContenPage()
            Application.Current.MainPage = fpm;

            UserDialogs.Instance.HideLoading();

            await Mensajes.Alerta("Bienvenido " + Application.Current.Properties["NombreCompleto"].ToString());
        }
示例#22
0
        private async void NoVincular()
        {
            UserDialogs.Instance.ShowLoading("Procesando...", MaskType.Black);

            //MainViewModel.GetInstance().Master = new MasterViewModel();
            MainViewModel.GetInstance().Inicio = new InicioViewModel();
            MainViewModel.GetInstance().Detail = new DetailViewModel();
            //MainViewModel.GetInstance().Casino = new CasinoViewModel();
            //MainViewModel.GetInstance().Hotel = new HotelViewModel();
            //MainViewModel.GetInstance().SalasEventos = new SalasEventosViewModel();
            //MainViewModel.GetInstance().Gastronomia = new GastronomiaViewModel();


            //MasterPage fpm = new MasterPage();
            // fpm.Master = new DetailPage(); // You have to create a Master ContentPage()
            //App.NavPage = new NavigationPage(new CustomTabPage()) { BarBackgroundColor = Color.FromHex("#23144B") };

            //fpm.Detail = App.NavPage; // You have to create a Detail ContenPage()
            //Application.Current.MainPage = fpm;

            var content1 = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("mensaje", "Gracias por registrarte en nuestra App, ahora podras disfrutar de todos nuestros beneficios."),
                new KeyValuePair <string, string>("nombre", "Bienvenido a nuestra App Móvil"),
                new KeyValuePair <string, string>("email", Application.Current.Properties["Email"].ToString()),
            });


            var response1 = await this.apiService.Get <GuardadoGenerico>("/correo", "/envioemail", content1);

            if (!response1.IsSuccess)
            {
                await Mensajes.Alerta("Ocurrió un error al tratar de enviar correo");

                return;
            }


            await((MasterPage)Application.Current.MainPage).Detail.Navigation.PushModalAsync(new PaginaAceptar());

            UserDialogs.Instance.HideLoading();


            // await Mensajes.Alerta("Bienvenido " + Application.Current.Properties["NombreCompleto"].ToString());
        }
        private async void LoadTarjetaUsuario()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    return;
                }

                NoSocio = Application.Current.Properties["NumeroSocio"].ToString();

                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("usu_id_tarjeta", NoSocio)
                });


                var response = await this.apiService.Get <TarjetaUsuarioReturn>("/tarjetas", "/tarjetaUsuario", content);

                if (!response.IsSuccess)
                {
                    await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");

                    return;
                }

                this.listaTarjetausuario = (TarjetaUsuarioReturn)response.Result;

                ImagenTarjeta = VariablesGlobales.RutaServidor + listaTarjetausuario.resultado.tar_imagen;

                PuntosWin       = listaTarjetausuario.resultado.tar_puntos;
                NumeroDocumento = Application.Current.Properties["NumeroDocumento"].ToString();
                TipoDocumento   = Application.Current.Properties["TipoDocumento"].ToString();

                //NoSocio = listaTarjetausuario.resultado.tar_id;
            }
            catch (Exception ex)
            {
                //await Mensajes.Error(ex.ToString());
            }
        }
示例#24
0
        private async void EliminaFavoritos()
        {
            try
            {
                bool isLoggedIn = Application.Current.Properties.ContainsKey("IsLoggedIn") ?
                                  (bool)Application.Current.Properties["IsLoggedIn"] : false;

                if (isLoggedIn)
                {
                    var content = new FormUrlEncodedContent(new[]
                    {
                        new KeyValuePair <string, string>("gua_id", Convert.ToString(this.gua_id)),
                    });

                    var response = await this.apiService.Get <GuardadoGenerico>("/guardados", "/destroy", content);

                    if (!response.IsSuccess)
                    {
                        await Mensajes.Alerta("Ha habido un error en tu solicitud, por favor volvé a intentarlo");

                        return;
                    }

                    var list = (GuardadoGenerico)response.Result;


                    //var Item = MainViewModel.GetInstance().listFavoritos.resultado.Where(l => l.gua_id == this.gua_id).SingleOrDefault();

                    //var actualiza = MainViewModel.GetInstance().listFavoritos.resultado;//.Where(l => l.gua_id == this.gua_id).SingleOrDefault();

                    //actualiza.Remove(Item);


                    await Mensajes.Alerta("Eliminado con éxito");
                }
                else
                {
                    await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
                }
            }
            catch (Exception)
            {
                await Mensajes.Alerta("Es necesario que te registres para completar esta acción");
            }
        }
        //public ICommand CambiaHabitacionCommand
        //{
        //    get
        //    {
        //        return new RelayCommand(CambiaHabitacion);
        //    }
        //}

        //private async void CambiaHabitacion()
        //{

        //    var connection = await this.apiService.CheckConnection();

        //    if (!connection.IsSuccess)
        //    {
        //        await Mensajes.Error(connection.Message);

        //        return;
        //    }

        //}



        #endregion

        #region Methods
        private async void LoadDetalleHabitacion()
        {
            var connection = await this.apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Mensajes.Alerta(connection.Message);

                return;
            }

            VariablesGlobales.Img1 = hd.hab_imagen;
            VariablesGlobales.Img2 = "https://citycenter-rosario.com.ar/" + hd.hab_imagen_1;
            VariablesGlobales.Img3 = "https://citycenter-rosario.com.ar/" + hd.hab_imagen_2;
            VariablesGlobales.Img4 = "https://citycenter-rosario.com.ar/" + hd.hab_imagen_3;
            VariablesGlobales.Img5 = "https://citycenter-rosario.com.ar/" + hd.hab_imagen_4;
            VariablesGlobales.Img6 = "https://citycenter-rosario.com.ar/" + hd.hab_imagen_5;
        }
示例#26
0
 private void Centro()
 {
     try
     {
         if (String.IsNullOrEmpty(VariablesGlobales.FechaShowInicio))
         {
             EventosDetalle = new ObservableCollection <EventosItemViewModel>(this.ToEventosItemViewModel().Where(l => l.eve_id_locacion == 1));
         }
         else
         {
             EventosDetalle = new ObservableCollection <EventosItemViewModel>(this.ToEventosItemViewModel().Where(l => l.eve_id_locacion == 1 && l.eve_fecha_hora_inicio >= Convert.ToDateTime(VariablesGlobales.FechaShowInicio) && l.eve_fecha_hora_inicio <= Convert.ToDateTime(VariablesGlobales.FechaShowFinal)));
         }
     }
     catch (Exception)
     {
         Mensajes.Alerta("No existen eventos en Centro de Convenciones");
     }
 }
示例#27
0
        private async Task <string> ValidaTarjetaUsuario(string NoTarjeta)
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    return("No se tiene conexion a internet");
                }

                //string idusuario = Application.Current.Properties["IdUsuario"].ToString();

                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("usu", Application.Current.Properties["IdUsuario"].ToString()),
                    new KeyValuePair <string, string>("tarjeta", NoTarjeta)
                });


                var response = await this.apiService.Get <TarjetaValidaReturn>("/es/register", "/valida_tarjeta_socio", content);

                if (!response.IsSuccess)
                {
                    //await Mensajes.Error("Error al cargar Torneos");

                    return("No Existe tarjeta Ingresada");
                }

                //if (NoTarjeta != NoSocio)
                //{
                //await  Mensajes.Info("La tarjeta ingresada es diferente a la que tiene asiganda el usuario");
                //}

                return("OK");
            }
            catch (Exception ex)
            {
                //await Mensajes.Error(ex.ToString());
                return("Error");
            }
        }
示例#28
0
        public async void ConsultaPuntos()
        {
            bool isLoggedIn = Application.Current.Properties.ContainsKey("IsLoggedIn") ?
                              (bool)Application.Current.Properties["IsLoggedIn"] : false;

            if (isLoggedIn)
            {
                string Nosocio = Application.Current.Properties["NumeroSocio"].ToString();


                if (Nosocio == "" || Nosocio == "0")
                {
                    await Mensajes.Alerta("No cuenta con una tarjeta asociada, pódes vincularla desde tu perfil");

                    return;
                }

                // var content = new FormUrlEncodedContent(new[]
                //{
                //    new KeyValuePair<string, string>("usu",Application.Current.Properties["IdUsuario"].ToString()),
                //   new KeyValuePair<string, string>("tarjeta",Nosocio )
                //});

                //var response = await this.apiService.Get<TarjetaValidaReturn>("/es/register", "/valida_tarjeta_socio", content);

                //if (!response.IsSuccess)
                //{
                //    await Mensajes.Alerta("No se cuenta con ninguna tarjeta asociada, pódes vincular tu tarjeta desde tu perfil");
                //    return;
                //}


                App.NavPage.BarBackgroundColor = Color.FromHex("#23144B");

                MainViewModel.GetInstance().ConsultaTarjetaWin = new ConsultaTarjetaWinViewModel();

                await((MasterPage)Application.Current.MainPage).Detail.Navigation.PushAsync(new ConsultaTarjetaWin());
            }
            else
            {
                await Mensajes.Alerta("Iniciá sesión para poder consultar tus puntos y recompensas");
            }
        }
示例#29
0
        private async void UbicacionCasino()
        {
            try
            {
                Plugin.Share.Abstractions.ShareMessage Compartir = new Plugin.Share.Abstractions.ShareMessage();


                var permissionStatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Location);

                if (permissionStatus == PermissionStatus.Denied)
                {
                    var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.Location);

                    if (results.ContainsKey(Permission.Location))
                    {
                        if (permissionStatus != PermissionStatus.Granted)
                        {
                            await Mensajes.Alerta("Ubicación denegeada, por favor activa el GPS de tu dispositivo");

                            return;
                        }
                    }
                }


                //var hasPermission = await Utils.CheckPermissions(Permission.Location);
                //if (!hasPermission)
                //return;


                var Posicion = await Ubicacion.GetCurrentPosition();

                Compartir.Text  = "Ubicacion Actual";
                Compartir.Title = "Tu ubicacion";
                Compartir.Url   = "https://www.google.com/maps/@" + Posicion.Latitude + "," + Posicion.Longitude + "," + "16z";

                await CrossShare.Current.Share(Compartir);
            }
            catch (Exception)
            {
                await Mensajes.Alerta("Ubicación denegeada, por favor activa el GPS de tu dispositivo");
            }
        }
示例#30
0
        private async void LoadSalaPoker()
        {
            try
            {
                var connection = await this.apiService.CheckConnection();

                if (!connection.IsSuccess)
                {
                    await Mensajes.Alerta("Verificá tu conexión a Internet");

                    return;
                }


                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair <string, string>("", ""),
                });


                var response = await this.apiService.Get <SalaPokerReturn>("/casino/sala_poker", "/indexApp", content);

                if (!response.IsSuccess)
                {
                    //await Mensajes.Error("Error al cargar Sala de Poker");
                    return;
                }

                this.listSalasPoker = (SalaPokerReturn)response.Result;


                Imagen_Selected = VariablesGlobales.RutaServidor + this.listSalasPoker.resultado[0].spo_imagen;


                SalaPokerDetalle = new ObservableCollection <SalaPokerDetalle>(this.ToSalaPokerItemViewModel());
            }
            catch (Exception ex)
            {
                //await Mensajes.Error("Casino - Sala Poker" + ex.ToString());
            }
        }