|
|
@@ -28,13 +28,15 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
connexion.Open();
|
|
|
using (SqlCommand command = connexion.CreateCommand())
|
|
|
{
|
|
|
- command.CommandText = "SELECT * FROM Contact WHERE CodeRNE = @RNE";
|
|
|
+
|
|
|
+// command.CommandText = "SELECT * FROM Contact WHERE CodeRNE = @RNE";
|
|
|
+ command.CommandText = "SELECT * FROM Contact INNER JOIN Fonction ON Contact.IdFonction = Fonction.Id WHERE (CodeRNE = @RNE)";
|
|
|
command.Parameters.AddWithValue("@RNE", codeRNE);
|
|
|
using (SqlDataReader dr = command.ExecuteReader())
|
|
|
{
|
|
|
while (dr.Read())
|
|
|
{
|
|
|
- resultat.Add(new Contact(dr["Civilite"].ToString(), dr["Nom"].ToString(), dr["Prenom"].ToString(), dr["Fonction"].ToString(),dr["TypeContact"].ToString()));
|
|
|
+ resultat.Add(new Contact(dr["Civilite"].ToString(), dr["Nom"].ToString(), dr["Prenom"].ToString(), dr["Libelle"].ToString(),dr["TypeContact"].ToString()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -62,13 +64,14 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
connexion.Open();
|
|
|
using (SqlCommand command = connexion.CreateCommand())
|
|
|
{
|
|
|
- command.CommandText = "SELECT * FROM Contact WHERE id = (select idConseillerGeneral from etablissement where codeRNE=@RNE)";
|
|
|
+ //command.CommandText = "SELECT * FROM Contact WHERE id = (select idConseillerGeneral from etablissement where codeRNE=@RNE)";
|
|
|
+ command.CommandText = "SELECT * FROM Contact, Fonction WHERE (IdFonction = Fonction.Id) and Contact.id = (select idConseillerGeneral from etablissement where codeRNE=@RNE)";
|
|
|
command.Parameters.AddWithValue("@RNE", codeRNE);
|
|
|
using (SqlDataReader dr = command.ExecuteReader())
|
|
|
{
|
|
|
if (dr.Read())
|
|
|
{
|
|
|
- resultat = new Contact(dr["Civilite"].ToString(), dr["Nom"].ToString(), dr["Prenom"].ToString(), dr["Fonction"].ToString(), dr["TypeContact"].ToString());
|
|
|
+ resultat = new Contact(dr["Civilite"].ToString(), dr["Nom"].ToString(), dr["Prenom"].ToString(), dr["Libelle"].ToString(), dr["TypeContact"].ToString());
|
|
|
}
|
|
|
}
|
|
|
}
|