using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using System.IO.Pipes; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace Model { [DataContract(Name = "entite")] public class Entite : 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 = "adresse")] public string Adresse { get => adresse; set { if (adresse == value) return; adresse = value; OnPropertyChanged(nameof(Adresse)); } } private string adresse; [DataMember(Name = "codePostal")] public int? CodePostal { get => codePostal; set { if (codePostal == value) return; codePostal = value; OnPropertyChanged(nameof(CodePostal)); } } private int? codePostal; [DataMember(Name = "ville")] public string Ville { get => ville; set { if (ville == value) return; ville = value; OnPropertyChanged(nameof(Ville)); } } private string ville; [DataMember(Name = "numTel")] public int? NumTel { get => numTel; set { if(numTel == value) return; numTel = value; OnPropertyChanged(nameof(NumTel)); } } private int? numTel; public Entite(string nom = "", string adresse = "", int? codePostal = null, string ville = "", int? numTel = null) { Nom = nom; Adresse = adresse; CodePostal = codePostal; Ville = ville; NumTel = numTel; } public void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }