Explorar o código

Ajout des données educfacile: options, niveaux, effectifs

olivier.massot %!s(int64=7) %!d(string=hai) anos
pai
achega
68c8d725d1

+ 1 - 0
CD67.FicheCollege.Entity/Annee.cs

@@ -23,6 +23,7 @@ namespace CD67.FicheCollege.Entity
     
         public int Id { get; set; }
         public string Libelle { get; set; }
+        public int AnneeRentree { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<College> Colleges { get; set; }

+ 12 - 0
CD67.FicheCollege.Entity/CD67.FicheCollege.Entity.csproj

@@ -141,6 +141,9 @@
     <Compile Include="etablissement.cs">
       <DependentUpon>EducfModel.tt</DependentUpon>
     </Compile>
+    <Compile Include="etaboptionsannee.cs">
+      <DependentUpon>EducfModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="Extend\ActionEduCollege.cs" />
     <Compile Include="Extend\Annee.cs" />
     <Compile Include="Extend\College.cs" />
@@ -149,8 +152,17 @@
     <Compile Include="Extend\ActionEduThematique.cs" />
     <Compile Include="Extend\ActionEdu.cs" />
     <Compile Include="Extend\TypeCollege.cs" />
+    <Compile Include="filiere.cs">
+      <DependentUpon>EducfModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="Internal\Entities.cs" />
     <Compile Include="Internal\FormattedDbEntityValidationException.cs" />
+    <Compile Include="matiereoption.cs">
+      <DependentUpon>EducfModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="mef.cs">
+      <DependentUpon>EducfModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="niveau.cs">
       <DependentUpon>EducfModel.tt</DependentUpon>
     </Compile>

+ 4 - 0
CD67.FicheCollege.Entity/EducfModel.Context.cs

@@ -30,5 +30,9 @@ namespace CD67.FicheCollege.Entity
         public virtual DbSet<etablissement> etablissements { get; set; }
         public virtual DbSet<niveau> niveaux { get; set; }
         public virtual DbSet<rue> rues { get; set; }
+        public virtual DbSet<filiere> filieres { get; set; }
+        public virtual DbSet<mef> mefs { get; set; }
+        public virtual DbSet<etaboptionsannee> etaboptionsannees { get; set; }
+        public virtual DbSet<matiereoption> matiereoptions { get; set; }
     }
 }

+ 200 - 0
CD67.FicheCollege.Entity/EducfModel.edmx

@@ -85,6 +85,44 @@
           <Property Name="libellecarte1" Type="varchar" MaxLength="200" />
           <Property Name="libellecarte2" Type="varchar" MaxLength="200" />
         </EntityType>
+        <EntityType Name="etaboptionsannee">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="idetablissement" Type="int4" />
+          <Property Name="idoption" Type="numeric" Precision="5" Scale="0" />
+          <Property Name="id" Type="int4" StoreGeneratedPattern="Identity" Nullable="false" />
+        </EntityType>
+        <EntityType Name="filiere">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="int4" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="nom" Type="varchar" MaxLength="60" />
+          <Property Name="libelle" Type="varchar" MaxLength="100" />
+        </EntityType>
+        <EntityType Name="matiereoption">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="int4" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="code" Type="varchar" MaxLength="20" />
+          <Property Name="nom" Type="varchar" MaxLength="100" />
+          <Property Name="nomcourt" Type="varchar" MaxLength="50" />
+          <Property Name="nomlong" Type="varchar" MaxLength="200" />
+        </EntityType>
+        <EntityType Name="mef">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="int4" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="code" Type="varchar" MaxLength="11" />
+          <Property Name="mefst11" Type="varchar" MaxLength="11" />
+          <Property Name="nomcourt" Type="varchar" MaxLength="6" />
+          <Property Name="nomlong" Type="varchar" MaxLength="40" />
+          <Property Name="idniveau" Type="numeric" Precision="5" Scale="0" />
+          <Property Name="idfiliere" Type="numeric" Precision="5" Scale="0" />
+        </EntityType>
         <EntityType Name="niveau">
           <Key>
             <PropertyRef Name="id" />
@@ -121,6 +159,20 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_EtabOptionsAnnee">
+          <End Role="etablissement" Type="Self.etablissement" Multiplicity="0..1">
+            <OnDelete Action="Cascade" />
+          </End>
+          <End Role="etaboptionsannee" Type="Self.etaboptionsannee" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="etablissement">
+              <PropertyRef Name="id" />
+            </Principal>
+            <Dependent Role="etaboptionsannee">
+              <PropertyRef Name="idetablissement" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_RuesCommunes">
           <End Role="commune" Type="Self.commune" Multiplicity="0..1">
             <OnDelete Action="Cascade" />
