From b8f18fdee5ec41c083b23c6497373d7f8a266757 Mon Sep 17 00:00:00 2001 From: hulivet1 Date: Fri, 2 Dec 2022 16:04:17 +0100 Subject: [PATCH] Gestion Banques presque oke --- Sources/Data/PersLinqToPgSQL.cs | 20 ++++++++- Sources/IHM/IHM.csproj | 4 ++ Sources/IHM/Mobile/GestionBanques.xaml | 24 +++++++++-- Sources/IHM/Mobile/GestionBanques.xaml.cs | 3 +- .../Images/GestionBanques/add_banks.png | Bin 0 -> 629 bytes Sources/IHM/Resources/Styles/Colors.xaml | 1 + Sources/Modele/IPersistanceManager.cs | 3 +- Sources/Modele/Manager.cs | 38 ++++++++++++++++-- 8 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 Sources/IHM/Resources/Images/GestionBanques/add_banks.png diff --git a/Sources/Data/PersLinqToPgSQL.cs b/Sources/Data/PersLinqToPgSQL.cs index d6fa114..da4d022 100644 --- a/Sources/Data/PersLinqToPgSQL.cs +++ b/Sources/Data/PersLinqToPgSQL.cs @@ -360,9 +360,9 @@ namespace LinqToPgSQL // attente des autres supression } - public IList ImportBanques() + public List ImportBanques() { - IList bquesDispo = new List(); + List bquesDispo = new List(); dbAccess.Open(); NpgsqlCommand cmd = new NpgsqlCommand($"SELECT * FROM Banque", dbAccess); @@ -375,6 +375,22 @@ namespace LinqToPgSQL return bquesDispo; } + public List ImportBanquesForUser(Inscrit i) + { + List bquesDispo = new List(); + dbAccess.Open(); + + NpgsqlCommand cmd = new NpgsqlCommand($"SELECT b.nom, b.urllogo, b.urldl FROM Banque b, InscrBanque ib WHERE ib.nombanque = b.nom AND ib.idinscrit=(@id);", dbAccess); + cmd.Parameters.AddWithValue("p", i.Id); + NpgsqlDataReader dbReader = cmd.ExecuteReader(); + while (dbReader.Read()) + { + bquesDispo.Add(new Banque(dbReader.GetString(0), dbReader.GetString(1), dbReader.GetString(2))); + } + dbAccess.Close(); + return bquesDispo; + } + } } \ No newline at end of file diff --git a/Sources/IHM/IHM.csproj b/Sources/IHM/IHM.csproj index ca89c1b..2f6e57e 100644 --- a/Sources/IHM/IHM.csproj +++ b/Sources/IHM/IHM.csproj @@ -38,6 +38,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -67,6 +70,7 @@ + diff --git a/Sources/IHM/Mobile/GestionBanques.xaml b/Sources/IHM/Mobile/GestionBanques.xaml index 78d9348..f0f694e 100644 --- a/Sources/IHM/Mobile/GestionBanques.xaml +++ b/Sources/IHM/Mobile/GestionBanques.xaml @@ -13,7 +13,7 @@ - + @@ -23,7 +23,7 @@