瀏覽代碼

Création des canton + conseiller départementaux

celine.meneu 10 年之前
父節點
當前提交
2d883e0b45
共有 14 個文件被更改,包括 270 次插入15 次删除
  1. 1 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/CG67.FicheCollege.Domaine.csproj
  2. 72 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/Canton.cs
  3. 20 1
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/Etablissement.cs
  4. 1 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/CG67.FicheCollege.Entrepot.csproj
  5. 92 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotCanton.cs
  6. 1 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotEtablissement.cs
  7. 9 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotFactory.cs
  8. 1 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Interface/CG67.FicheCollege.Interface.csproj
  9. 13 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Interface/IEntrepotCanton.cs
  10. 12 0
      CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Service/ServiceFiche.cs
  11. 2 3
      CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/CG67.FicheCollege.Web.csproj
  12. 1 1
      CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/Web.config
  13. 8 0
      CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/vwd.webinfo
  14. 37 10
      CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/xslt/FicheCollegev2.xslt

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

@@ -52,6 +52,7 @@
     <Compile Include="ActionEducative.cs" />
     <Compile Include="ATC.cs" />
     <Compile Include="Bilinguisme.cs" />
+    <Compile Include="Canton.cs" />
     <Compile Include="ChiffresSignificatifs.cs" />
     <Compile Include="ClasseDecouverte.cs" />
     <Compile Include="Commentaires.cs" />

+ 72 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Domaine/Canton.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace CG67.FicheCollege.Domaine
+{
+    [Serializable]
+    public class Canton
+    {
+          /// <summary>
+        /// Nom du Canton
+        /// </summary>
+        private string mNomCanton;
+        /// <summary>
+        /// nom de l'élus
+        private string mCivilite;
+        /// </summary>
+        private string mNomConseiller;
+        /// <summary>
+        /// prénom de l'élus
+        /// </summary>
+        private string mPrenomConseiller;
+        /// <summary>
+        /// fonction de l'élus - Conseiller départemental ou suppléant
+        private string mFonction;
+        
+        public string NomCanton
+        {
+            get { return mNomCanton; }
+            set { mNomCanton = value; }
+        }
+        public string Civilite
+        {
+            get { return mCivilite; }
+            set { mCivilite = value; }
+        }
+
+        public string NomConseiller
+        {
+            get { return mNomConseiller; }
+            set { mNomConseiller = value; }
+        }
+        public string PrenomConseiller
+        {
+            get { return mPrenomConseiller; }
+            set { mPrenomConseiller = value; }
+        }
+        public string Fonction
+        {
+            get { return mFonction; }
+            set { mFonction = value; }
+        }
+
+
+        public Canton(string NomCanton, string civilite, string nomConseiller, string prenomConseiller, string fonction)
+        {
+            this.mNomCanton = NomCanton;
+            this.mCivilite = civilite;
+            this.mNomConseiller = nomConseiller;
+            this.mPrenomConseiller = prenomConseiller;
+            this.mFonction = fonction;
+            
+        }
+        
+      //  public override string ToString()
+      //  {
+      //      return Ville + " - " + Utile.formatStringPrenom(PrenomPresident) + " " + NomPresident.ToUpper();
+      //  }
+
+    }
+}

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

@@ -19,6 +19,7 @@ namespace CG67.FicheCollege.Domaine
     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 IList<Canton> dlgLoadCanton(string codeRNE);
     public delegate Logement dlgLoadLogement(string codeRNE);
    // public delegate IList<ProgTravaux> dlgLoadProgTravaux(string codeRNE, int annee);
     public delegate IList<ProjetPilote> dlgLoadProjetPilote(string codeRNE, int annee);
@@ -44,6 +45,7 @@ namespace CG67.FicheCollege.Domaine
         private dlgLoadInvestissement LoaderInvestissement;
         private dlgLoadEffectifDetail LoaderEffectifDetail;
         private dlgLoadMCG LoaderMCG;
+        private dlgLoadCanton LoaderCanton;
         private dlgLoadLogement LoaderLogement;
        // private dlgLoadProgTravaux LoaderProgTravaux;
         private dlgLoadProjetPilote LoaderProjetPilote;
@@ -147,6 +149,10 @@ namespace CG67.FicheCollege.Domaine
         /// MCG de rattachement de l'établissement
         /// </summary>
         private MCG mMcgRattachement;
+
+        /// Canton de rattachement de l'établissement
+        /// </summary>
+        private IList<Canton> mLstCanton;
         /// <summary>
         /// Logement de fonction
         /// </summary>