@@ -139,12 +191,20 @@
           <EntitySet Name="commune" EntityType="Self.commune" Schema="educf" store:Type="Tables" />
           <EntitySet Name="etabeffectifannee" EntityType="Self.etabeffectifannee" Schema="educf" store:Type="Tables" />
           <EntitySet Name="etablissement" EntityType="Self.etablissement" Schema="educf" store:Type="Tables" />
+          <EntitySet Name="etaboptionsannee" EntityType="Self.etaboptionsannee" Schema="educf" store:Type="Tables" />
+          <EntitySet Name="filiere" EntityType="Self.filiere" Schema="educf" store:Type="Tables" />
+          <EntitySet Name="matiereoption" EntityType="Self.matiereoption" Schema="educf" store:Type="Tables" />
+          <EntitySet Name="mef" EntityType="Self.mef" Schema="educf" store:Type="Tables" />
           <EntitySet Name="niveau" EntityType="Self.niveau" Schema="educf" store:Type="Tables" />
           <EntitySet Name="rues" EntityType="Self.rues" Schema="educf" store:Type="Tables" />
           <AssociationSet Name="FK_EtabEffectifAnnee" Association="Self.FK_EtabEffectifAnnee">
             <End Role="etablissement" EntitySet="etablissement" />
             <End Role="etabeffectifannee" EntitySet="etabeffectifannee" />
           </AssociationSet>
+          <AssociationSet Name="FK_EtabOptionsAnnee" Association="Self.FK_EtabOptionsAnnee">
+            <End Role="etablissement" EntitySet="etablissement" />
+            <End Role="etaboptionsannee" EntitySet="etaboptionsannee" />
+          </AssociationSet>
           <AssociationSet Name="FK_RuesCommunes" Association="Self.FK_RuesCommunes">
             <End Role="commune" EntitySet="commune" />
             <End Role="rues" EntitySet="rues" />
@@ -238,6 +298,7 @@
           <Property Name="libellecarte2" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
           <NavigationProperty Name="etabeffectifannees" Relationship="Self.FK_EtabEffectifAnnee" FromRole="etablissement" ToRole="etabeffectifannee" />
           <NavigationProperty Name="rue" Relationship="educfModel.etablissementrue" FromRole="etablissement" ToRole="rue" />
+          <NavigationProperty Name="etaboptionsannees" Relationship="educfModel.FK_EtabOptionsAnnee" FromRole="etablissement" ToRole="etaboptionsannee" />
         </EntityType>
         <EntityType Name="niveau">
           <Key>
@@ -314,6 +375,22 @@
             <End Role="niveau" EntitySet="niveaux" />
             <End Role="etabeffectifannee" EntitySet="etabeffectifannees" />
           </AssociationSet>
+          <EntitySet Name="filieres" EntityType="educfModel.filiere" />
+          <EntitySet Name="mefs" EntityType="educfModel.mef" />
+          <AssociationSet Name="filieremef" Association="educfModel.filieremef">
+            <End Role="filiere" EntitySet="filieres" />
+            <End Role="mef" EntitySet="mefs" />
+          </AssociationSet>
+          <EntitySet Name="etaboptionsannees" EntityType="educfModel.etaboptionsannee" />
+          <EntitySet Name="matiereoptions" EntityType="educfModel.matiereoption" />
+          <AssociationSet Name="FK_EtabOptionsAnnee" Association="educfModel.FK_EtabOptionsAnnee">
+            <End Role="etablissement" EntitySet="etablissements" />
+            <End Role="etaboptionsannee" EntitySet="etaboptionsannees" />
+          </AssociationSet>
+          <AssociationSet Name="matiereoptionetaboptionsannee" Association="educfModel.matiereoptionetaboptionsannee">
+            <End Role="etaboptionsannee" EntitySet="etaboptionsannees" />
+            <End Role="matiereoption" EntitySet="matiereoptions" />
+          </AssociationSet>
         </EntityContainer>
         <Association Name="etablissementrue">
           <End Type="educfModel.etablissement" Role="etablissement" Multiplicity="*" />
