Celine.meneu 16 years ago
parent
commit
d721f695dd

+ 2 - 2
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotClasseDecouverte.cs

@@ -51,10 +51,10 @@ namespace CG67.FicheCollege.Entrepot
                         connexion.Open();
                         using (OracleCommand command = connexion.CreateCommand())
                         {
-                            command.CommandText = "Select ZONE, ANNEE, Sum(TO_NUMBER(NB_ELEVE)) as NBELEVES, Sum(MT_VOTE) AS SUBVENTION from ASTRE.W67_SIC_FICHE_ELU WHERE ANNEE = '2009' GROUP BY ZONE, ANNEE ORDER BY ZONE" ;
+                            command.CommandText = "Select ANNEE, ZONE, Sum(TO_NUMBER(NB_ELEVE)) as NBELEVES, Sum(MT_VOTE) AS SUBVENTION from ASTRE.W67_SIC_FICHE_ELU WHERE ANNEE = '2009' GROUP BY ZONE, ANNEE ORDER BY ZONE ";
                           //  WHERE COD_TIERS = @RNE AND ANNEE = @ANNEE";
                              // command.Parameters.AddWithValue("@RNE", codeAstre);
-                           //  command.Parameters.AddWithValue("@ANNEE", annee.ToString());
+                          //  command.Parameters.AddWithValue("@ANNEE", annee.ToString());
                             using (OracleDataReader ds = command.ExecuteReader())
                             {
 

+ 8 - 4
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotEtablissement.cs

@@ -201,10 +201,14 @@ namespace CG67.FicheCollege.Entrepot
                     connexion.Open();
                     using (SqlCommand command = connexion.CreateCommand())
                     {
-                        command.CommandText= "select SUM(superficie) from dbo.salle where codeRNE =@RNE  and typeValeur= 'm2'";
-                        command.Parameters.AddWithValue("@rne", codeRNE);
-                        string sum = command.ExecuteScalar().ToString();
-                        resultat.Surface = string.IsNullOrEmpty(sum) ? 0 : Convert.ToDouble(sum);
+                        command.CommandText= "select superficie from dbo.Surface where codeRNE =@RNE AND ANNEE = @ANNEE ";
+                        command.Parameters.AddWithValue("@RNE", codeRNE);
+                        command.Parameters.AddWithValue("@ANNEE", annee);
+                        using (SqlDataReader dr9 = command.ExecuteReader())
+                        if (dr9.Read())
+                         {
+                           resultat.Surface = Convert.ToDouble(dr9["superficie"].ToString());
+                         }
                     }
                 }
                 catch