@@ -503,6 +509,17 @@ namespace CG67.FicheCollege.Domaine
             }
             set { mMcgRattachement = value; }
         }
+
+        public IList<Canton> LstCanton
+        {
+            get
+            {
+                if (mLstCanton == null)
+                    mLstCanton = this.LoaderCanton(mCodeRNE);
+                return mLstCanton;
+            }
+            set { mLstCanton = value; }
+        }
         /// <summary>
         /// Obtient ou définit un objet Logement
         /// </summary>
@@ -1174,7 +1191,8 @@ namespace CG67.FicheCollege.Domaine
                                 dlgLoadDotation loaderDotation,
                                 dlgLoadInvestissementDCE loaderInvestissementDCE,
                                 dlgLoadInvestissement loaderInvestissement,
-                                dlgLoadEffectifDetail loaderEffectifDetail, 
+                                dlgLoadEffectifDetail loaderEffectifDetail,
+                                dlgLoadCanton loaderCanton,
                                 dlgLoadMCG loaderMCG, dlgLoadLogement loaderLogement,
                               //  dlgLoadProgTravaux loaderProgTravaux, 
                                 dlgLoadProjetPilote loaderProjetPilote, 
@@ -1217,6 +1235,7 @@ namespace CG67.FicheCollege.Domaine
             this.LoaderInvestissement = loaderInvestissement;
             this.LoaderEffectifDetail = loaderEffectifDetail;
             this.LoaderMCG = loaderMCG;
+            this.LoaderCanton = loaderCanton;
             this.LoaderLogement = loaderLogement;
         //    this.LoaderProgTravaux = loaderProgTravaux;
             this.LoaderProjetPilote = loaderProjetPilote;

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

@@ -57,6 +57,7 @@
     <Compile Include="EntrepotATC.cs" />
     <Compile Include="EntrepotBase.cs" />
     <Compile Include="EntrepotBilinguisme.cs" />
+    <Compile Include="EntrepotCanton.cs" />
     <Compile Include="EntrepotChiffresSignificatifs.cs" />
     <Compile Include="EntrepotClasseDecouverte.cs" />
     <Compile Include="EntrepotCommentaires.cs" />

+ 92 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Entrepot/EntrepotCanton.cs

@@ -0,0 +1,92 @@
+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 EntrepotCanton : EntrepotBase, IEntrepotCanton
+    {
+        public IList<Canton> GetByCodeRNE(string codeRNE)
+        {
+            IList<Canton> resultat = new List<Canton>();
+            string libelleCanton = " ";
+            string CodeCanton = " "; 
+             using (SqlConnection connexion = new SqlConnection(this.ChaineDeConnexion))
+                {
+                    try
+                    {
+                        connexion.Open();
+                        using (SqlCommand command = connexion.CreateCommand())
+                        {
+                          
+                          //   command.CommandText = "SELECT  Libellé, Etablissement.CodeRNE FROM Canton INNER JOIN Etablissement ON Canton.Id = Etablissement.IdCanton WHERE Etablissement.CodeRNE = @RNE ";
+                            command.CommandText = "SELECT  Libellé, Etablissement.CodeRNE, Canton.Id FROM Canton INNER JOIN Etablissement ON Canton.Id = Etablissement.IdCanton WHERE Etablissement.CodeRNE = @RNE ";
+                            command.Parameters.AddWithValue("@RNE", codeRNE);
+                            using (SqlDataReader dr = command.ExecuteReader())
+                            {
+                                if (dr.Read())
+                                {
+
+                                    libelleCanton = dr["Libellé"].ToString();
+                                    CodeCanton = dr["Id"].ToString();
+
+                                }
+                                
+                                 using (SqlConnection connexion1 = new SqlConnection(this.ChaineDeConnexion))
+                                    {
+                                        try
+                                        {   
+                                            connexion1.Open();
+                                            using (SqlCommand command1 = connexion1.CreateCommand())
+                                            {
+                                                //command1.CommandText = "SELECT Contact.Nom, Contact.Prenom FROM Contact INNER JOIN ON ElusCanton ON ElusCanton.IdContact = Contact.Id WHERE ElusCanton.IdCanton = @IdCanton";
+                                                command1.CommandText = "SELECT Contact.Civilite, Contact.Nom, Contact.Prenom, Contact.IdFonction FROM Contact INNER JOIN ElusCanton ON ElusCanton.IdContact = Contact.Id WHERE ElusCanton.IdCanton = @IdCanton ORDER BY Contact.Civilite";
+
+                                                command1.Parameters.AddWithValue("@IdCanton", CodeCanton);
+                                                using (SqlDataReader dr1 = command1.ExecuteReader())
+                                                {
+                                                    while (dr1.Read())
+                                                    {
+
+                                                        resultat.Add(new Canton(libelleCanton, dr1["Civilite"].ToString(), dr1["Nom"].ToString(), dr1["Prenom"].ToString(), dr1["IdFonction"].ToString()));
+                                                    }
+                                                        
+}
+                                                }
+                                            }
+
+                                        catch (Exception erreurInterne)
+                                        {
+                                            throw new Exception(" " + erreurInterne);
+                                        }
+                                        finally
+                                        {
+                                            if (connexion1.State == ConnectionState.Open)
+                                                connexion1.Close();
+                                        }
+                                    }
+
+                                }
+                            }
+                        }
+                    
+                    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

@@ -98,6 +98,7 @@ namespace CG67.FicheCollege.Entrepot
                                  EntrepotFactory.GetEntrepotEquipement().GetByCodeRNEAndAnnee,
                                  EntrepotFactory.GetEntrepotInvestissement().GetByCodeRNEAndAnnee,
                                  EntrepotFactory.GetEntrepotEffectifDetail().GetByCodeRNEAndAnnee,
+                                 EntrepotFactory.GetEntrepotCanton().GetByCodeRNE,
                                  EntrepotFactory.GetEntrepotMCG().GetByCodeRNE,
                                  EntrepotFactory.GetEntrepotLogement().GetByCodeRNE,
                                  EntrepotFactory.GetEntrepotProjetPilote().GetByCodeRNEAndAnnee,

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

@@ -100,6 +100,14 @@ namespace CG67.FicheCollege.Entrepot
             return entrepotMCG;
         }
 
+        private static IEntrepotCanton entrepotCanton;
+        public static IEntrepotCanton GetEntrepotCanton()
+        {
+            if (entrepotCanton == null)
+                entrepotCanton = new EntrepotCanton();
+            return entrepotCanton;
+        }
+
         private static IEntrepotProjetPilote entrepotProjetPilote;
         public static IEntrepotProjetPilote GetEntrepotProjetPilote()
         {
@@ -180,5 +188,6 @@ namespace CG67.FicheCollege.Entrepot
             return entrepotEtablissement;
         }
 
+            
     }
 }

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

