Celine.meneu 16 rokov pred
rodič
commit
b5e26f0e86

+ 1 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/CG67.FicheCollege.Domaine.csproj

@@ -45,6 +45,7 @@
     <Compile Include="Commentaires.cs" />
     <Compile Include="ContratAide.cs" />
     <Compile Include="Effectif.cs" />
+    <Compile Include="EffectifDetail.cs" />
     <Compile Include="Equipement.cs" />
     <Compile Include="Etablissement.cs" />
     <Compile Include="Contact.cs" />

+ 41 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/EffectifDetail.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace CG67.FicheCollege.Domaine
+{
+    public class EffectifDetail
+    {
+        private int mAnnee;
+
+        public int Annee
+        {
+            get { return mAnnee; }
+            set { mAnnee = value; }
+        }
+
+        private string mFiliere;
+
+        public string Filiere
+        {
+            get { return mFiliere; }
+            set { mFiliere = value; }
+        }
+        private int mEffectifDetail;
+
+        public int DetailEffectif
+        {
+            get { return mEffectifDetail; }
+            set { mEffectifDetail = value; }
+        }
+
+        public EffectifDetail(int annee, string filiere, int effectifDetail)
+        {
+            this.mAnnee = annee;
+            this.mFiliere = filiere;
+            this.mEffectifDetail = effectifDetail;
+        }
+	
+    }
+    }
+

+ 25 - 1
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/Etablissement.cs

@@ -17,6 +17,7 @@ namespace CG67.FicheCollege.Domaine
     public delegate Dotation dlgLoadDotation(string codeRNE, int annee);
     public delegate IList<Equipement> dlgLoadEquipement(string codeRNE, int annee);
     public delegate IList<Investissement> dlgLoadInvestissement(string codeRNE, int annee);
+    public delegate IList<EffectifDetail> dlgLoadEffectifDetail(string codeRNE, int annee);
     public delegate MCG dlgLoadMCG(string codeRNE);
     public delegate Logement dlgLoadLogement(string codeRNE);
     public delegate IList<ProgTravaux> dlgLoadProgTravaux(string codeRNE, int annee);
@@ -39,6 +40,7 @@ namespace CG67.FicheCollege.Domaine
         private dlgLoadDotation LoaderDotation;
         private dlgLoadEquipement LoaderEquipement;
         private dlgLoadInvestissement LoaderInvestissement;
+        private dlgLoadEffectifDetail LoaderEffectifDetail;
         private dlgLoadMCG LoaderMCG;
         private dlgLoadLogement LoaderLogement;
         private dlgLoadProgTravaux LoaderProgTravaux;
@@ -115,6 +117,9 @@ namespace CG67.FicheCollege.Domaine
         /// IListe des investissements de l'établissement.
         /// </summary>
         private IList<Investissement> mLstInvestissement;
+        /// IListe des effectifs SEGPA l'établissement.
+        /// </summary>
+        private IList<EffectifDetail> mLstEffectifDetail;
         /// <summary>
         /// IListe du  nombre d'effectif collégien sur les 10 dernières années
         /// </summary>
@@ -374,6 +379,23 @@ namespace CG67.FicheCollege.Domaine
             }
             set { mLstInvestissement = value; }
         }
+
+
+        /// <summary>
+        /// liste des effectifs de SEGPA, CLA , UPI
+        /// </summary>
+        public IList<EffectifDetail> LstEffectifDetail
+        {
+            get
+            {
+                if (mLstEffectifDetail == null)
+                    mLstEffectifDetail = this.LoaderEffectifDetail(mCodeRNE, mAnnee);
+                return mLstEffectifDetail;
+            }
+            set { mLstEffectifDetail = value; }
+        }
+
+
         /// <summary>
         /// Obtient ou définit la IListe du  nombre d'effectif collégien sur les 10 dernières années
         /// </summary>
@@ -984,7 +1006,8 @@ namespace CG67.FicheCollege.Domaine
                                 dlgLoadContact loaderContact,
                                 dlgLoadDotation loaderDotation,
                                 dlgLoadEquipement loaderEquipement, 
-                                dlgLoadInvestissement loaderInvestissement, 
+                                dlgLoadInvestissement loaderInvestissement,
+                                dlgLoadEffectifDetail loaderEffectifDetail, 
                                 dlgLoadMCG loaderMCG, dlgLoadLogement loaderLogement,
                                 dlgLoadProgTravaux loaderProgTravaux, 
                                 dlgLoadProjetPilote loaderProjetPilote, 
@@ -1017,6 +1040,7 @@ namespace CG67.FicheCollege.Domaine
             this.LoaderDotation = loaderDotation;
             this.LoaderEquipement = loaderEquipement;
             this.LoaderInvestissement = loaderInvestissement;
