From 4e7fff641eee15a69e42266ace47b8f2c31b8341 Mon Sep 17 00:00:00 2001 From: Leana BESSON Date: Tue, 30 May 2023 15:43:56 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'affichage=20d'une=20entit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Console/Program.cs | 18 ++++++++++++++++++ Sources/Model/Veterinaire.cs | 21 +++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Sources/Console/Program.cs b/Sources/Console/Program.cs index b65504c..109716c 100644 --- a/Sources/Console/Program.cs +++ b/Sources/Console/Program.cs @@ -275,6 +275,17 @@ class Program Console.WriteLine("\tTaille : " + animal.Taille); Console.WriteLine("\tPoids : " + animal.Poids); Console.WriteLine("\tAlimentation : " + animal.Alimentation); + Console.WriteLine("\tPETSITTER : "); + AfficherEntite(animal.Petsitter); + Console.WriteLine("\tCHENIL : "); + AfficherEntite(animal.Chenil); + Console.WriteLine("\VETERINAIRE : "); + AfficherEntite(animal.Veterinaire); + Console.WriteLine("\tMAGASIN ALIMENTAIRE : "); + AfficherEntite(animal.MagasinAlimentaire); + Console.WriteLine("\tREFUGE, ELEVAGE, CHENIL DE PROVENANCE : "); + AfficherEntite(animal.Provenance); + Console.WriteLine("\n\t1- Modifier"); Console.WriteLine("\t2- Supprimer"); @@ -300,6 +311,13 @@ class Program } } + static private void AfficherEntite(Entite entite) + { + Console.WriteLine("\t\tNom : " + entite.Nom); + Console.WriteLine("\t\tAdresse : " + entite.Adresse + "," + Convert.ToInt32(entite.CodePostal) + " " + entite.Ville); + Console.WriteLine("\t\tNuméro de téléphone : " + entite.NumTel); + } + static private void ModifierAnimal(Animal animal, List especetheque) { while (true) diff --git a/Sources/Model/Veterinaire.cs b/Sources/Model/Veterinaire.cs index 562cc2a..96d8454 100644 --- a/Sources/Model/Veterinaire.cs +++ b/Sources/Model/Veterinaire.cs @@ -10,16 +10,17 @@ namespace Model public class Veterinaire : Entite { public Entite Entite { get; set; } - //public string Clinique - //{ - // get => clinique; - //set - //{ - // if(clinique == value) - // return; - // clinique = value; - //} - // } + public string Clinique + { + get => clinique; + set + { + if(clinique == value) + return; + clinique = value; + Entite.OnPropertyChanged(nameof(Clinique)); + } + } private string clinique; public Veterinaire()