Dominique.freyd 16 år sedan
förälder
incheckning
a45a68bd4c

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

@@ -55,6 +55,7 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Restauration.cs" />
     <Compile Include="RestaurationExterne.cs" />
+    <Compile Include="SecteurRecrutement.cs" />
     <Compile Include="Utile.cs" />
   </ItemGroup>
   <ItemGroup>

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

@@ -143,7 +143,7 @@ namespace CG67.FicheCollege.Domaine
         /// <summary>
         /// Le(s) secteur(s) de recrutement de l'établissement.
         /// </summary>
-        private IList<string> mLstSecteurRecrutement;
+        private IList<EtablissementRecrutement> mLstSecteurRecrutement;
         /// <summary>
         /// adresse de l'établissement.
         /// </summary>
@@ -437,7 +437,7 @@ namespace CG67.FicheCollege.Domaine
         /// <summary>
         /// Obtient ou définit le(s) secteur(s) de recrutement de l'établissement.
         /// </summary>
-        public IList<string> LstSecteurRecrutement
+        public IList<EtablissementRecrutement> LstSecteurRecrutement
         {
             get { return mLstSecteurRecrutement; }
             set { mLstSecteurRecrutement = value; }
@@ -696,16 +696,18 @@ namespace CG67.FicheCollege.Domaine
             get
             {
                 string retour = string.Empty;
-
-                foreach (string com in LstSecteurRecrutement)
+                int i=0;
+                foreach (EtablissementRecrutement  com in LstSecteurRecrutement)
                 {
-                    if (LstSecteurRecrutement.Count == 1)
+                    if (i == 0)
                     {
-                        retour = com;
-                        break;
+                        retour = com.Libelle;
+                        i++;
                     }
                     else
-                        retour += com + "\n";
+                    {
+                        retour += ", " + com.Libelle;
+                    }
                 }
 
                 if (retour == string.Empty)

+ 21 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/SecteurRecrutement.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace CG67.FicheCollege.Domaine
+{
+    public class EtablissementRecrutement
+    {
+        private string libelle;
+
+        public string Libelle
+        {
+            get { return libelle; }
+            set { libelle = value; }
+        }
+        public EtablissementRecrutement(string libelle)
+        {
+            this.libelle = libelle;
+        }
+    }
+}

+ 6 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotDotation.cs

@@ -13,6 +13,12 @@ namespace CG67.FicheCollege.Entrepot
         public Dotation GetByCodeRNEAndAnnee(string codeRNE, int annee)
         {
             Dotation resultat = new Dotation();
+
+            
+            if (System.DateTime.Now.Month > 8)
+                annee +=  1;
+            
+
             using (SqlConnection connexion = new SqlConnection(this.ChaineDeConnexion))
             {
                 try

+ 35 - 12
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotEtablissement.cs

@@ -99,6 +99,17 @@ namespace CG67.FicheCollege.Entrepot
                             }
                         }
 
+                        command.CommandText = "SELECT * from SecteurRecrutement WHERE CodeRNE = @RNE and Annee=@annee";
+                        using (SqlDataReader dr7 = command.ExecuteReader())
+                        {
+                            IList<EtablissementRecrutement> lstSecteurRecrut = new List<EtablissementRecrutement>();
+                            while (dr7.Read())
+                            {
+                                lstSecteurRecrut.Add(new EtablissementRecrutement(dr7["Libelle"].ToString()));
+                            }
+                            resultat.LstSecteurRecrutement = lstSecteurRecrut;
+                        }
+
                         command.CommandText = "SELECT * FROM Reserve WHERE CodeRNE = @RNE AND Annee = @Annee";
                         using (SqlDataReader dr3 = command.ExecuteReader())
                         {
@@ -112,12 +123,31 @@ namespace CG67.FicheCollege.Entrepot
                         command.Parameters.AddWithValue("@AnneeMoins10", annee - 10);
                         using (SqlDataReader dr4 = command.ExecuteReader())
                         {
+                            resultat.LstEffectif = new List<Effectif>();
                             IList<Effectif> lstEffectifReel = new List<Effectif>();
                             while (dr4.Read())
                             {
                                 lstEffectifReel.Add(new Effectif(dr4["Annee"].ToString(),dr4["TypeDonnees"].ToString(),  Convert.ToInt32(dr4["EffectifTotal"].ToString())));
                             }
-                            resultat.LstEffectif = lstEffectifReel;
+
+                            foreach (Effectif e in lstEffectifReel)
+                            {
+                                if (e.TypeEffectif == "R") 
+                                    resultat.LstEffectif.Add(e);  
+                            }
+
+                            foreach (Effectif e in lstEffectifReel)
+                            {
+                                bool trouve = false;
+                                if (e.TypeEffectif == "P")
+                                {
+                                    foreach (Effectif e1 in resultat.LstEffectif)
+                                        if (e1.Annee == e.Annee)
+                                            trouve = true;
+                                    if (!trouve)
+                                        resultat.LstEffectif.Add(e);
+                                }
+                            }
                         }
 
                         
@@ -133,17 +163,7 @@ namespace CG67.FicheCollege.Entrepot
                             resultat.LstRestructuration = lstRestructuration;
                         }
 
-                        command.CommandText = "SELECT * from SecteurRecrutement WHERE CodeRNE = @RNE";
-                        using (SqlDataReader dr7 = command.ExecuteReader())
-                        {
-                            IList<string> lstSecteurRecrut = new List<string>();
-                            while (dr7.Read())
-                            {
-                                lstSecteurRecrut.Add(dr7["Libelle"].ToString());
-                            }
-                            resultat.LstSecteurRecrutement = lstSecteurRecrut;
-                        }
-
+                       
                         command.CommandText = "SELECT * from Remplacement INNER JOIN ATC ON (ATC.Id = Remplacement.IdATCRemplace) INNER JOIN Contact ON (ATC.Id = Contact.Id) WHERE CodeRNE = @RNE AND Remplacement.DateDebut + DureeEnSemaine >= GETDATE()";
                         using (SqlDataReader dr8 = command.ExecuteReader())
                         {
@@ -154,6 +174,9 @@ namespace CG67.FicheCollege.Entrepot
                             }
                             resultat.NbrRemplacementsATC = nbrRemplacements;
                         }
+
+                        
+
                     }
                 }
                 //catch

