protected override void OnAppearing() { var Latitud = 0.0; var Longitud = 0.0; var direccion = ""; var localidad = ""; Device.BeginInvokeOnMainThread(async() => { BD.ObtenerResul obtenerResul = new BD.ObtenerResul(); var img = await obtenerResul.GetList <BD.ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/getLocales.php"); if (img != null) { foreach (BD.Locales locales in img.Local) { Latitud = locales.Lat; Longitud = locales.Log; direccion = locales.Direccion; localidad = locales.Ciudad; LlenarPins(Latitud, Longitud, direccion, localidad); } Locator(); } else { await Navigation.PushPopupAsync(new DialogoServidor()); Navigation.RemovePage(this); } }); }
protected override void OnAppearing() { base.OnAppearing(); Device.BeginInvokeOnMainThread(async() => { BD.ObtenerResul obtenerResul = new BD.ObtenerResul(); var img = await obtenerResul.GetList <BD.ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/getCarousel.php"); if (img != null) { Carousel.IsVisible = true; DefMayor.IsVisible = true; Carousel.IsEnabled = true; Carousel.ItemsSource = img.Imagen; Contador = img.Imagen.Count; var tapMayor = new TapGestureRecognizer(); tapMayor.Tapped += OnNext; DefMayor.GestureRecognizers.Add(tapMayor); var TapMenor = new TapGestureRecognizer(); TapMenor.Tapped += OnPrev; DefMenor.GestureRecognizers.Add(TapMenor); } else { await Navigation.PushPopupAsync(new DialogoServidor()); } }); }
protected override void OnAppearing() { base.OnAppearing(); Device.BeginInvokeOnMainThread(async() => { if (new ComprobarConexion().Conexion()) { var datos = new DataAccess(); int num = datos.getCountUsuario(); if (num > 0) { BD.ObtenerResul obtenerResul = new BD.ObtenerResul(); var img = await obtenerResul.GetList <BD.ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/getPromociones.php"); if (img != null) { foreach (BD.Promociones promos in img.Promociones) { if (!promos.Dia.Contains(diahora.DayOfWeek.ToString())) { promos.imagenBloqueada = "Bloqueado.png"; } } myList.FlowItemsSource = img.Promociones; Registrate.IsVisible = false; } else { await Navigation.PushPopupAsync(new DialogoServidor()); } } else { BD.ObtenerResul obtenerResul = new BD.ObtenerResul(); var img = await obtenerResul.GetList <BD.ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/getPromociones.php"); if (img != null) { foreach (BD.Promociones promos in img.Promociones) { if (promos.Premium == 1 || !promos.Dia.Contains(diahora.DayOfWeek.ToString())) { promos.imagenBloqueada = "Bloqueado.png"; } } myList.FlowItemsSource = img.Promociones; Registrate.Source = "http://tools.agorafranquicias.com/APP/Images/Promociones/BotonRegistrate.png"; BtnRegistrar(); } else { await Navigation.PushPopupAsync(new DialogoServidor()); } } } }); }
protected override void OnAppearing() { base.OnAppearing(); Device.BeginInvokeOnMainThread(async() => { BD.ObtenerResul obtenerResul = new BD.ObtenerResul(); var producto = await obtenerResul.GetList <BD.ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/getPromocion.php?id=" + Id); if (producto != null) { promo.Source = producto.ProductoPromo.ElementAtOrDefault(0).URL; } else { await Navigation.PushPopupAsync(new DialogoServidor()); } }); }
protected override void OnAppearing() { base.OnAppearing(); var template = new DataTemplate(typeof(DefaultTemplate)); var view = new AccordionView(template); List <Section> ListaCategoria = new List <Section>(); List <ShoppingCart> ListaProductos = null; view.SetBinding(AccordionView.ItemsSourceProperty, "List"); view.Template.SetBinding(AccordionSectionView.TitleProperty, "Title"); view.Template.SetBinding(AccordionSectionView.ItemsSourceProperty, "List"); Xamarin.Forms.Device.BeginInvokeOnMainThread(async() => { BD.ObtenerResul obtenerResul = new BD.ObtenerResul(); var img = await obtenerResul.GetList <BD.ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/nombreImagenCategoriaLocal.php"); var prod = await obtenerResul.GetList <ClasesBd>("http://tools.agorafranquicias.com/APP/Consultas/ShoppingCart.php"); if (img != null) { foreach (BD.NombreImagenCategoria Cat in img.Nombreimagencategoria) { ListaProductos = new List <ShoppingCart>(); foreach (ShoppingCart productos in prod.ShoppingCart) { if (Cat.Id == productos.Id_Categoria) { ListaProductos.Add(productos); } } ListaCategoria.Add(new Section { Title = Cat.URL, List = ListaProductos }); } view.BindingContext = new ViewModel { List = ListaCategoria }; this.Content = view; } else { await Navigation.PushPopupAsync(new DialogoError()); } }); }