From dc5993dbb0893c35daa79f4a2226b17f45c9f093 Mon Sep 17 00:00:00 2001 From: luevard Date: Wed, 12 Oct 2022 11:53:07 +0200 Subject: [PATCH] Ajout du stub et ajout de constructeur dans banque et inscrit --- Code/Model/Banque.cs | 8 ++++++++ Code/Model/Inscrit.cs | 13 +++++++++++-- Code/Model/Stub.cs | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 Code/Model/Stub.cs diff --git a/Code/Model/Banque.cs b/Code/Model/Banque.cs index 8db7d2a..07b43ae 100644 --- a/Code/Model/Banque.cs +++ b/Code/Model/Banque.cs @@ -20,6 +20,14 @@ namespace Model UrlLogo = urlLogo; } + public Banque(string nom, string urlSite, string urlLogo, Listlescomptes) + { + Nom = nom; + UrlSite = urlSite; + UrlLogo = urlLogo; + ListeDesComptes = lescomptes; + } + private void AjouterCompte(Compte compte) { ListeDesComptes.Add(compte); diff --git a/Code/Model/Inscrit.cs b/Code/Model/Inscrit.cs index 5551b8a..e6e362c 100644 --- a/Code/Model/Inscrit.cs +++ b/Code/Model/Inscrit.cs @@ -17,7 +17,16 @@ namespace Model Prenom = prenom; Mdp = mdp; SoldeTotal = soldeTotal; - //TouteLesBanques = new List(); + } + public Inscrit(string id, string nom, string mail, string prenom, string mdp, double soldeTotal,Listlesbanques) + { + Id = id; + Nom = nom; + Mail = mail; + Prenom = prenom; + Mdp = mdp; + SoldeTotal = soldeTotal; + LesBanques = lesbanques; } public string Id { get; private set; } public string Nom { get; private set; } @@ -26,7 +35,7 @@ namespace Model public string Mdp { get; private set; } public double SoldeTotal { get; private set; } public Devises Dev { get; private set; } - //private List TouteLesBanques { get; private set; } + private List LesBanques { get; set; } /*public void ajouterBanque(Banque b) { diff --git a/Code/Model/Stub.cs b/Code/Model/Stub.cs new file mode 100644 index 0000000..1799fc8 --- /dev/null +++ b/Code/Model/Stub.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class Stub + { + public List Banques = new(); + public List Inscrits = new(); + public List Comptes = new(); + public List LoadInscrit() + { + Inscrits.Add(new("00001", "Evard", "lucasevard@gmail.com","Lucas","test",10,LoadBanques())); + Inscrits.Add(new("00002", "Livet", "hugolivet@gmail.com", "Hugo", "test", 110,LoadBanques())); + return Inscrits; + } + public List LoadBanques() + { + Banques.Add(new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png",LoadCompte())); + Banques.Add(new("Crédit Agricole", "https://www.credit-agricole.fr", "https://yt3.ggpht.com/a/AGF-l7_mEfX2eQaGm8GefLOg5ZMRciNw-pESE3gUWg=s900-c-k-c0xffffffff-no-rj-mo",LoadCompte())); + return Banques; + } + public List LoadCompte() + { + Comptes.Add(new("Livret A", 2)); + Comptes.Add(new("Compte Cheque", 2000)); + return Comptes; + } + } +} +