@@ -339,6 +416,87 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityType Name="filiere">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="nom" Type="String" MaxLength="60" FixedLength="false" Unicode="true" />
+          <Property Name="libelle" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="mefs" Relationship="educfModel.filieremef" FromRole="filiere" ToRole="mef" />
+        </EntityType>
+        <EntityType Name="mef">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="code" Type="String" MaxLength="11" FixedLength="false" Unicode="true" />
+          <Property Name="mefst11" Type="String" MaxLength="11" FixedLength="false" Unicode="true" />
+          <Property Name="nomcourt" Type="String" MaxLength="6" FixedLength="false" Unicode="true" />
+          <Property Name="nomlong" Type="String" MaxLength="40" FixedLength="false" Unicode="true" />
+          <Property Name="idniveau" Type="Int32" />
+          <Property Name="idfiliere" Type="Int32" />
+          <NavigationProperty Name="filiere" Relationship="educfModel.filieremef" FromRole="mef" ToRole="filiere" />
+        </EntityType>
+        <Association Name="filieremef">
+          <End Type="educfModel.filiere" Role="filiere" Multiplicity="0..1" />
+          <End Type="educfModel.mef" Role="mef" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="filiere">
+              <PropertyRef Name="id" />
+            </Principal>
+            <Dependent Role="mef">
+              <PropertyRef Name="idfiliere" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <EntityType Name="etaboptionsannee">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="idetablissement" Type="Int32" />
+          <Property Name="idoption" Type="Int32" />
+          <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <NavigationProperty Name="etablissement" Relationship="educfModel.FK_EtabOptionsAnnee" FromRole="etaboptionsannee" ToRole="etablissement" />
+          <NavigationProperty Name="matiereoption" Relationship="educfModel.matiereoptionetaboptionsannee" FromRole="etaboptionsannee" ToRole="matiereoption" />
+        </EntityType>
+        <EntityType Name="matiereoption">
+          <Key>
+            <PropertyRef Name="id" />
+          </Key>
+          <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="code" Type="String" MaxLength="20" FixedLength="false" Unicode="true" />
+          <Property Name="nom" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
+          <Property Name="nomcourt" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
+          <Property Name="nomlong" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="etaboptionsannees" Relationship="educfModel.matiereoptionetaboptionsannee" FromRole="matiereoption" ToRole="etaboptionsannee" />
+        </EntityType>
+        <Association Name="FK_EtabOptionsAnnee">
+          <End Type="educfModel.etablissement" Role="etablissement" Multiplicity="0..1">
+            <OnDelete Action="Cascade" />
+          </End>
+          <End Type="educfModel.etaboptionsannee" Role="etaboptionsannee" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="etablissement">
+              <PropertyRef Name="id" />
+            </Principal>
+            <Dependent Role="etaboptionsannee">
+              <PropertyRef Name="idetablissement" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="matiereoptionetaboptionsannee">
+          <End Type="educfModel.etaboptionsannee" Role="etaboptionsannee" Multiplicity="*" />
+          <End Type="educfModel.matiereoption" Role="matiereoption" Multiplicity="0..1" />
+          <ReferentialConstraint>
+            <Principal Role="matiereoption">
+              <PropertyRef Name="id" />
+            </Principal>
+            <Dependent Role="etaboptionsannee">
+              <PropertyRef Name="idoption" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
       </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
@@ -452,6 +610,48 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="filieres">
+            <EntityTypeMapping TypeName="educfModel.filiere">
+              <MappingFragment StoreEntitySet="filiere">
+                <ScalarProperty Name="libelle" ColumnName="libelle" />
+                <ScalarProperty Name="nom" ColumnName="nom" />
+                <ScalarProperty Name="id" ColumnName="id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="mefs">
+            <EntityTypeMapping TypeName="educfModel.mef">
+              <MappingFragment StoreEntitySet="mef">
+                <ScalarProperty Name="idfiliere" ColumnName="idfiliere" />
+                <ScalarProperty Name="idniveau" ColumnName="idniveau" />
+                <ScalarProperty Name="nomlong" ColumnName="nomlong" />
+                <ScalarProperty Name="nomcourt" ColumnName="nomcourt" />
+                <ScalarProperty Name="mefst11" ColumnName="mefst11" />
+                <ScalarProperty Name="code" ColumnName="code" />
+                <ScalarProperty Name="id" ColumnName="id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="etaboptionsannees">
+            <EntityTypeMapping TypeName="educfModel.etaboptionsannee">
+              <MappingFragment StoreEntitySet="etaboptionsannee">
+                <ScalarProperty Name="id" ColumnName="id" />
+                <ScalarProperty Name="idoption" ColumnName="idoption" />
+                <ScalarProperty Name="idetablissement" ColumnName="idetablissement" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="matiereoptions">
+            <EntityTypeMapping TypeName="educfModel.matiereoption">
+              <MappingFragment StoreEntitySet="matiereoption">
+                <ScalarProperty Name="nomlong" ColumnName="nomlong" />
+                <ScalarProperty Name="nomcourt" ColumnName="nomcourt" />
+                <ScalarProperty Name="nom" ColumnName="nom" />
+                <ScalarProperty Name="code" ColumnName="code" />
+                <ScalarProperty Name="id" ColumnName="id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
         </EntityContainerMapping>
       </Mapping>
     </edmx:Mappings>