@@ -52,6 +52,7 @@
     <Compile Include="IEntrepotActionEducative.cs" />
     <Compile Include="IEntrepotATC.cs" />
     <Compile Include="IEntrepotBilinguisme.cs" />
+    <Compile Include="IEntrepotCanton.cs" />
     <Compile Include="IEntrepotChiffresSignificatifs.cs" />
     <Compile Include="IEntrepotClasseDecouverte.cs" />
     <Compile Include="IEntrepotCommentaires.cs" />

+ 13 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Core/CG67.FicheCollege.Interface/IEntrepotCanton.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using CG67.FicheCollege.Domaine;
+
+namespace CG67.FicheCollege.Interface
+{
+    public interface IEntrepotCanton
+    {
+        IList<Canton> GetByCodeRNE(string codeRNE);
+   
+    }
+}

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

@@ -143,6 +143,18 @@ namespace CG67.FicheCollege.Service
                 throw new Exception(erreur.ToString());
             }
         }
+
+        public static IList<Canton> GetCantonByRNE(string codeRNE)
+        {
+            try
+            {
+                return EntrepotFactory.GetEntrepotCanton().GetByCodeRNE(codeRNE);
+            }
+            catch (Exception erreur)
+            {
+                throw new Exception(erreur.ToString());
+            }
+        }
         public static IList<ProjetPilote> GetProjetPiloteByRNEAndAnnee(string codeRNE, int annee)
         {
             try

+ 2 - 3
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/CG67.FicheCollege.Web.csproj

@@ -268,12 +268,11 @@
     <VisualStudio>
       <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
         <WebProjectProperties>
-          <UseIIS>False</UseIIS>
+          <UseIIS>True</UseIIS>
           <AutoAssignPort>False</AutoAssignPort>
           <DevelopmentServerPort>1031</DevelopmentServerPort>
           <DevelopmentServerVPath>/</DevelopmentServerVPath>
-          <IISUrl>
-          </IISUrl>
+          <IISUrl>http://localhost:1031/</IISUrl>
           <NTLMAuthentication>False</NTLMAuthentication>
           <UseCustomServer>False</UseCustomServer>
           <CustomServerUrl>

+ 1 - 1
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/Web.config

@@ -8,7 +8,7 @@
     <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
   </connectionStrings>
   <appSettings>
-    <add key="ConnexionStringSic" value="Data Source=PAN\SQLSTD2K5_1;Initial Catalog=TSic;User Id=UserTSicRW;password=UserTS!cRW!"/>
+    <add key="ConnexionStringSic" value="Data Source=ESNA\SQLSTD2K5_1;Initial Catalog=TSic;User Id=UserTSicRW;password=UserTS!cRW!"/>
     <!--   <add key="ConnexionStringOracleCollege" value="Data Source=PCOL;User Id=college;Password=college;"/> -->
     <add key="ConnexionStringAccess" value="Provider=microsoft.jet.oledb.4.0;Data Source=\\Moder\App_production\College\data\Base\BD Collège_prod.mdb;Persist Security Info=False;"/>
     <add key="ConnexionStringOracleSubvention" value="Data Source=SGFP;User Id=ASTRE;Password=ASTRE;"/>

+ 8 - 0
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/vwd.webinfo

@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!-- 
+  Visual Studio global web project settings.
+-->
+<VisualWebDeveloper>
+
+  <iisExpressSettings windowsAuthentication="enabled" anonymousAuthentication="enabled" useClassicPipelineMode="true"/>
+</VisualWebDeveloper>

+ 37 - 10
CG67.FicheCollege.root/CG67.FicheCollege/Web/CG67.FicheCollege.Web/xslt/FicheCollegev2.xslt

@@ -149,26 +149,52 @@
               </xsl:if>
             </tr>
             <tr>
-              <td class="td_head">Conseiller Général titulaire</td>
+              <td class="td_head">Conseillers Départementaux titulaires</td>
               <td>
-                <xsl:if test ="Etablissement/ConseillerGeneral!=''">
+          <!--      <xsl:if test ="Etablissement/ConseillerGeneral!=''">
                   <xsl:value-of select="Etablissement/ConseillerGeneral"></xsl:value-of>
                 </xsl:if>
                 <xsl:if test ="Etablissement/ConseillerGeneral=''">
                   Vacant
-                </xsl:if>
-              </td>
+                </xsl:if> -->
+				  <xsl:if test="count(Etablissement/LstCanton/Canton[Fonction = '6']) =0">
+					  Vacant
+				  </xsl:if>
+				  <xsl:if test="count(Etablissement/LstCanton/Canton[Fonction = '6']) >0">
+					  <xsl:for-each select="Etablissement/LstCanton/Canton[Fonction = '6']">
+						   <xsl:value-of select="Civilite"/>
+						  <xsl:text> </xsl:text>
+						  <xsl:value-of select="PrenomConseiller"/>
+						  <xsl:text> </xsl:text>
+						  <xsl:value-of select="NomConseiller"/>
+						  <xsl:text> - </xsl:text>
+				  </xsl:for-each>
+				  </xsl:if>  
+	          </td>
             </tr>
             <tr>
-              <td class="td_head">Conseiller Général suppléant</td>
+              <td class="td_head">Conseillers Départementaux suppléants</td>
               <td>
-                <xsl:if test ="Etablissement/ConseillerGeneralSuppleant!=''">
+<!--                <xsl:if test ="Etablissement/ConseillerGeneralSuppleant!=''">
                   <xsl:value-of select="Etablissement/ConseillerGeneralSuppleant"></xsl:value-of>
                 </xsl:if>
                 <xsl:if test ="Etablissement/ConseillerGeneralSuppleant=''">
                   Vacant
-                </xsl:if>
-              </td>
+                </xsl:if> -->
+				  <xsl:if test="count(Etablissement/LstCanton/Canton[Fonction = '91']) =0">
+					  Vacant
+				  </xsl:if>
+				  <xsl:if test="count(Etablissement/LstCanton/Canton[Fonction = '91']) >0">
+					  <xsl:for-each select="Etablissement/LstCanton/Canton[Fonction = '91']">
+						  <xsl:value-of select="Civilite"/>
+						  <xsl:text> </xsl:text>
+						  <xsl:value-of select="PrenomConseiller"/>
+						  <xsl:text> </xsl:text>
+						  <xsl:value-of select="NomConseiller"/>
+						  <xsl:text> - </xsl:text>
+					  </xsl:for-each>
+				  </xsl:if>
+			  </td>
             </tr>
           </table>
           <table>
@@ -203,8 +229,9 @@
                 Canton de rattachement
               </td>
               <td>
-                <xsl:value-of select="Etablissement/Canton"/>
-
+				  <xsl:if test="count(Etablissement/LstCanton/child::*) >0">
+					  <xsl:value-of select="Etablissement/LstCanton/Canton/NomCanton"/>
+				  </xsl:if>
               </td>
             </tr>
             <tr>