+            this.LoaderEffectifDetail = loaderEffectifDetail;
             this.LoaderMCG = loaderMCG;
             this.LoaderLogement = loaderLogement;
             this.LoaderProgTravaux = loaderProgTravaux;

+ 1 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/CG67.FicheCollege.Entrepot.csproj

@@ -49,6 +49,7 @@
     <Compile Include="EntrepotContact.cs" />
     <Compile Include="EntrepotContratAide.cs" />
     <Compile Include="EntrepotDotation.cs" />
+    <Compile Include="EntrepotEffectifDetail.cs" />
     <Compile Include="EntrepotEquipement.cs" />
     <Compile Include="EntrepotEtablissement.cs" />
     <Compile Include="EntrepotFactory.cs" />

+ 53 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotEffectifDetail.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+using System.Data.SqlClient;
+using CG67.FicheCollege.Domaine;
+using CG67.FicheCollege.Interface;
+
+
+namespace CG67.FicheCollege.Entrepot
+{
+    class EntrepotEffectifDetail: EntrepotBase, IEntrepotEffectifDetail
+    {
+        public IList<EffectifDetail> GetByCodeRNEAndAnnee(string codeRNE, int annee)
+        {
+            IList<EffectifDetail> resultat = new List<EffectifDetail>();
+            using (SqlConnection connexion = new SqlConnection(this.ChaineDeConnexion))
+            {
+                try
+                {
+                    connexion.Open();
+                    using (SqlCommand command = connexion.CreateCommand())
+                    {
+                        //On récupère les effectifs détaillés pour les classes de SEGPA, CLA, UPI
+                        command.CommandText = "Select annee, filiere, Sum(TotalEleves) As SomEleves from Effectif GROUP BY  CodeRNE, Annee, Filiere HAVING CodeRNE = @RNE AND Annee = @Annee ";
+                        command.Parameters.AddWithValue("@RNE", codeRNE);
+                        command.Parameters.AddWithValue("@Annee", annee);
+                        using (SqlDataReader dr = command.ExecuteReader())
+                        {
+                            while (dr.Read())
+                            {
+                                resultat.Add(new EffectifDetail(Convert.ToInt16(dr["Annee"].ToString()), dr["Filiere"].ToString(), Convert.ToInt16(dr["TotalEleves"].ToString())));
+                            }
+                        }
+                    }
+                }
+                catch (Exception erreurInterne)
+                {
+                    throw new Exception(" " + erreurInterne);
+                }
+                finally
+                {
+                    if (connexion.State == ConnectionState.Open)
+                        connexion.Close();
+                }
+            }
+            return resultat;
+        }
+    }
+}
+
+       
+ 

+ 1 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotEtablissement.cs

@@ -93,6 +93,7 @@ namespace CG67.FicheCollege.Entrepot
                                  EntrepotFactory.GetEntrepotDotation().GetByCodeRNEAndAnnee,
                                  EntrepotFactory.GetEntrepotEquipement().GetByCodeRNEAndAnnee,
                                  EntrepotFactory.GetEntrepotInvestissement().GetByCodeRNEAndAnnee,
+                                 EntrepotFactory.GetEntrepotEffectifDetail().GetByCodeRNEAndAnnee,
                                  EntrepotFactory.GetEntrepotMCG().GetByCodeRNE,
                                  EntrepotFactory.GetEntrepotLogement().GetByCodeRNE,
                                  EntrepotFactory.GetEntrepotProgTravaux().GetByCodeRNEAndAnnee,

+ 9 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotFactory.cs

@@ -74,6 +74,15 @@ namespace CG67.FicheCollege.Entrepot
             return entrepotInvestissement;
         }
 
+        private static IEntrepotEffectifDetail entrepotEffectifDetail;
+        public static IEntrepotEffectifDetail GetEntrepotEffectifDetail()
+        {
+            if (entrepotEffectifDetail == null)
+                entrepotEffectifDetail = new EntrepotEffectifDetail();
+            return entrepotEffectifDetail;
+        }
+
+
         private static IEntrepotLogement entrepotLogement;
         public static IEntrepotLogement GetEntrepotLogement()
         {

+ 1 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Interface/CG67.FicheCollege.Interface.csproj

@@ -46,6 +46,7 @@
     <Compile Include="IEntrepotContact.cs" />
     <Compile Include="IEntrepotContratAide.cs" />
     <Compile Include="IEntrepotDotation.cs" />
+    <Compile Include="IEntrepotEffectifDetail.cs" />
     <Compile Include="IEntrepotEquipement.cs" />
     <Compile Include="IEntrepotEtablissement.cs" />
     <Compile Include="IEntrepotInvestissement.cs" />

+ 12 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Interface/IEntrepotEffectifDetail.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using CG67.FicheCollege.Domaine;
+
+namespace CG67.FicheCollege.Interface
+{
+    public interface IEntrepotEffectifDetail
+    {
+        IList<EffectifDetail> GetByCodeRNEAndAnnee(string codeRNE, int annee);
+    }
+}

+ 13 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Service/ServiceFiche.cs

@@ -108,6 +108,19 @@ namespace CG67.FicheCollege.Service
                 throw new Exception(erreur.ToString());
             }
         }
