|
|
|
@ -42,28 +42,55 @@ namespace LinqToPgSQL
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(
|
|
|
|
|
string.Format(
|
|
|
|
|
"({0}, {1}, {2}, {3}, {4})",
|
|
|
|
|
"({0}, {1}, {2}, {3}, {4}",
|
|
|
|
|
reader.GetString(0),
|
|
|
|
|
reader.GetString(1),
|
|
|
|
|
reader.GetString(2),
|
|
|
|
|
reader.GetString(3),
|
|
|
|
|
reader.GetString(4)
|
|
|
|
|
/*reader.GetString(5)*/
|
|
|
|
|
/*reader.GetInt32(2).ToString()*/
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
foreach (var EltInscrit in reader)
|
|
|
|
|
{
|
|
|
|
|
ListeInscrits.Add(new(reader.GetString(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4)));
|
|
|
|
|
ListeInscrits.Add(new(reader.GetString(0), reader.GetString(1), reader.GetString(3), reader.GetString(2), reader.GetString(4)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
reader.Close();
|
|
|
|
|
|
|
|
|
|
return ListeInscrits;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*Revoir la BDD, probleme de clé étrangère de devise*/
|
|
|
|
|
public async void SupprimerInscritBdd(Inscrit i)
|
|
|
|
|
{
|
|
|
|
|
/*List<Inscrit> ListeInscrits = new List<Inscrit>(LoadInscrit());*/
|
|
|
|
|
|
|
|
|
|
var conn = new NpgsqlConnection(connString);
|
|
|
|
|
Console.Out.WriteLine("Ouverture de la connection");
|
|
|
|
|
conn.Open();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string requete = $"DELETE FROM INSCRIT WHERE id=(@p)";
|
|
|
|
|
string requeteFKey = $"DELETE FROM DEVISE WHERE id=(@p2)";
|
|
|
|
|
|
|
|
|
|
using (var command1 = new NpgsqlCommand(requeteFKey, conn))
|
|
|
|
|
{
|
|
|
|
|
command1.Parameters.AddWithValue("p2", i.Dev);
|
|
|
|
|
await command1.ExecuteNonQueryAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using (var command = new NpgsqlCommand(requete, conn))
|
|
|
|
|
{
|
|
|
|
|
command.Parameters.AddWithValue("p", i.Id);
|
|
|
|
|
await command.ExecuteNonQueryAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ListeInscrits;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|