|
|
@@ -52,7 +52,7 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
Etablissement resultat = null;
|
|
|
using (SqlConnection connexion = new SqlConnection(this.ChaineDeConnexion))
|
|
|
{
|
|
|
- //try
|
|
|
+ try
|
|
|
{
|
|
|
connexion.Open();
|
|
|
using (SqlCommand command = connexion.CreateCommand())
|
|
|
@@ -64,9 +64,20 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
{
|
|
|
if (dr.Read())
|
|
|
{
|
|
|
- string adresse = dr["NumRue"].ToString() + ", " + dr["TypeDeVoie"].ToString() + " " + dr["Voie"].ToString();
|
|
|
-
|
|
|
- resultat = new Etablissement(codeRNE, annee, dr["NomCollege"].ToString(),
|
|
|
+ string adresse;
|
|
|
+ if (dr["NumRue"].ToString()!="")
|
|
|
+ {
|
|
|
+ adresse = dr["NumRue"].ToString() + ", " + dr["TypeDeVoie"].ToString() + " " + dr["Voie"].ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ adresse = dr["TypeDeVoie"].ToString() + " " + dr["Voie"].ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ resultat = new Etablissement(codeRNE, annee, dr["NomCollege"].ToString(),
|
|
|
dr["TypeEtablissement"].ToString(), Convert.ToInt16(dr["AnneeConstruction"].ToString()),
|
|
|
dr["Telephone"].ToString(), dr["Email"].ToString(), dr["Fax"].ToString(),
|
|
|
dr["NomPropriétaire"].ToString(), adresse, dr["ComplementAdresse"].ToString(),
|
|
|
@@ -121,8 +132,9 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- command.CommandText = "SELECT Annee, TypeDonnees,EffectifTotal FROM EffectifTotal WHERE CodeRNE = @RNE AND Annee > @AnneeMoins10 ORDER BY Annee ASC";
|
|
|
+ command.CommandText = "SELECT Annee, TypeDonnees,EffectifTotal FROM EffectifTotal WHERE CodeRNE = @RNE AND TypeClasses = @typeclasses AND Annee > @AnneeMoins10 ORDER BY Annee ASC";
|
|
|
command.Parameters.AddWithValue("@AnneeMoins10", annee - 10);
|
|
|
+ command.Parameters.AddWithValue("@typeclasses", "Normal");
|
|
|
using (SqlDataReader dr4 = command.ExecuteReader())
|
|
|
{
|
|
|
resultat.LstEffectif = new List<Effectif>();
|
|
|
@@ -181,15 +193,15 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- //catch
|
|
|
- //{
|
|
|
- // throw;
|
|
|
- //}
|
|
|
- //finally
|
|
|
- //{
|
|
|
- // if (connexion.State == ConnectionState.Open)
|
|
|
- // connexion.Close();
|
|
|
- //}
|
|
|
+ catch
|
|
|
+ {
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ if (connexion.State == ConnectionState.Open)
|
|
|
+ connexion.Close();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|