From 90340af0657248b47ace09f81e208276b3f507fa Mon Sep 17 00:00:00 2001 From: nimaye Date: Wed, 4 Jan 2023 17:35:22 +0100 Subject: [PATCH] =?UTF-8?q?finalisation=20du=20binding=20de=20le=20vue=20o?= =?UTF-8?q?p=C3=A9ration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/IHM/App.xaml.cs | 1 + Sources/IHM/AppShellDesktop.xaml.cs | 1 + Sources/IHM/Desktop/Operations.xaml | 88 ++++++++++++++++---------- Sources/IHM/Desktop/Operations.xaml.cs | 45 ++++++++++++- Sources/Modele/IPersistanceManager.cs | 1 + Sources/Modele/Manager.cs | 4 ++ Sources/Modele/Operation.cs | 18 ++++++ Sources/Modele/Stub.cs | 14 +++- 8 files changed, 137 insertions(+), 35 deletions(-) diff --git a/Sources/IHM/App.xaml.cs b/Sources/IHM/App.xaml.cs index f2639a3..7752044 100644 --- a/Sources/IHM/App.xaml.cs +++ b/Sources/IHM/App.xaml.cs @@ -6,6 +6,7 @@ namespace IHM public partial class App : Application { public Manager Manager { get; set; } = new Manager(new PersLinqToPgSQL()); + public App() { diff --git a/Sources/IHM/AppShellDesktop.xaml.cs b/Sources/IHM/AppShellDesktop.xaml.cs index d82d2a2..646e1f1 100644 --- a/Sources/IHM/AppShellDesktop.xaml.cs +++ b/Sources/IHM/AppShellDesktop.xaml.cs @@ -10,6 +10,7 @@ namespace IHM public partial class AppShellDesktop : Shell { public Manager Mgr => (App.Current as App).Manager; + public Manager Mgr2 => (App.Current as App).Manager; diff --git a/Sources/IHM/Desktop/Operations.xaml b/Sources/IHM/Desktop/Operations.xaml index 727a3a8..ab4ac3b 100644 --- a/Sources/IHM/Desktop/Operations.xaml +++ b/Sources/IHM/Desktop/Operations.xaml @@ -59,44 +59,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - \ No newline at end of file diff --git a/Sources/IHM/Desktop/Operations.xaml.cs b/Sources/IHM/Desktop/Operations.xaml.cs index e978e69..795b387 100644 --- a/Sources/IHM/Desktop/Operations.xaml.cs +++ b/Sources/IHM/Desktop/Operations.xaml.cs @@ -1,10 +1,53 @@ +using Model; + namespace IHM.Desktop; public partial class Operations : ContentView { - public Operations() + + + List operations; + public Operations() { InitializeComponent(); + + // Temporaire pour établir le binding de la vue + operations = new List(); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + + BindingContext = operations; } private void AddCredit_Clicked(object sender, EventArgs e) diff --git a/Sources/Modele/IPersistanceManager.cs b/Sources/Modele/IPersistanceManager.cs index 207b624..201415a 100644 --- a/Sources/Modele/IPersistanceManager.cs +++ b/Sources/Modele/IPersistanceManager.cs @@ -17,5 +17,6 @@ namespace Model bool ExistEmail(string mail); void ChangePasswordBdd(string mail, string newMdp); string RecupMdpBdd(string mail); + } } diff --git a/Sources/Modele/Manager.cs b/Sources/Modele/Manager.cs index cddc1e0..a95a7f4 100644 --- a/Sources/Modele/Manager.cs +++ b/Sources/Modele/Manager.cs @@ -34,6 +34,7 @@ namespace Model } } private Banque selectedBanque; + /// /// A complĂ©ter @@ -46,6 +47,9 @@ namespace Model Pers = persistance; } + + + /// /// Permet la supression d'un inscrit de la base de donnĂ©e. /// diff --git a/Sources/Modele/Operation.cs b/Sources/Modele/Operation.cs index 9384c33..28ab43f 100644 --- a/Sources/Modele/Operation.cs +++ b/Sources/Modele/Operation.cs @@ -8,5 +8,23 @@ namespace Model { public class Operation { + public string Nom { get; private set; } + public string Type { get; private set; } + public string Tag { get; private set; } + public double Montant { get; private set; } + public string Date { get; private set; } + + + public Operation(string nom, string type, string tag, string date, double montant) + { + Nom = nom; + Type = type; + Tag = tag; + Date = DateTime.Now.ToString("dd/MM/yyyy"); + Montant = montant; + } + + + } } diff --git a/Sources/Modele/Stub.cs b/Sources/Modele/Stub.cs index 9f42a71..5936fbd 100644 --- a/Sources/Modele/Stub.cs +++ b/Sources/Modele/Stub.cs @@ -11,7 +11,9 @@ namespace Model public List Banques = new(); public List Inscrits = new(); public List Comptes = new(); + public List operations = new(); + // ajouter load all pour tout les inscrits public List LoadInscrit() @@ -38,7 +40,17 @@ namespace Model return Comptes; } - + // Load les opĂ©rations + public List loadOperation() + { + operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45)); + operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80)); + operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48)); + return operations; + } + + + } }