Celine.meneu 16 роки тому
батько
коміт
4bcd0ea131

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

@@ -46,7 +46,7 @@
     <Compile Include="ContratAide.cs" />
     <Compile Include="Effectif.cs" />
     <Compile Include="EffectifDetail.cs" />
-    <Compile Include="Equipement.cs" />
+    <Compile Include="InvestissementDCE.cs" />
     <Compile Include="Etablissement.cs" />
     <Compile Include="Contact.cs" />
     <Compile Include="Dotation.cs" />

+ 10 - 10
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/Etablissement.cs

@@ -15,7 +15,7 @@ namespace CG67.FicheCollege.Domaine
     public delegate Commentaires dlgLoadCommentaires(string codeRNE, int annee);
     public delegate IList<Contact> dlgLoadContact(string codeRNE);
     public delegate Dotation dlgLoadDotation(string codeRNE, int annee);
-    public delegate IList<Equipement> dlgLoadEquipement(string codeRNE, int annee);
+    public delegate IList<InvestissementDCE> dlgLoadInvestissementDCE(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);
@@ -38,7 +38,7 @@ namespace CG67.FicheCollege.Domaine
         private dlgLoadCommentaires LoaderCommentaires;
         private dlgLoadContact LoaderContact;
         private dlgLoadDotation LoaderDotation;
-        private dlgLoadEquipement LoaderEquipement;
+        private dlgLoadInvestissementDCE LoaderInvestissementDCE;
         private dlgLoadInvestissement LoaderInvestissement;
         private dlgLoadEffectifDetail LoaderEffectifDetail;
         private dlgLoadMCG LoaderMCG;
@@ -156,7 +156,7 @@ namespace CG67.FicheCollege.Domaine
         /// <summary>
         /// IListe des équipements
         /// </summary>
-        private IList<Equipement> mLstEquipements;
+        private IList<InvestissementDCE> mLstInvestissementDCE;
         /// <summary>
         /// Le(s) secteur(s) de recrutement de l'établissement.
         /// </summary>
@@ -486,15 +486,15 @@ namespace CG67.FicheCollege.Domaine
         /// <summary>
         /// Obtient ou définit la IListe des équipements obtenus.
         /// </summary>
-        public IList<Equipement> LstEquipements
+        public IList<InvestissementDCE> LstInvestissementDCE
         {
             get
             {
-                if (mLstEquipements == null)
-                    mLstEquipements = this.LoaderEquipement(mCodeRNE, mAnnee); 
-                return mLstEquipements;
+                if (mLstInvestissementDCE == null)
+                    mLstInvestissementDCE = this.LoaderInvestissementDCE(mCodeRNE, mAnnee);
+                return mLstInvestissementDCE;
             }
-            set { mLstEquipements = value; }
+            set { mLstInvestissementDCE = value; }
         }
         /// <summary>
         /// Obtient ou définit le(s) secteur(s) de recrutement de l'établissement.
@@ -1005,7 +1005,7 @@ namespace CG67.FicheCollege.Domaine
                                 dlgLoadCommentaires loaderCommentaires,
                                 dlgLoadContact loaderContact,
                                 dlgLoadDotation loaderDotation,
-                                dlgLoadEquipement loaderEquipement, 
+                                dlgLoadInvestissementDCE loaderInvestissementDCE, 
                                 dlgLoadInvestissement loaderInvestissement,
                                 dlgLoadEffectifDetail loaderEffectifDetail, 
                                 dlgLoadMCG loaderMCG, dlgLoadLogement loaderLogement,
@@ -1038,7 +1038,7 @@ namespace CG67.FicheCollege.Domaine
             this.LoaderCommentaires = loaderCommentaires;
             this.LoaderContact = loaderContact;
             this.LoaderDotation = loaderDotation;
-            this.LoaderEquipement = loaderEquipement;
+            this.LoaderInvestissementDCE = loaderInvestissementDCE;
             this.LoaderInvestissement = loaderInvestissement;
             this.LoaderEffectifDetail = loaderEffectifDetail;
             this.LoaderMCG = loaderMCG;

+ 9 - 8
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/InvestissementDCE.cs

@@ -8,7 +8,7 @@ namespace CG67.FicheCollege.Domaine
     /// Equipement Mobilier et matériel
     /// </summary>
     [Serializable]
