From 756bf52499a4753c01071de8933aaf7fbb372ccd Mon Sep 17 00:00:00 2001 From: nimaye Date: Mon, 17 Oct 2022 09:02:24 +0200 Subject: [PATCH] modifcation suppression inscrit bdd --- Code/IHM/MainWindow.xaml.cs | 3 ++- Code/LinqToPgSQL/PersLinqToPgSQL.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/IHM/MainWindow.xaml.cs b/Code/IHM/MainWindow.xaml.cs index 7fb459a..a6ea73f 100644 --- a/Code/IHM/MainWindow.xaml.cs +++ b/Code/IHM/MainWindow.xaml.cs @@ -56,12 +56,13 @@ namespace IHM } } - + MessageBox.Show("Suppression ok"); } private void test_Click(object sender, RoutedEventArgs e) { testSelect(); + /* testSuppression();*/ } } } diff --git a/Code/LinqToPgSQL/PersLinqToPgSQL.cs b/Code/LinqToPgSQL/PersLinqToPgSQL.cs index a7306e1..9c5d4c6 100644 --- a/Code/LinqToPgSQL/PersLinqToPgSQL.cs +++ b/Code/LinqToPgSQL/PersLinqToPgSQL.cs @@ -75,11 +75,11 @@ namespace LinqToPgSQL string requete = $"DELETE FROM INSCRIT WHERE id=(@p)"; - string requeteFKey = $"DELETE FROM DEVISE WHERE id=(@p2)"; + string requeteFKey = $"DELETE FROM DEVISEINSCRIT WHERE idInscrit=(@p2)"; using (var command1 = new NpgsqlCommand(requeteFKey, conn)) { - command1.Parameters.AddWithValue("p2", i.Dev); + command1.Parameters.AddWithValue("p2", i.Id); await command1.ExecuteNonQueryAsync(); }