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 @@