From 4b9212e60c9e53eef888bfbe9896916022ea42b8 Mon Sep 17 00:00:00 2001 From: Hug0lvt Date: Tue, 25 Oct 2022 21:24:20 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20Jour=20de=20la=20classe=20Compt?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Model/Compte.cs | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Code/Model/Compte.cs b/Code/Model/Compte.cs index 701ffad..9d0b7c9 100644 --- a/Code/Model/Compte.cs +++ b/Code/Model/Compte.cs @@ -41,6 +41,59 @@ Solde = s; } + public void ajouterOperation(Operation o) + { + if (o == null) throw new NullReferenceException(); + LesOpe.Add(o); + } + + public void cacherOperation(Operation o) + { + throw new NotImplementedException(); + } + + public void supprimerOperation(Operation o) + { + LesOpe.Remove(o); + } + + public void ajoutEcheance(Echeance e) + { + if(e == null) throw new NullReferenceException(); + LesEch.Add(e); + } + + public void supprimerEcheance(Echeance e) + { + LesEch.Remove(e); + } + + public void ajoutPlannification(Planification p) + { + if(p == null) throw new NullReferenceException(); + LesPla.Add(p); + } + + public void supprimerPlannification(Planification p) + { + LesPla.Remove(p); + } + + public override bool Equals(object? obj) + { + + if (obj == null || GetType() != obj.GetType()) + { + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } } } \ No newline at end of file