Celine.meneu 16 years ago
parent
commit
0b6288f3eb

+ 4 - 2
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotChiffresSignificatifs.cs

@@ -36,6 +36,7 @@ namespace CG67.FicheCollege.Entrepot
                         //    }
                         //}
                         command.CommandText = "SELECT sum(MontantSubvention) as totalSubvention FROM Etablissement_ActionEducative WHERE Etablissement_ActionEducative.Annee = @Annee";
+
                         sum = command.ExecuteScalar().ToString();
                         resultat.MontantTotalFinancements =  string.IsNullOrEmpty(sum) ? 0 : System.Convert.ToDouble(sum);
                         //using (SqlDataReader dr2 = command.ExecuteReader())
@@ -46,8 +47,9 @@ namespace CG67.FicheCollege.Entrepot
                         //    }
                         //}
                         //command.CommandText = "SELECT sum(TotalEleves) as totalEleves FROM Effectif WHERE Effectif.Annee = @Annee";
-                        command.CommandText ="SELECT Sum(EffectifTotal.EffectifTotal) AS SommeDeEffectifTotal FROM EffectifTotal GROUP BY EffectifTotal.Annee HAVING (((EffectifTotal.Annee)=@Annee))";
-
+                        //command.CommandText ="SELECT Sum(EffectifTotal.EffectifTotal) AS SommeDeEffectifTotal FROM EffectifTotal GROUP BY EffectifTotal.Annee HAVING (((EffectifTotal.Annee)=@Annee) AND (Typedonnees='R'))";
+                        command.CommandText = "SELECT Sum(EffectifTotal.EffectifTotal) AS SommeDeEffectifTotal FROM EffectifTotal WHERE Annee = @Annee AND Typedonnees = 'R'";
+                        command.Parameters.AddWithValue("@Annee", annee);
                         sum = command.ExecuteScalar().ToString();
                         resultat.NbTotalEleves = string.IsNullOrEmpty(sum) ? (Int32) 0 : Convert.ToInt32 (sum);