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());
            }
        }
Esempio n. 2
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)
            {
            }
        }