-    public class Equipement
+    public class InvestissementDCE
     {
         /// <summary>
         /// Description de l'achat
@@ -19,9 +19,9 @@ namespace CG67.FicheCollege.Domaine
         /// </summary>
         private double mMontant;
         /// <summary>
-        /// Booléen permettant de déterminer si l'achat est de type informatique ou non
+        /// Année
         /// </summary>
-        private Boolean mInformatique;
+        private int mAnnee;
 
         /// <summary>
         /// Obtient ou définit la description de l'achat
@@ -42,10 +42,10 @@ namespace CG67.FicheCollege.Domaine
         /// <summary>
         /// Obtient ou définit le booléen permettant de déterminer si l'achat est de type informatique ou non
         /// </summary>
-        public Boolean Informatique
+        public int Annee
         {
-            get { return mInformatique; }
-            set { mInformatique = value; }
+            get { return mAnnee; }
+            set { mAnnee = value; }
         }
 
         public string phrase
@@ -56,11 +56,12 @@ namespace CG67.FicheCollege.Domaine
             }
         }
 
-        public Equipement(string libelle, double montant, Boolean informatique)
+        public InvestissementDCE(int annee, string libelle, double montant)
         {
+            this.mAnnee = annee;
             this.mLibelle = libelle;
             this.mMontant = montant;
-            this.mInformatique = informatique;
+            
         }
     
     }

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

@@ -50,7 +50,7 @@
     <Compile Include="EntrepotContratAide.cs" />
     <Compile Include="EntrepotDotation.cs" />
     <Compile Include="EntrepotEffectifDetail.cs" />
-    <Compile Include="EntrepotEquipement.cs" />
+    <Compile Include="EntrepotInvestissementDCE.cs" />
     <Compile Include="EntrepotEtablissement.cs" />
     <Compile Include="EntrepotFactory.cs" />
     <Compile Include="EntrepotInvestissement.cs" />

+ 3 - 3
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotFactory.cs

@@ -58,11 +58,11 @@ namespace CG67.FicheCollege.Entrepot
             return entrepotDotation;
         }
 
-        private static IEntrepotEquipement entrepotEquipement;
-        public static IEntrepotEquipement GetEntrepotEquipement()
+        private static IEntrepotInvestissementDCE entrepotEquipement;
+        public static IEntrepotInvestissementDCE GetEntrepotEquipement()
         {
             if (entrepotEquipement == null)
-                entrepotEquipement = new EntrepotEquipement();
+                entrepotEquipement = new EntrepotInvestissementDCE();
             return entrepotEquipement;
         }
 

+ 49 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotInvestissementDCE.cs

@@ -0,0 +1,49 @@
+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
+{
+    public class EntrepotInvestissementDCE : EntrepotBase, IEntrepotInvestissementDCE
+    {
+        public IList<InvestissementDCE> GetByCodeRNEAndAnnee(string codeRNE, int annee)
+        {
+            IList<InvestissementDCE> resultat = new List<InvestissementDCE>();
+            using (SqlConnection connexion = new SqlConnection(this.ChaineDeConnexion))
+            {
+                try
+                {
+                    connexion.Open();
+                    using (SqlCommand command = connexion.CreateCommand())
+                    {
+                        command.CommandText = "Select Annee, Libelle, Montant from Investissement INNER JOIN TypeDotation ON Investissement.IdDotation = TypeDotation.id WHERE CodeRNE = @RNE AND Annee = @Annee ORDER BY Libelle ASC";
+                        command.Parameters.AddWithValue("@RNE", codeRNE);
+                        command.Parameters.AddWithValue("@Annee", annee);
+                        using (SqlDataReader dr = command.ExecuteReader())
+                        {
+                            while (dr.Read())
+                            {
+                                resultat.Add(new InvestissementDCE(Convert.ToInt16(dr["Annee"].ToString()), dr["Libelle"].ToString(),Convert.ToDouble(dr["Montant"].ToString())));
+                            }
+                        }
+                    }
+                }
+                catch
+                {
+                    throw;
+                }
+                finally
+                {
+                    if (connexion.State == ConnectionState.Open)
+                        connexion.Close();
+                }
+            }
+
+            return resultat;
+        }
+    }
+}

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

