From 502335e9a8c820878ed4b7b235415df05dd7d55d Mon Sep 17 00:00:00 2001 From: luevard Date: Mon, 14 Nov 2022 21:53:10 +0100 Subject: [PATCH] modification classe pour accueillir le format OFX --- Sources/IHM/Dashboard.xaml.cs | 2 +- Sources/Modele/Banque.cs | 6 +++--- Sources/Modele/Compte.cs | 17 +++++++++++------ Sources/Modele/MethodePayement.cs | 17 +++++++++++++++++ Sources/Modele/Operation.cs | 24 +++++++++++++++++++++++- Sources/Modele/Stub.cs | 4 ++-- 6 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 Sources/Modele/MethodePayement.cs diff --git a/Sources/IHM/Dashboard.xaml.cs b/Sources/IHM/Dashboard.xaml.cs index c7e9782..c48aa47 100644 --- a/Sources/IHM/Dashboard.xaml.cs +++ b/Sources/IHM/Dashboard.xaml.cs @@ -36,8 +36,8 @@ public partial class DashBoard : ContentPage { await Bouton.ScaleXTo(1, 50); await Bouton.ScaleYTo(1, 50); - await Bouton.TranslateTo(0,0,50); ImgBanqueActuelle.IsVisible = false; + await Bouton.TranslateTo(0,0,50); BoutonRetour.IsVisible = false; Bouton.IsEnabled = true; } diff --git a/Sources/Modele/Banque.cs b/Sources/Modele/Banque.cs index 698a523..18180f9 100644 --- a/Sources/Modele/Banque.cs +++ b/Sources/Modele/Banque.cs @@ -20,7 +20,7 @@ namespace Model UrlLogo = urlLogo; } - public Banque(string nom, string urlSite, string urlLogo, Listlescomptes) + public Banque(string nom, string urlSite, string urlLogo, List lescomptes) { Nom = nom; UrlSite = urlSite; @@ -52,10 +52,10 @@ namespace Model foreach (Compte compte in ListeDesComptes) { if (compte.Nom.Equals(s)) - return compte; + return compte; } throw new KeyNotFoundException(); } } -} +} \ No newline at end of file diff --git a/Sources/Modele/Compte.cs b/Sources/Modele/Compte.cs index 6176571..6764d6b 100644 --- a/Sources/Modele/Compte.cs +++ b/Sources/Modele/Compte.cs @@ -2,34 +2,39 @@ { public class Compte { + public string Identifiant { get; private set; } public string Nom { get; private set; } public double Solde { get; private set; } public List LesOpe { get; private set; } = new List(); public List LesPla { get; private set; } = new List(); public List LesEch { get; private set; } = new List(); - public Compte(string nom, double solde) + public Compte(string id, string nom, double solde) { + Identifiant = id; Nom = nom; Solde = solde; LesOpe = new List(); LesPla = new List(); LesEch = new List(); } - public Compte(string nom, double solde, List lesOpe) + public Compte(string id, string nom, double solde, List lesOpe) { + Identifiant = id; Nom = nom; Solde = solde; LesOpe = lesOpe; } - public Compte(string nom, double solde, List lesOpe, List lesPla) + public Compte(string id, string nom, double solde, List lesOpe, List lesPla) { + Identifiant = id; Nom = nom; Solde = solde; LesOpe = lesOpe; LesPla = lesPla; } - public Compte(string nom, double solde, List lesOpe, List lesPla, List lesEch) + public Compte(string id, string nom, double solde, List lesOpe, List lesPla, List lesEch) { + Identifiant = id; Nom = nom; Solde = solde; LesOpe = lesOpe; @@ -59,7 +64,7 @@ public void ajoutEcheance(Echeance e) { - if(e == null) throw new NullReferenceException(); + if (e == null) throw new NullReferenceException(); LesEch.Add(e); } @@ -70,7 +75,7 @@ public void ajoutPlannification(Planification p) { - if(p == null) throw new NullReferenceException(); + if (p == null) throw new NullReferenceException(); LesPla.Add(p); } diff --git a/Sources/Modele/MethodePayement.cs b/Sources/Modele/MethodePayement.cs new file mode 100644 index 0000000..7a7abb8 --- /dev/null +++ b/Sources/Modele/MethodePayement.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public enum MethodePayement + { + None, + Cb, + Esp, + Chq, + Vir + } +} \ No newline at end of file diff --git a/Sources/Modele/Operation.cs b/Sources/Modele/Operation.cs index 9384c33..8454af6 100644 --- a/Sources/Modele/Operation.cs +++ b/Sources/Modele/Operation.cs @@ -8,5 +8,27 @@ namespace Model { public class Operation { + + public string IntituleOperation { get; private set; } + + public double Montant { get; private set; } + + public DateTime DateOperation { get; private set; } + + public MethodePayement ModePayement { get; private set; } + + public bool IsDebit { get; private set; } + + public string IdCompte { get; private set; } + + public Operation(string intituleOperation, string idCompte, double montant, DateTime dateOperation, MethodePayement modePayement, bool isDebit = true) + { + IntituleOperation = intituleOperation; + IdCompte = idCompte; + Montant = montant; + DateOperation = dateOperation; + ModePayement = modePayement; + IsDebit = isDebit; + } } -} +} \ No newline at end of file diff --git a/Sources/Modele/Stub.cs b/Sources/Modele/Stub.cs index ea68737..1b5ba0c 100644 --- a/Sources/Modele/Stub.cs +++ b/Sources/Modele/Stub.cs @@ -16,7 +16,7 @@ namespace Model // ajouter load all pour tout les inscrits - public List LoadInscrit() + /* 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", 280,LoadBanques())); @@ -38,7 +38,7 @@ namespace Model Comptes.Add(new("Compte Courant", 2000)); Comptes.Add(new("PEL", 22000)); return Comptes; - } + }*/ }