+ 1 - 1
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotProgTravaux.cs

@@ -38,7 +38,7 @@ namespace CG67.FicheCollege.Entrepot
                                 }
                                 catch
                                 {
-                                    throw new Exception("Le montant travaux prev n'est pas numeric !!! i fait corriger les données");
+                                    montantPrev = 0;
                                 }
                                 resultat.Add(new ProgTravaux(Convert.ToInt16(reader["ANNEE"].ToString()), reader["LIBELLE_OPERATION"].ToString(), montantPrev , reader["TYPE_OPERATION"].ToString(), reader["STATUT_OP"].ToString()));
                             }

+ 3 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/Default.aspx.cs

@@ -28,6 +28,9 @@ namespace CG67.FicheCollege
             else
                 annee = System.DateTime.Now.Year;
 
+
+            
+
             HttpContext.Current.Session["Annee"] = annee;
             HttpContext.Current.Session["AnneeMoins1"] = annee - 1;
             HttpContext.Current.Session["RNE"] = ddlChoixCollege.SelectedValue;

+ 2 - 1
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/xslt/FicheCollege.xslt

@@ -269,7 +269,7 @@
       <tr>
         <td>Secteur de recrutement</td>
         <td>
-          <!--<xsl:value-of select="Etablissement/PhraseSecteurRecrutement"/>-->
+          <xsl:value-of select="Etablissement/PhraseSecteurRecrutement"/>
         </td>
       </tr>
       <tr>
@@ -628,6 +628,7 @@
     <xsl:attribute name="src">vide.histo?l=600&amp;h=400&amp;f=-64&amp;nb=<xsl:value-of select="count(Effectif)"></xsl:value-of>     
       <xsl:for-each select="Effectif">
         <xsl:if test="TypeEffectif='R'">&amp;v<xsl:value-of select ="position()"></xsl:value-of>=<xsl:value-of select="EffectifTotal"/>&amp;c<xsl:value-of select ="position()"></xsl:value-of>=-16776961&amp;t<xsl:value-of select ="position()"></xsl:value-of>=<xsl:value-of select="Annee"/></xsl:if>
+        
         <xsl:if test="TypeEffectif='P'">&amp;v<xsl:value-of select ="position()"></xsl:value-of>=<xsl:value-of select="EffectifTotal"/>&amp;c<xsl:value-of select ="position()"></xsl:value-of>=-65536&amp;t<xsl:value-of select ="position()"></xsl:value-of>=<xsl:value-of select="Annee"/></xsl:if>
       </xsl:for-each>    
     </xsl:attribute>