+
+        public static IList<EffectifDetail> GetEffectifDetailByCodeRNEAndAnnee(string codeRNE, int annee)
+         {
+        try
+            {
+                return EntrepotFactory.GetEntrepotEffectifDetail().GetByCodeRNEAndAnnee(codeRNE, annee);
+            }
+            catch (Exception erreur)
+            {
+                throw new Exception(erreur.ToString());
+            }
+
+    }
         public static Logement GetLogementByRNE(string codeRNE)
         {
             try

+ 10 - 1
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/css/fichecollege.css

@@ -154,7 +154,16 @@ body
 {
 	width:80px;
 }
-
+.filiere
+{
+	width:150px;
+	 text-align: right;	
+}
+.effectif
+{
+	width:150px;
+	 text-align: right;	
+}
 h2
 {
 	background-color: #ffd700;

+ 35 - 8
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/xslt/FicheCollege.xslt

@@ -129,9 +129,32 @@
       </tr>
       <tr>
         <td>Effectifs</td>
-        <td>
-          <xsl:value-of select="Etablissement/Effectif"/>
-        </td>
+        <xsl:if test="count(Etablissement/LstEffectifDetail/child::*)=0">
+          <td>
+            <xsl:value-of select="Etablissement/Effectif"/>
+          </td>
+        </xsl:if>
+        <xsl:if test="count(Etablissement/LstEffectifDetail/child::*)!=0">
+          <td>
+            <table>
+              <colgroup>
+                <col class="filiere"></col>
+                <col class="effectif"></col>
+              </colgroup>
+              <xsl:for-each select="Etablissement/LstEffectifDetail/EffectifDetail">
+                <tr>
+                  <td>
+                    <xsl:value-of select="Filiere"/>
+                  </td>
+                  <td>
+                    <xsl:value-of select="DetailEffectif"/>
+                  </td>
+                </tr>
+              </xsl:for-each>
+            </table>
+          </td>
+        </xsl:if>  
+        
       </tr>
       <tr>
         <td>Restauration
@@ -438,7 +461,7 @@
         <table id="sansbordurecentre">
           <br></br>
         <tr>
-          <h3>Effectifs réels et prévisionnels - hors SEGPA, UPI, CLA, DIMA, 4e dispo aménagée ou 3e insertion</h3>
+          <h3>Effectifs réels et prévisionnels - inclus SEGPA, UPI, CLA, DIMA, 4e dispo aménagée ou 3e insertion</h3>
         </tr>
                 <td colspan="2" id="graphique">
           <xsl:apply-templates select="Etablissement/LstEffectif"/>
@@ -463,6 +486,7 @@
         <col class="libelle"></col>
         <col class="information"></col>
       </colgroup>
+      <!--
       <tr>
         <td>Equipement en mobilier et matériel</td>
         <td>
@@ -475,6 +499,7 @@
           </ul>
         </td>
       </tr>
+      -->
       <tr>
         <td>Dotation annuelle de fonctionnement</td>
         <td>
@@ -565,10 +590,12 @@
         <td>Fonctionnement hors dotation annuelle DCE</td>
         <td></td>
       </tr>
+       <!--
+
       <tr>
         <td>Investissement sur 5 ans</td>
         <td>
-         <!--
+      
           <xsl:if test ="count(Etablissement/LstInvestissement/Investissement)>0">
           <table>
             <xsl:for-each select="Etablissement/LstInvestissement/Investissement">
@@ -581,17 +608,17 @@
            
           </table>
           </xsl:if>
-         -->
+       
         </td>
       </tr>
+        
       <tr>
         <td>Etat des réserves du collège</td>
         <td>          
           <xsl:value-of select="format-number(Etablissement/Reserve,'###.###.##0','europe')"/><xsl:text> €</xsl:text>
         </td>        
       </tr>
-      <!--
-      <tr>
+         <tr>
         <td>Interventions remarquables du département sur les 5 dernières années</td>
         <td></td>
       </tr>