diff --git a/Code/IHM/App.xaml.cs b/Code/IHM/App.xaml.cs index d606932..c799256 100644 --- a/Code/IHM/App.xaml.cs +++ b/Code/IHM/App.xaml.cs @@ -16,5 +16,7 @@ namespace IHM public partial class App : Application { public Manager AllInscrits { get; private set; } = new Manager(new LinqToPgSQL.PersLinqToPgSQL()); + //public Manager AllInscrits { get; private set; } = new Manager(new Stub()); + } } diff --git a/Code/IHM/Converters/Func2WindowPartConverter.cs b/Code/IHM/Converters/Func2WindowPartConverter.cs new file mode 100644 index 0000000..d825da7 --- /dev/null +++ b/Code/IHM/Converters/Func2WindowPartConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Data; + +namespace IHM.Converters +{ + public class Func2WindowPartConverter : IValueConverter + { + public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + Func? windowPartCreator = value as Func; + if (windowPartCreator == null) + { + return null; + } + return windowPartCreator(); + } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Code/IHM/MainWindow.xaml.cs b/Code/IHM/MainWindow.xaml.cs index 7fb459a..568fc61 100644 --- a/Code/IHM/MainWindow.xaml.cs +++ b/Code/IHM/MainWindow.xaml.cs @@ -61,7 +61,8 @@ namespace IHM private void test_Click(object sender, RoutedEventArgs e) { - testSelect(); + //testSelect(); } + } } diff --git a/Code/LinqToPgSQL/PersLinqToPgSQL.cs b/Code/LinqToPgSQL/PersLinqToPgSQL.cs index a7306e1..53d3ecc 100644 --- a/Code/LinqToPgSQL/PersLinqToPgSQL.cs +++ b/Code/LinqToPgSQL/PersLinqToPgSQL.cs @@ -33,7 +33,8 @@ namespace LinqToPgSQL var conn = new NpgsqlConnection(connString); Console.Out.WriteLine("Ouverture de la connection"); - conn.Open(); + conn.Open();//gérer l'exception ! + //pb de pare-feu a l'iut var AllInscrit = new NpgsqlCommand("SELECT * FROM Inscrit", conn); diff --git a/Code/Model/Stub.cs b/Code/Model/Stub.cs index 1a671fb..42b3df6 100644 --- a/Code/Model/Stub.cs +++ b/Code/Model/Stub.cs @@ -12,6 +12,8 @@ namespace Model public List Inscrits = new(); public List Comptes = new(); + + // ajouter load all pour tout les inscrits public List LoadInscrit()