|
|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
|
using System.Text;
|
|
|
using System.Data;
|
|
|
using System.Data.SqlClient;
|
|
|
+using System.Data.OracleClient;
|
|
|
using CG67.FicheCollege.Domaine;
|
|
|
using CG67.FicheCollege.Interface;
|
|
|
|
|
|
@@ -11,9 +12,9 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
public class EntrepotClasseDecouverte : EntrepotBase, IEntrepotClasseDecouverte
|
|
|
{
|
|
|
|
|
|
- public ClasseDecouverte GetByCodeRNEAndAnnee(string codeRNE, int annee)
|
|
|
+ public IList<ClasseDecouverte> GetByCodeRNEAndAnnee(string codeRNE, int annee)
|
|
|
{
|
|
|
- ClasseDecouverte resultat = new ClasseDecouverte();
|
|
|
+ IList<ClasseDecouverte> resultat = new List<ClasseDecouverte>();
|
|
|
string codeAstre = "";
|
|
|
using (SqlConnection connexion1 = new SqlConnection(this.ChaineDeConnexion))
|
|
|
{
|
|
|
@@ -21,11 +22,11 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
try
|
|
|
{
|
|
|
connexion1.Open();
|
|
|
- using (SqlCommand command = connexion1.CreateCommand())
|
|
|
+ using (SqlCommand command1 = connexion1.CreateCommand())
|
|
|
{
|
|
|
- command.CommandText = "Select NumeroTiersAstreGF from Etablissement WHERE CodeRNE = @RNE";
|
|
|
- command.Parameters.AddWithValue("@RNE", codeRNE);
|
|
|
- using (SqlDataReader dr = command.ExecuteReader())
|
|
|
+ command1.CommandText = "Select NumeroTiersAstreGF from Etablissement WHERE CodeRNE = @RNE";
|
|
|
+ command1.Parameters.AddWithValue("@RNE", codeRNE);
|
|
|
+ using (SqlDataReader dr = command1.ExecuteReader())
|
|
|
{
|
|
|
if (dr.Read())
|
|
|
codeAstre = dr["NumeroTiersAstreGF"].ToString();
|
|
|
@@ -42,21 +43,21 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
connexion1.Close();
|
|
|
}
|
|
|
|
|
|
- using (SqlConnection connexion = new SqlConnection(this.ChaineDeConnexionSubvention))
|
|
|
+ using (OracleConnection connexion = new OracleConnection(this.ChaineDeConnexionSubvention))
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
connexion.Open();
|
|
|
- using (SqlCommand command = connexion.CreateCommand())
|
|
|
+ using (OracleCommand command = connexion.CreateCommand())
|
|
|
{
|
|
|
- command.CommandText = "Select * from ASTRE_W67_SIC_FICHE_ELU WHERE CodeRNE = @RNE";
|
|
|
+ command.CommandText = "Select * from ASTRE.W67_SIC_FICHE_ELU WHERE CodeRNE = @RNE AND ANNEE = @ANNEE";
|
|
|
command.Parameters.AddWithValue("@RNE", codeAstre);
|
|
|
- using (SqlDataReader dr = command.ExecuteReader())
|
|
|
+ using (OracleDataReader dr = command.ExecuteReader())
|
|
|
{
|
|
|
|
|
|
while (dr.Read())
|
|
|
{
|
|
|
- resultat= new ClasseDecouverte(dr["annee"].ToString(), dr["ZONE"].ToString(), dr["NB_ELEVE"].ToString(), Convert.ToDouble(dr["MT_VOTE"].ToString()));
|
|
|
+ resultat.Add(new ClasseDecouverte(dr["annee"].ToString(), dr["ZONE"].ToString(), dr["NB_ELEVE"].ToString(), Convert.ToDouble(dr["MT_VOTE"].ToString())));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -76,16 +77,7 @@ namespace CG67.FicheCollege.Entrepot
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- #region IEntrepotClasseDecouverte Membres
|
|
|
-
|
|
|
- ClasseDecouverte IEntrepotClasseDecouverte.GetByCodeRNEAndAnnee(string codeRNE, int annee)
|
|
|
- {
|
|
|
- throw new Exception("The method or operation is not implemented.");
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|