예제 #1
0
        public void mascotaSelectedRobada(object sender, EventArgs args)
        {
            Button button    = (Button)sender;
            string texto     = button.Text;
            int    idMascota = Convert.ToInt32(button.CommandParameter);

            if (texto == "Reportar como robada")
            {
                Device.BeginInvokeOnMainThread(async() => {
                    var result = await this.DisplayAlert("¿Reportar como robada?", "¿Reportar como robada?", "Si", "No");
                    if (result)
                    {
                        Retorno retorno = DependencyService.Get <IWebService>().setMascota_Incidente(idMascota, 2, -1, -1, "");
                        if (retorno.Resultado)
                        {
                            Mascota listaMasc       = new Mascota();
                            lsvMascotas.ItemsSource = listaMasc.getMascotaList(Preferences.Get("idMiembro", -1));
                        }
                        else
                        {
                            await DisplayAlert("Error", retorno.Mensaje, "Ok");
                        }
                    }
                });
            }
            else
            {
                Navigation.PushAsync(new Mascota_recuperada(idMascota));
            }
        }
예제 #2
0
        protected override void OnAppearing()
        {
            lsvMascotasExiste.IsRefreshing = true;
            Mascota mascotasExisten = new Mascota();

            lsvMascotasExiste.ItemsSource  = mascotasExisten.getMascotaList(Preferences.Get("idMiembro", -1));
            lsvMascotasExiste.IsRefreshing = false;
        }
예제 #3
0
        public Reg_Masc_Perdida()
        {
            InitializeComponent();

            if (!CrossConnectivity.Current.IsConnected)
            {
                DisplayAlert("Error", "No estás conectado a internet", "Ok");
                return;
            }

            Mascota listaMasc = new Mascota();

            lsvMascotas.ItemsSource = listaMasc.getMascotaList(Preferences.Get("idMiembro", -1));

            lsvMascotas.RefreshCommand = new Command(() => {
                lsvMascotas.IsRefreshing = true;
                lsvMascotas.ItemsSource  = listaMasc.getMascotaList(Preferences.Get("idMiembro", -1));
                lsvMascotas.IsRefreshing = false;
            });
        }
예제 #4
0
        protected override void OnAppearing()
        {
            if (!CrossConnectivity.Current.IsConnected)
            {
                DisplayAlert("Error", "No estás conectado a internet", "Ok");
                return;
            }

            Mascota listaMasc = new Mascota();

            //lsvMascotas.ItemsSource = listaMasc.getMascotaList(Preferences.Get("idMiembro", -1));
            lsvMascotas.IsRefreshing = true;
            lsvMascotas.ItemsSource  = listaMasc.getMascotaList(Preferences.Get("idMiembro", -1));
            lsvMascotas.IsRefreshing = false;
            base.OnAppearing();
        }
예제 #5
0
        public Masc_existentes()
        {
            InitializeComponent();
            if (!CrossConnectivity.Current.IsConnected)
            {
                DisplayAlert("Error", "No estás conectado a internet", "Ok");
                return;
            }
            lsvMascotasExiste.RefreshCommand = new Command(() => {
                lsvMascotasExiste.IsRefreshing = true;
                Mascota mascotasExistenCom     = new Mascota();
                lsvMascotasExiste.ItemsSource  = mascotasExistenCom.getMascotaList(Preferences.Get("idMiembro", -1));
                lsvMascotasExiste.IsRefreshing = false;
            });

            lsvMascotasExiste.ItemTapped += LsvMascotasExiste_ItemTapped;

            Mascota mascotasExisten = new Mascota();

            lsvMascotasExiste.ItemsSource = mascotasExisten.getMascotaList(Preferences.Get("idMiembro", -1));
        }