Exemple #1
0
        public bool AjouterParent(ParentEnfant e)
        {
            string              contenuJson = JsonConvert.SerializeObject(e, Formatting.Indented);
            StringContent       contenu     = new StringContent(contenuJson, Encoding.UTF8, "application/json");
            HttpResponseMessage reponse     = _client.PutAsync($"Personne/AjouterParent/", contenu).Result;

            if (!reponse.IsSuccessStatusCode)
            {
                throw new Exception("Echec de la réception de données.");
            }
            var x = reponse.Content.ReadAsStringAsync().Result;

            return(bool.Parse(x));
        }
 public bool AjouterEnfant(ParentEnfant e)
 {
     return(new PersonneService().AjouterEnfant(e.idParent, e.idEnfant));
 }
 public bool SupprimerEnfant(ParentEnfant e)
 {
     return(new PersonneService().SupprimerEnfant(e.idParent, e.idEnfant));
 }