+ 7 - 0
CD67.FicheCollege.Entity/EducfModel.edmx.diagram

@@ -14,6 +14,13 @@
         <AssociationConnector Association="educfModel.FK_EtabEffectifAnnee" ManuallyRouted="false" />
         <AssociationConnector Association="educfModel.etablissementrue" />
         <AssociationConnector Association="educfModel.niveauetabeffectifannee" />
+        <EntityTypeShape EntityType="educfModel.filiere" Width="1.5" PointX="9" PointY="7.125" />
+        <EntityTypeShape EntityType="educfModel.mef" Width="1.5" PointX="11.5" PointY="7.125" />
+        <AssociationConnector Association="educfModel.filieremef" />
+        <EntityTypeShape EntityType="educfModel.etaboptionsannee" Width="1.5" PointX="3.25" PointY="8.375" />
+        <EntityTypeShape EntityType="educfModel.matiereoption" Width="1.5" PointX="0.75" PointY="8.5" />
+        <AssociationConnector Association="educfModel.FK_EtabOptionsAnnee" />
+        <AssociationConnector Association="educfModel.matiereoptionetaboptionsannee" />
       </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 1 - 1
CD67.FicheCollege.Entity/EntityModel.Context.cs

@@ -19,7 +19,7 @@ namespace CD67.FicheCollege.Entity
             : base("name=Entities")
         {
         }
-
+    
         protected override void OnModelCreating(DbModelBuilder modelBuilder)
         {
             throw new UnintentionalCodeFirstException();

+ 4 - 1
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -67,6 +67,7 @@
           </Key>
           <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="Libelle" Type="nvarchar" MaxLength="12" Nullable="false" />
+          <Property Name="AnneeRentree" Type="int" Nullable="false" />
         </EntityType>
         <EntityType Name="Colleges">
           <Key>
@@ -406,6 +407,7 @@
           <NavigationProperty Name="Colleges" Relationship="CD67.FicheCollege.AnneeCollege" FromRole="Annee" ToRole="College" />
           <Property Name="Libelle" Type="String" Nullable="false" MaxLength="12" FixedLength="false" Unicode="true" />
           <NavigationProperty Name="ActionsEdu" Relationship="CD67.FicheCollege.ActionEduAnnee" FromRole="Annee" ToRole="ActionEdu" />
+          <Property Name="AnneeRentree" Type="Int32" Nullable="false" />
         </EntityType>
         <Association Name="AnneeCollege">
           <End Type="CD67.FicheCollege.Annee" Role="Annee" Multiplicity="1" />
@@ -616,7 +618,8 @@
     <EntitySetMapping Name="Annees">
       <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.Annee)">
         <MappingFragment StoreEntitySet="Annees">
-          <ScalarProperty Name="Id" ColumnName="Id" />
+          <ScalarProperty Name="AnneeRentree" ColumnName="AnneeRentree" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
           <ScalarProperty Name="Libelle" ColumnName="Libelle" />
         </MappingFragment>
       </EntityTypeMapping>

+ 1 - 1
CD67.FicheCollege.Entity/EntityModel.edmx.diagram

@@ -10,7 +10,7 @@
         <EntityTypeShape EntityType="CD67.FicheCollege.College" Width="1.75" PointX="3" PointY="2.625" />
         <AssociationConnector Association="CD67.FicheCollege.FK_Colleges_Territoires" />
         <AssociationConnector Association="CD67.FicheCollege.FK_Colleges_TypesCollege" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.Annee" Width="1.5" PointX="3" PointY="0.5" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.Annee" Width="1.5" PointX="3.125" PointY="0.5" />
         <AssociationConnector Association="CD67.FicheCollege.AnneeCollege" />
         <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduAxe" Width="1.5" PointX="12.125" PointY="3.125" />
         <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduThematique" Width="1.875" PointX="9.875" PointY="3.125" />