@@ -47,7 +47,7 @@
     <Compile Include="IEntrepotContratAide.cs" />
     <Compile Include="IEntrepotDotation.cs" />
     <Compile Include="IEntrepotEffectifDetail.cs" />
-    <Compile Include="IEntrepotEquipement.cs" />
+    <Compile Include="IEntrepotInvestissementDCE.cs" />
     <Compile Include="IEntrepotEtablissement.cs" />
     <Compile Include="IEntrepotInvestissement.cs" />
     <Compile Include="IEntrepotLogement.cs" />

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

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

+ 1 - 1
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Service/ServiceFiche.cs

@@ -86,7 +86,7 @@ namespace CG67.FicheCollege.Service
                 throw new Exception(erreur.ToString());
             }
         }
-        public static IList<Equipement> GetEquipementByRNEAndAnnee(string codeRNE, int annee)
+        public static IList<InvestissementDCE> GetEquipementByRNEAndAnnee(string codeRNE, int annee)
         {
             try
             {

+ 16 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/css/fichecollege.css

@@ -29,6 +29,22 @@ body
 {
 	width: 300px;
 }
+.libInv
+{
+	width: 320px;
+}
+
+.totaleffectif
+{
+	width: 50px;
+	text-align:right;
+}
+
+.nombre
+{
+	width: 80px;
+	text-align:right;
+}
 .classe
 {
 	width: 200px;

+ 41 - 13
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/xslt/FicheCollege.xslt

@@ -138,26 +138,23 @@
           <td>
             <table>
               <colgroup>
-                <col class="filiere"></col>
-                <col class="effectif"></col>
+                <col class="titre"></col>
+                <col class="totaleffectif"></col>
               </colgroup>
-              <tr>
-                <th class="bordurecentre">Section</th>
-                <th class="bordurecentre">Nb élèves</th>
-               </tr>
-              <xsl:for-each select="Etablissement/LstEffectifDetail/EffectifDetail">
+                <xsl:for-each select="Etablissement/LstEffectifDetail/EffectifDetail">
                 <tr>
-                  <td>
+                  <td class="sansbordure">
                     <xsl:value-of select="Filiere"/>
                   </td>
-                  <td>
+                  <td class="sansbordure">
                     <xsl:value-of select="DetailEffectif"/>
                   </td>
                 </tr>
               </xsl:for-each>
               <tr>
-                <td>Total élèves</td>
-                <td>
+                <td class="totalsansbordure">
+                  Nombre d'élèves</td>
+                <td class="totalbordure">
                   <xsl:value-of select="sum(Etablissement/LstEffectifDetail/EffectifDetail/DetailEffectif)"/>
                 </td>
               </tr>
@@ -603,9 +600,40 @@
         </td>
       </tr>
       <tr>
-        <td>Fonctionnement hors dotation annuelle DCE</td>
-        <td></td>
+        <xsl:if test ="count(Etablissement/LstInvestissementDCE/child::*)>0">
+          <td>
+            <xsl:text>Fonctionnement hors dotation annuelle DCE </xsl:text>
+            <xsl:value-of select="Etablissement/LstInvestissementDCE/InvestissementDCE/Annee"/>
+          </td>
+        </xsl:if> 
+        <td>
+          <xsl:if test ="count(Etablissement/LstInvestissementDCE/child::*)>0">
+            <table class="sanbordure">
+              <colgroup>
+                <col class="libInv"></col>
+                <col class="nombre"></col>
+              </colgroup>
+              <xsl:for-each select="Etablissement/LstInvestissementDCE/InvestissementDCE">
+                <tr>
+                  <td class="sansbordure">
+                    <xsl:value-of select="Libelle"/>
+                  </td>
+                  <td class="sansbordure">
+                    <xsl:value-of select="format-number(Montant,'###.###.##0','europe')"/>
+                    <xsl:text> €</xsl:text>
+                  </td>
+                </tr>
+              </xsl:for-each>
+              <td class="totalsansbordure">Total dotation</td>
+              <td class="totalbordure">
+                <xsl:value-of select="format-number(sum(Etablissement/LstInvestissementDCE/InvestissementDCE/Montant),'###.###.##0','europe')" />
+                <xsl:text> €</xsl:text>
+              </td>
+            </table>
+          </xsl:if>
+        </td>
       </tr>
+      
        <!--
 
       <tr>