using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace Model { [DataContract(Name = "animal")] public class Animal : INotifyPropertyChanged { public event PropertyChangedEventHandler? PropertyChanged; [DataMember(Name = "nom")] public string Nom { get => nom; set { if (nom == value) return; nom = value; OnPropertyChanged(nameof(Nom)); } } private string nom; [DataMember(Name = "naissance")] public string DateNaissance { get => dateNaissance; set { if (dateNaissance == value) return; dateNaissance = value; OnPropertyChanged(nameof(DateNaissance)); } } private string dateNaissance; [DataMember(Name = "sexe")] public string Sexe { get => sexe; set { if (sexe == value) return; sexe = value; OnPropertyChanged(nameof(Sexe)); } } private string sexe; [DataMember(Name = "adoption")] public string DateAdoption { get => dateAdoption; set { if (dateAdoption == value) return; dateAdoption = value; OnPropertyChanged(nameof(DateAdoption)); } } private string dateAdoption; [DataMember(Name = "taille")] public float? Taille { get => taille; set { if (taille == value) return; taille = value; OnPropertyChanged(nameof(Taille)); } } private float? taille; [DataMember(Name = "poids")] public float? Poids { get => poids; set { if (poids == value) return; poids = value; OnPropertyChanged(nameof(Poids)); } } private float? poids; [DataMember(Name = "alimentation")] public string Alimentation { get => alimentation; set { if (alimentation == value) return; alimentation = value; OnPropertyChanged(nameof(Alimentation)); } } private string alimentation; [DataMember(Name = "espèce")] public Espece? Espece { get => espece; set { if (espece == value) return; espece = value; OnPropertyChanged(nameof(Espece)); } } private Espece? espece; [DataMember(Name = "race")] public Race? Race { get => race; set { if(race == value) return; race = value; OnPropertyChanged(nameof(Race)); } } private Race? race; [DataMember(Name = "veterinaire")] public Veterinaire? Veterinaire { get => veterinaire; set { if(veterinaire == value) return; veterinaire = value; OnPropertyChanged(nameof(Veterinaire)); } } private Veterinaire? veterinaire = new Veterinaire(); [DataMember(Name = "chenil")] public Chenil? Chenil { get => chenil; set { if (chenil == value) return; chenil = value; OnPropertyChanged(nameof(Chenil)); } } private Chenil? chenil = new Chenil(); [DataMember(Name = "magasinAlimentaire")] public MagasinAlimentaire? MagasinAlimentaire { get => magasinAlimentaire; set { if (magasinAlimentaire == value) return; magasinAlimentaire = value; OnPropertyChanged(nameof(MagasinAlimentaire)); } } private MagasinAlimentaire? magasinAlimentaire = new MagasinAlimentaire(); [DataMember(Name = "provenance")] public Provenance? Provenance { get => provenance; set { if (provenance == value) return; provenance = value; OnPropertyChanged(nameof(Petsitter)); } } private Provenance? provenance = new Provenance(); [DataMember(Name = "petsitter")] public Petsitter? Petsitter { get => petsitter; set { if (petsitter == value) return; petsitter = value; OnPropertyChanged(nameof(Petsitter)); } } private Petsitter? petsitter = new Petsitter(); [DataMember(Name = "image")] public string Image { get => image; set { if (image == value) return; image = value; OnPropertyChanged(nameof(Image)); } } private string image; public Animal(string nom = "", string dateNaissance = "Inconnue", string sexe = "Inconnu", string dateAdpotion = "Inconnue", float? taille = null, float? poids = null, string alimentation = "Inconnue", Race? race = null) { Nom = nom; DateNaissance = dateNaissance; Sexe = sexe; DateAdoption = dateAdpotion; Taille = taille; Poids = poids; Alimentation = alimentation; Race = race; Petsitter = petsitter; } void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }