Exemplo n.º 1
0
        static public async void recuperationAntibios()
        {
            JsonSerializerSettings settings = new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.Auto
            };
            HttpClient          wc      = new HttpClient();
            HttpResponseMessage reponse = await wc.GetAsync(new Uri("https://gsbapiandroid.000webhostapp.com/API/AllAntibiotiques.php", UriKind.Absolute));

            string         json             = reponse.Content.ReadAsStringAsync().Result;
            List <Antibio> uneListeAntibios = null;

            uneListeAntibios = JsonConvert.DeserializeObject <List <Antibio> >(json, settings);
            DataAntibio.SetLesAntiobiotiques(uneListeAntibios);
        }
Exemplo n.º 2
0
        public async void recuperation()

        {
            HttpClient          wc      = new HttpClient();
            HttpResponseMessage reponse = await wc.GetAsync(new Uri("https://gsbapiandroid.000webhostapp.com/API/categories.php", UriKind.Absolute));

            string           json = reponse.Content.ReadAsStringAsync().Result;
            List <Categorie> unelisteCategories = null;

            unelisteCategories = JsonConvert.DeserializeObject <List <Categorie> >(json);
            DataAntibio.SetLesCategories(unelisteCategories);
            lvCategories.ItemsSource = unelisteCategories.ToList();
            recuperationAntibios();
            uneLCateg = unelisteCategories;
        }
Exemplo n.º 3
0
 private void ContentPage_Appearing(object sender, EventArgs e)
 {
     lvAntibiotiques.ItemsSource = DataAntibio.getAntibiotiquesUnLibelle(libelle).ToList();
 }