+ 3 - 0
CD67.FicheCollege.Entity/etablissement.cs

@@ -18,6 +18,7 @@ namespace CD67.FicheCollege.Entity
         public etablissement()
         {
             this.etabeffectifannees = new HashSet<etabeffectifannee>();
+            this.etaboptionsannees = new HashSet<etaboptionsannee>();
         }
     
         public int id { get; set; }
@@ -61,5 +62,7 @@ namespace CD67.FicheCollege.Entity
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<etabeffectifannee> etabeffectifannees { get; set; }
         public virtual rue rue { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<etaboptionsannee> etaboptionsannees { get; set; }
     }
 }

+ 24 - 0
CD67.FicheCollege.Entity/etaboptionsannee.cs

@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class etaboptionsannee
+    {
+        public Nullable<int> idetablissement { get; set; }
+        public Nullable<int> idoption { get; set; }
+        public int id { get; set; }
+    
+        public virtual etablissement etablissement { get; set; }
+        public virtual matiereoption matiereoption { get; set; }
+    }
+}

+ 30 - 0
CD67.FicheCollege.Entity/filiere.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class filiere
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public filiere()
+        {
+            this.mefs = new HashSet<mef>();
+        }
+    
+        public int id { get; set; }
+        public string nom { get; set; }
+        public string libelle { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<mef> mefs { get; set; }
+    }
+}

+ 32 - 0
CD67.FicheCollege.Entity/matiereoption.cs

@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class matiereoption
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public matiereoption()
+        {
+            this.etaboptionsannees = new HashSet<etaboptionsannee>();
+        }
+    
+        public int id { get; set; }
+        public string code { get; set; }
+        public string nom { get; set; }
+        public string nomcourt { get; set; }
+        public string nomlong { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<etaboptionsannee> etaboptionsannees { get; set; }
+    }
+}

+ 27 - 0
CD67.FicheCollege.Entity/mef.cs

@@ -0,0 +1,27 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class mef
+    {
+        public int id { get; set; }
+        public string code { get; set; }
+        public string mefst11 { get; set; }
+        public string nomcourt { get; set; }
+        public string nomlong { get; set; }
+        public Nullable<int> idniveau { get; set; }
+        public Nullable<int> idfiliere { get; set; }
+    
+        public virtual filiere filiere { get; set; }
+    }
+}

+ 19 - 2
CD67.FicheCollege.MVC/Controllers/CollegesController.cs

@@ -3,6 +3,8 @@ using System.Web.Mvc;
 using CD67.FicheCollege.Entity;
 using CD67.FicheCollege.Factory;
 using CD67.FicheCollege.MVC.Models;
+using System.Linq;
+using System.Collections.Generic;
 
 namespace CD67.FicheCollege.MVC.Controllers
 {
@@ -47,11 +49,26 @@ namespace CD67.FicheCollege.MVC.Controllers
                 etablissement educf_etablissement = educfFact.getByRne(college.CodeRne);
                 if (educf_etablissement != null)
                 {
-                    college.educfData.Add("commune", educf_etablissement.rue.commune.nom);
+                    college.educfData.Add("Effectifs", educf_etablissement.etabeffectifannees.Where(e=>e.annee== college.Annee.AnneeRentree).Sum(e => e.effectif).ToString());
+
+                    List<string> liste_niveaux = new List<string>();
+                    foreach(etabeffectifannee effectif in educf_etablissement.etabeffectifannees.Where(e => e.annee == college.Annee.AnneeRentree).OrderBy(e=>e.niveau.ordre))
+                    {
+                        liste_niveaux.Add(effectif.niveau.nom + ": " + effectif.effectif);
+                    }
+                    college.educfData.Add("Niveaux", string.Join(" - ", liste_niveaux));
+
+                    List<string> liste_options = new List<string>();
+                    foreach (etaboptionsannee opt in educf_etablissement.etaboptionsannees)
+                    {
+                        liste_options.Add(opt.matiereoption.nom);
+                    }
+                    college.educfData.Add("Options", string.Join(" - ", liste_options));
+
                 }
                 else
                 {
-                    college.educfData.Add("commune", "Pas de données");
+                    college.educfData.Add("Données Educ'Facile", "(Données introuvables)");
                 }
             }