Browse Source

Mise à jour de la base et de l'edmx

olivier.massot 7 years ago
parent
commit
7d548ea903

+ 5 - 0
CD67.FicheCollege.BDD/Annees.sql

@@ -0,0 +1,5 @@
+CREATE TABLE [dbo].[Annees] (
+    [Id] int IDENTITY(1,1) NOT NULL  PRIMARY KEY,
+    [Libelle] nvarchar(12)  NOT NULL
+);
+

+ 7 - 0
CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.refactorlog

@@ -84,4 +84,11 @@
     <Property Name="ParentElementType" Value="SqlTable" />
     <Property Name="NewName" Value="Action" />
   </Operation>
+  <Operation Name="Rename Refactor" Key="845f4240-dd04-4510-afce-e01d0ff501bc" ChangeDateTime="02/01/2018 09:41:57">
+    <Property Name="ElementName" Value="[dbo].[Annees].[libelle]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Annees]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Libelle" />
+  </Operation>
 </Operations>

+ 1 - 0
CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj

@@ -65,6 +65,7 @@
     <Build Include="Colleges.sql" />
     <Build Include="Identites.sql" />
     <Build Include="Actions-CLAS.sql" />
+    <Build Include="Annees.sql" />
   </ItemGroup>
   <ItemGroup>
     <RefactorLog Include="CD67.FicheCollege.BDD.refactorlog" />

+ 3 - 1
CD67.FicheCollege.BDD/Colleges.sql

@@ -14,6 +14,8 @@
 	[Tel] NVARCHAR(255) NULL,
 	[Fax] NVARCHAR(255) NULL,
 	[Email] NVARCHAR(255) NULL,
+    [Annee_Id] int  NOT NULL
     CONSTRAINT [FK_Colleges_TypesCollege] FOREIGN KEY ([TypeCollege_Id]) REFERENCES [TypesCollege]([Id]), 
-    CONSTRAINT [FK_Colleges_Territoires] FOREIGN KEY ([Territoire_Id]) REFERENCES [Territoires]([Id])
+    CONSTRAINT [FK_Colleges_Territoires] FOREIGN KEY ([Territoire_Id]) REFERENCES [Territoires]([Id]),
+    CONSTRAINT [FK_Annees_Colleges] FOREIGN KEY ([Annee_Id]) REFERENCES [Annees]([Id])
 )

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

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <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 Annee
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public Annee()
+        {
+            this.Colleges = new HashSet<College>();
+        }
+    
+        public int Id { get; set; }
+        public string Libelle { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<College> Colleges { get; set; }
+    }
+}

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

@@ -62,6 +62,9 @@
     <Compile Include="ActionCLAS.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>
+    <Compile Include="Annee.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="College.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>

+ 2 - 0
CD67.FicheCollege.Entity/College.cs

@@ -28,10 +28,12 @@ namespace CD67.FicheCollege.Entity
         public string Tel { get; set; }
         public string Fax { get; set; }
         public string Email { get; set; }
+        public int Annee_Id { get; set; }
     
         public virtual Territoire Territoire { get; set; }
         public virtual TypeCollege TypeCollege { get; set; }
         public virtual Identite Identite { get; set; }
+        public virtual Annee Annee { get; set; }
         public virtual ActionCLAS Actions_CLAS { get; set; }
     }
 }

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

@@ -29,6 +29,7 @@ namespace CD67.FicheCollege.Entity
         public virtual DbSet<Territoire> Territoires { get; set; }
         public virtual DbSet<College> Colleges { get; set; }
         public virtual DbSet<Identite> Identites { get; set; }
-        public virtual DbSet<ActionCLAS> ActionsCLAS { get; set; }
+        public virtual DbSet<Annee> Annees { get; set; }
+        public virtual DbSet<ActionCLAS> ActionCLAS { get; set; }
     }
 }

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

@@ -1,4 +1,4 @@
-// La génération de code T4 est activée pour le modèle 'C:\Users\julien.legrand\Documents\Developpements\FicheCollege_new\CD67.FicheCollege.Entity\EntityModel.edmx'. 
+// La génération de code T4 est activée pour le modèle 'C:\dev\dotnet\FicheCollege\CD67.FicheCollege.Entity\EntityModel.edmx'. 
 // Pour activer la génération de code héritée, définissez la valeur de la propriété
 // du concepteur 'Stratégie de génération de code' sur 'ObjectContext hérité'. Cette propriété est disponible dans la fenêtre Propriétés lorsque le modèle
 //  est ouvert dans le concepteur.

+ 146 - 85
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -4,7 +4,7 @@
   <edmx:Runtime>
     <!-- SSDL content -->
     <edmx:StorageModels>
-    <Schema Namespace="ModeleMVC.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
+    <Schema Namespace="CD67.FicheCollege.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
         <EntityType Name="Actions-CLAS">
           <Key>
             <PropertyRef Name="College_Id" />
@@ -13,6 +13,13 @@
           <Property Name="Action" Type="bit" />
           <Property Name="Commentaire" Type="ntext" />
         </EntityType>
+        <EntityType Name="Annees">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Libelle" Type="nvarchar" MaxLength="12" Nullable="false" />
+        </EntityType>
         <EntityType Name="Colleges">
           <Key>
             <PropertyRef Name="Id" />
@@ -31,6 +38,7 @@
           <Property Name="Tel" Type="nvarchar" MaxLength="255" />
           <Property Name="Fax" Type="nvarchar" MaxLength="255" />
           <Property Name="Email" Type="nvarchar" MaxLength="255" />
+          <Property Name="Annee_Id" Type="int" Nullable="false" />
         </EntityType>
         <EntityType Name="Identites">
           <Key>
@@ -100,6 +108,18 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_Annees_Colleges">
+          <End Role="Annees" Type="Self.Annees" Multiplicity="1" />
+          <End Role="Colleges" Type="Self.Colleges" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Annees">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="Colleges">
+              <PropertyRef Name="Annee_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_Colleges_Territoires">
           <End Role="Territoires" Type="Self.Territoires" Multiplicity="0..1" />
           <End Role="Colleges" Type="Self.Colleges" Multiplicity="*" />
@@ -136,8 +156,9 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <EntityContainer Name="ModeleMVCStoreContainer">
+        <EntityContainer Name="CD67FicheCollegeStoreContainer">
           <EntitySet Name="Actions-CLAS" EntityType="Self.Actions-CLAS" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="Annees" EntityType="Self.Annees" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Colleges" EntityType="Self.Colleges" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Identites" EntityType="Self.Identites" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Territoires" EntityType="Self.Territoires" Schema="dbo" store:Type="Tables" />
@@ -146,6 +167,10 @@
             <End Role="Colleges" EntitySet="Colleges" />
             <End Role="Actions-CLAS" EntitySet="Actions-CLAS" />
           </AssociationSet>
+          <AssociationSet Name="FK_Annees_Colleges" Association="Self.FK_Annees_Colleges">
+            <End Role="Annees" EntitySet="Annees" />
+            <End Role="Colleges" EntitySet="Colleges" />
+          </AssociationSet>
           <AssociationSet Name="FK_Colleges_Territoires" Association="Self.FK_Colleges_Territoires">
             <End Role="Territoires" EntitySet="Territoires" />
             <End Role="Colleges" EntitySet="Colleges" />
@@ -180,10 +205,15 @@
             <End Role="College" EntitySet="Colleges" />
             <End Role="Identite" EntitySet="Identites" />
           </AssociationSet>
-          <EntitySet Name="ActionsCLAS" EntityType="CD67.FicheCollege.ActionCLAS" />
+          <EntitySet Name="Annees" EntityType="CD67.FicheCollege.Annee" />
+          <AssociationSet Name="AnneeCollege" Association="CD67.FicheCollege.AnneeCollege">
+            <End Role="Annee" EntitySet="Annees" />
+            <End Role="College" EntitySet="Colleges" />
+          </AssociationSet>
+          <EntitySet Name="ActionCLAS" EntityType="CD67.FicheCollege.ActionCLAS" />
           <AssociationSet Name="FK_Actions_CLAS_College" Association="CD67.FicheCollege.FK_Actions_CLAS_College">
             <End Role="College" EntitySet="Colleges" />
-            <End Role="Actions_CLAS" EntitySet="ActionsCLAS" />
+            <End Role="Actions_CLAS" EntitySet="ActionCLAS" />
           </AssociationSet>
           </EntityContainer>
         <EntityType Name="TypeCollege">
@@ -231,6 +261,8 @@
           <NavigationProperty Name="Territoire" Relationship="CD67.FicheCollege.FK_Colleges_Territoires" FromRole="College" ToRole="Territoire" />
           <NavigationProperty Name="TypeCollege" Relationship="CD67.FicheCollege.FK_Colleges_TypesCollege" FromRole="College" ToRole="TypeCollege" />
           <NavigationProperty Name="Identite" Relationship="CD67.FicheCollege.FK_FicheIdentite_College" FromRole="College" ToRole="Identite" />
+          <NavigationProperty Name="Annee" Relationship="CD67.FicheCollege.AnneeCollege" FromRole="College" ToRole="Annee" />
+          <Property Name="Annee_Id" Type="Int32" Nullable="false" />
           <NavigationProperty Name="Actions_CLAS" Relationship="CD67.FicheCollege.FK_Actions_CLAS_College" FromRole="College" ToRole="Actions_CLAS" />
         </EntityType>
         <Association Name="FK_Colleges_Territoires">
@@ -304,6 +336,26 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityType Name="Annee">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <NavigationProperty Name="Colleges" Relationship="CD67.FicheCollege.AnneeCollege" FromRole="Annee" ToRole="College" />
+          <Property Name="Libelle" Type="String" Nullable="false" MaxLength="12" FixedLength="false" Unicode="true" />
+        </EntityType>
+        <Association Name="AnneeCollege">
+          <End Type="CD67.FicheCollege.Annee" Role="Annee" Multiplicity="1" />
+          <End Type="CD67.FicheCollege.College" Role="College" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Annee">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="College">
+              <PropertyRef Name="Annee_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <EntityType Name="ActionCLAS">
           <Key>
             <PropertyRef Name="College_Id" />
@@ -330,87 +382,96 @@
     <!-- C-S mapping content -->
     <edmx:Mappings>
     <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
-  <EntityContainerMapping StorageEntityContainer="ModeleMVCStoreContainer" CdmEntityContainer="Entities">
-          <EntitySetMapping Name="TypesCollege">
-            <EntityTypeMapping TypeName="CD67.FicheCollege.TypeCollege">
-              <MappingFragment StoreEntitySet="TypesCollege">
-                <ScalarProperty Name="Ordre" ColumnName="Ordre" />
-                <ScalarProperty Name="Libelle" ColumnName="Libelle" />
-                <ScalarProperty Name="Id" ColumnName="Id" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Territoires">
-            <EntityTypeMapping TypeName="CD67.FicheCollege.Territoire">
-              <MappingFragment StoreEntitySet="Territoires">
-                <ScalarProperty Name="Ordre" ColumnName="Ordre" />
-                <ScalarProperty Name="Referent_Email" ColumnName="Referent_Email" />
-                <ScalarProperty Name="Referent_Login" ColumnName="Referent_Login" />
-                <ScalarProperty Name="Referent_Structure" ColumnName="Referent_Structure" />
-                <ScalarProperty Name="Referent_Prenom" ColumnName="Referent_Prenom" />
-                <ScalarProperty Name="Referent_Nom" ColumnName="Referent_Nom" />
-                <ScalarProperty Name="Referent_SID" ColumnName="Referent_SID" />
-                <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+  <EntityContainerMapping StorageEntityContainer="CD67FicheCollegeStoreContainer" CdmEntityContainer="Entities">
+    <EntitySetMapping Name="TypesCollege">
+      <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.TypeCollege)">
+        <MappingFragment StoreEntitySet="TypesCollege">
+          <ScalarProperty Name="Id" ColumnName="Id" />
+          <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+          <ScalarProperty Name="Ordre" ColumnName="Ordre" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Territoires">
+      <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.Territoire)">
+        <MappingFragment StoreEntitySet="Territoires">
+          <ScalarProperty Name="Id" ColumnName="Id" />
+          <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+          <ScalarProperty Name="Referent_SID" ColumnName="Referent_SID" />
+          <ScalarProperty Name="Referent_Nom" ColumnName="Referent_Nom" />
+          <ScalarProperty Name="Referent_Prenom" ColumnName="Referent_Prenom" />
+          <ScalarProperty Name="Referent_Structure" ColumnName="Referent_Structure" />
+          <ScalarProperty Name="Referent_Login" ColumnName="Referent_Login" />
+          <ScalarProperty Name="Referent_Email" ColumnName="Referent_Email" />
+          <ScalarProperty Name="Ordre" ColumnName="Ordre" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Colleges">
+      <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.College)">
+        <MappingFragment StoreEntitySet="Colleges">
+          <ScalarProperty Name="Id" ColumnName="Id" />
+          <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+          <ScalarProperty Name="Adresse" ColumnName="Adresse" />
+          <ScalarProperty Name="Code_Postal" ColumnName="Code_Postal" />
+          <ScalarProperty Name="TypeCollege_Id" ColumnName="TypeCollege_Id" />
+          <ScalarProperty Name="Commune_Insee" ColumnName="Commune_Insee" />
+          <ScalarProperty Name="Commune" ColumnName="Commune" />
+          <ScalarProperty Name="Canton" ColumnName="Canton" />
+          <ScalarProperty Name="Territoire_Id" ColumnName="Territoire_Id" />
+          <ScalarProperty Name="TAD" ColumnName="TAD" />
+          <ScalarProperty Name="CDC" ColumnName="CDC" />
+          <ScalarProperty Name="Tel" ColumnName="Tel" />
+          <ScalarProperty Name="Fax" ColumnName="Fax" />
+          <ScalarProperty Name="Email" ColumnName="Email" />
+          <ScalarProperty Name="Annee_Id" ColumnName="Annee_Id" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Identites">
+      <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.Identite)">
+        <MappingFragment StoreEntitySet="Identites">
+          <ScalarProperty Name="College_Id" ColumnName="College_Id" />
+          <ScalarProperty Name="Principal_SID" ColumnName="Principal_SID" />
+          <ScalarProperty Name="Principal_Login" ColumnName="Principal_Login" />
+          <ScalarProperty Name="Principal_Nom" ColumnName="Principal_Nom" />
+          <ScalarProperty Name="Principal_Prenom" ColumnName="Principal_Prenom" />
+          <ScalarProperty Name="Principal_Email" ColumnName="Principal_Email" />
+          <ScalarProperty Name="Principal_Tel" ColumnName="Principal_Tel" />
+          <ScalarProperty Name="Principal_Structure" ColumnName="Principal_Structure" />
+          <ScalarProperty Name="Adjoint_SID" ColumnName="Adjoint_SID" />
+          <ScalarProperty Name="Adjoint_Login" ColumnName="Adjoint_Login" />
+          <ScalarProperty Name="Adjoint_Nom" ColumnName="Adjoint_Nom" />
+          <ScalarProperty Name="Adjoint_Prenom" ColumnName="Adjoint_Prenom" />
+          <ScalarProperty Name="Adjoint_Email" ColumnName="Adjoint_Email" />
+          <ScalarProperty Name="Adjoint_Tel" ColumnName="Adjoint_Tel" />
+          <ScalarProperty Name="Adjoint_Structure" ColumnName="Adjoint_Structure" />
+          <ScalarProperty Name="Gestionnaire_SID" ColumnName="Gestionnaire_SID" />
+          <ScalarProperty Name="Gestionnaire_Login" ColumnName="Gestionnaire_Login" />
+          <ScalarProperty Name="Gestionnaire_Nom" ColumnName="Gestionnaire_Nom" />
+          <ScalarProperty Name="Gestionnaire_Prenom" ColumnName="Gestionnaire_Prenom" />
+          <ScalarProperty Name="Gestionnaire_Email" ColumnName="Gestionnaire_Email" />
+          <ScalarProperty Name="Gestionnaire_Tel" ColumnName="Gestionnaire_Tel" />
+          <ScalarProperty Name="Gestionnaire_Structure" ColumnName="Gestionnaire_Structure" />
+          <ScalarProperty Name="Gestionnaire2_SID" ColumnName="Gestionnaire2_SID" />
+          <ScalarProperty Name="Gestionnaire2_Login" ColumnName="Gestionnaire2_Login" />
+          <ScalarProperty Name="Gestionnaire2_Nom" ColumnName="Gestionnaire2_Nom" />
+          <ScalarProperty Name="Gestionnaire2_Prenom" ColumnName="Gestionnaire2_Prenom" />
+          <ScalarProperty Name="Gestionnaire2_Email" ColumnName="Gestionnaire2_Email" />
+          <ScalarProperty Name="Gestionnaire2_Tel" ColumnName="Gestionnaire2_Tel" />
+          <ScalarProperty Name="Gestionnaire2_Structure" ColumnName="Gestionnaire2_Structure" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="Annees">
+      <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.Annee)">
+        <MappingFragment StoreEntitySet="Annees">
+          <ScalarProperty Name="Libelle" ColumnName="Libelle" />
                 <ScalarProperty Name="Id" ColumnName="Id" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Colleges">
-            <EntityTypeMapping TypeName="CD67.FicheCollege.College">
-              <MappingFragment StoreEntitySet="Colleges">
-                <ScalarProperty Name="Email" ColumnName="Email" />
-                <ScalarProperty Name="Fax" ColumnName="Fax" />
-                <ScalarProperty Name="Tel" ColumnName="Tel" />
-                <ScalarProperty Name="CDC" ColumnName="CDC" />
-                <ScalarProperty Name="TAD" ColumnName="TAD" />
-                <ScalarProperty Name="Territoire_Id" ColumnName="Territoire_Id" />
-                <ScalarProperty Name="Canton" ColumnName="Canton" />
-                <ScalarProperty Name="Commune" ColumnName="Commune" />
-                <ScalarProperty Name="Commune_Insee" ColumnName="Commune_Insee" />
-                <ScalarProperty Name="TypeCollege_Id" ColumnName="TypeCollege_Id" />
-                <ScalarProperty Name="Code_Postal" ColumnName="Code_Postal" />
-                <ScalarProperty Name="Adresse" ColumnName="Adresse" />
-                <ScalarProperty Name="Libelle" ColumnName="Libelle" />
-                <ScalarProperty Name="Id" ColumnName="Id" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="Identites">
-            <EntityTypeMapping TypeName="CD67.FicheCollege.Identite">
-              <MappingFragment StoreEntitySet="Identites">
-                <ScalarProperty Name="Gestionnaire2_Structure" ColumnName="Gestionnaire2_Structure" />
-                <ScalarProperty Name="Gestionnaire2_Tel" ColumnName="Gestionnaire2_Tel" />
-                <ScalarProperty Name="Gestionnaire2_Email" ColumnName="Gestionnaire2_Email" />
-                <ScalarProperty Name="Gestionnaire2_Prenom" ColumnName="Gestionnaire2_Prenom" />
-                <ScalarProperty Name="Gestionnaire2_Nom" ColumnName="Gestionnaire2_Nom" />
-                <ScalarProperty Name="Gestionnaire2_Login" ColumnName="Gestionnaire2_Login" />
-                <ScalarProperty Name="Gestionnaire2_SID" ColumnName="Gestionnaire2_SID" />
-                <ScalarProperty Name="Gestionnaire_Structure" ColumnName="Gestionnaire_Structure" />
-                <ScalarProperty Name="Gestionnaire_Tel" ColumnName="Gestionnaire_Tel" />
-                <ScalarProperty Name="Gestionnaire_Email" ColumnName="Gestionnaire_Email" />
-                <ScalarProperty Name="Gestionnaire_Prenom" ColumnName="Gestionnaire_Prenom" />
-                <ScalarProperty Name="Gestionnaire_Nom" ColumnName="Gestionnaire_Nom" />
-                <ScalarProperty Name="Gestionnaire_Login" ColumnName="Gestionnaire_Login" />
-                <ScalarProperty Name="Gestionnaire_SID" ColumnName="Gestionnaire_SID" />
-                <ScalarProperty Name="Adjoint_Structure" ColumnName="Adjoint_Structure" />
-                <ScalarProperty Name="Adjoint_Tel" ColumnName="Adjoint_Tel" />
-                <ScalarProperty Name="Adjoint_Email" ColumnName="Adjoint_Email" />
-                <ScalarProperty Name="Adjoint_Prenom" ColumnName="Adjoint_Prenom" />
-                <ScalarProperty Name="Adjoint_Nom" ColumnName="Adjoint_Nom" />
-                <ScalarProperty Name="Adjoint_Login" ColumnName="Adjoint_Login" />
-                <ScalarProperty Name="Adjoint_SID" ColumnName="Adjoint_SID" />
-                <ScalarProperty Name="Principal_Structure" ColumnName="Principal_Structure" />
-                <ScalarProperty Name="Principal_Tel" ColumnName="Principal_Tel" />
-                <ScalarProperty Name="Principal_Email" ColumnName="Principal_Email" />
-                <ScalarProperty Name="Principal_Prenom" ColumnName="Principal_Prenom" />
-                <ScalarProperty Name="Principal_Nom" ColumnName="Principal_Nom" />
-                <ScalarProperty Name="Principal_Login" ColumnName="Principal_Login" />
-                <ScalarProperty Name="Principal_SID" ColumnName="Principal_SID" />
-                <ScalarProperty Name="College_Id" ColumnName="College_Id" />
-              </MappingFragment>
-            </EntityTypeMapping>
-          </EntitySetMapping>
-          <EntitySetMapping Name="ActionsCLAS">
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+          <EntitySetMapping Name="ActionCLAS">
             <EntityTypeMapping TypeName="CD67.FicheCollege.ActionCLAS">
               <MappingFragment StoreEntitySet="Actions-CLAS">
                 <ScalarProperty Name="Commentaire" ColumnName="Commentaire" />
@@ -419,7 +480,7 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-        </EntityContainerMapping>
+  </EntityContainerMapping>
 </Mapping></edmx:Mappings>
   </edmx:Runtime>
   <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->

+ 7 - 5
CD67.FicheCollege.Entity/EntityModel.edmx.diagram

@@ -5,14 +5,16 @@
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
       <Diagram DiagramId="86b727c7572a49c5b7e8139c8d489465" Name="Diagram1">
-        <EntityTypeShape EntityType="CD67.FicheCollege.TypeCollege" Width="1.5" PointX="0.75" PointY="0.75" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.Territoire" Width="1.5" PointX="0.75" PointY="2.75" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.College" Width="1.5" PointX="3" PointY="1.125" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.TypeCollege" Width="1.5" PointX="0.625" PointY="2.25" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.Territoire" Width="1.5" PointX="0.75" PointY="4.375" />
+        <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.Identite" Width="1.875" PointX="5.125" PointY="1.125" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.Identite" Width="1.875" PointX="5.5" PointY="3.875" />
         <AssociationConnector Association="CD67.FicheCollege.FK_FicheIdentite_College" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionCLAS" Width="1.5" PointX="7.5" PointY="1.125" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.Annee" Width="1.5" PointX="3" PointY="0.5" />
+        <AssociationConnector Association="CD67.FicheCollege.AnneeCollege" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionCLAS" Width="1.5" PointX="6.125" PointY="1.125" />
         <AssociationConnector Association="CD67.FicheCollege.FK_Actions_CLAS_College" />
         </Diagram>
     </edmx:Diagrams>

+ 197 - 36
CD67.FicheCollege.Entity/EntityModel.edmx.sql

@@ -2,13 +2,13 @@
 -- --------------------------------------------------
 -- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
 -- --------------------------------------------------
--- Date Created: 08/22/2017 15:00:11
--- Generated from EDMX file: C:\dev\dotnet\ModeleMVC\CD67.FicheCollege.Entity\EntityModel.edmx
+-- Date Created: 02/01/2018 10:35:41
+-- Generated from EDMX file: C:\dev\dotnet\FicheCollege\CD67.FicheCollege.Entity\EntityModel.edmx
 -- --------------------------------------------------
 
 SET QUOTED_IDENTIFIER OFF;
 GO
-USE [ModeleMVC];
+USE [FicheCollege];
 GO
 IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
 GO
@@ -17,42 +17,131 @@ GO
 -- Dropping existing FOREIGN KEY constraints
 -- --------------------------------------------------
 
-IF OBJECT_ID(N'[dbo].[FK_TypesVikingVikings]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[Vikings] DROP CONSTRAINT [FK_TypesVikingVikings];
+IF OBJECT_ID(N'[dbo].[FK_Actions-CLAS_College]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Actions-CLAS] DROP CONSTRAINT [FK_Actions-CLAS_College];
+GO
+IF OBJECT_ID(N'[dbo].[FK_Colleges_Territoires]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Colleges] DROP CONSTRAINT [FK_Colleges_Territoires];
+GO
+IF OBJECT_ID(N'[dbo].[FK_Colleges_TypesCollege]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Colleges] DROP CONSTRAINT [FK_Colleges_TypesCollege];
+GO
+IF OBJECT_ID(N'[dbo].[FK_FicheIdentite_College]', 'F') IS NOT NULL
+    ALTER TABLE [dbo].[Identites] DROP CONSTRAINT [FK_FicheIdentite_College];
 GO
 
 -- --------------------------------------------------
 -- Dropping existing tables
 -- --------------------------------------------------
 
-IF OBJECT_ID(N'[dbo].[TypesViking]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[TypesViking];
+IF OBJECT_ID(N'[dbo].[Actions-CLAS]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[Actions-CLAS];
+GO
+IF OBJECT_ID(N'[dbo].[Colleges]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[Colleges];
+GO
+IF OBJECT_ID(N'[dbo].[Identites]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[Identites];
+GO
+IF OBJECT_ID(N'[dbo].[Territoires]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[Territoires];
 GO
-IF OBJECT_ID(N'[dbo].[Vikings]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[Vikings];
+IF OBJECT_ID(N'[dbo].[TypesCollege]', 'U') IS NOT NULL
+    DROP TABLE [dbo].[TypesCollege];
 GO
 
 -- --------------------------------------------------
 -- Creating all tables
 -- --------------------------------------------------
 
--- Creating table 'TypesViking'
-CREATE TABLE [dbo].[TypesViking] (
+-- Creating table 'TypesCollege'
+CREATE TABLE [dbo].[TypesCollege] (
     [Id] int IDENTITY(1,1) NOT NULL,
-    [Libelle] nvarchar(100)  NOT NULL
+    [Libelle] nvarchar(255)  NOT NULL,
+    [Ordre] int  NOT NULL
+);
+GO
+
+-- Creating table 'Territoires'
+CREATE TABLE [dbo].[Territoires] (
+    [Id] nvarchar(10)  NOT NULL,
+    [Libelle] nvarchar(255)  NOT NULL,
+    [Referent_SID] nvarchar(64)  NULL,
+    [Referent_Nom] nvarchar(255)  NULL,
+    [Referent_Prenom] nvarchar(255)  NULL,
+    [Referent_Structure] nvarchar(255)  NULL,
+    [Referent_Login] nvarchar(255)  NULL,
+    [Referent_Email] nvarchar(255)  NULL,
+    [Ordre] int  NOT NULL
+);
+GO
+
+-- Creating table 'Colleges'
+CREATE TABLE [dbo].[Colleges] (
+    [Id] nvarchar(8)  NOT NULL,
+    [Libelle] nvarchar(255)  NOT NULL,
+    [Adresse] nvarchar(255)  NULL,
+    [Code_Postal] nvarchar(5)  NULL,
+    [TypeCollege_Id] int  NOT NULL,
+    [Commune_Insee] nvarchar(5)  NULL,
+    [Commune] nvarchar(255)  NOT NULL,
+    [Canton] nvarchar(255)  NULL,
+    [Territoire_Id] nvarchar(10)  NULL,
+    [TAD] nvarchar(255)  NULL,
+    [CDC] nvarchar(255)  NULL,
+    [Tel] nvarchar(255)  NULL,
+    [Fax] nvarchar(255)  NULL,
+    [Email] nvarchar(255)  NULL,
+    [Annee_Id] int  NOT NULL
 );
 GO
 
--- Creating table 'Vikings'
-CREATE TABLE [dbo].[Vikings] (
+-- Creating table 'Identites'
+CREATE TABLE [dbo].[Identites] (
+    [College_Id] nvarchar(8)  NOT NULL,
+    [Principal_SID] nvarchar(64)  NULL,
+    [Principal_Login] nvarchar(255)  NULL,
+    [Principal_Nom] nvarchar(255)  NULL,
+    [Principal_Prenom] nvarchar(255)  NULL,
+    [Principal_Email] nvarchar(255)  NULL,
+    [Principal_Tel] nvarchar(255)  NULL,
+    [Principal_Structure] nvarchar(255)  NULL,
+    [Adjoint_SID] nvarchar(64)  NULL,
+    [Adjoint_Login] nvarchar(255)  NULL,
+    [Adjoint_Nom] nvarchar(255)  NULL,
+    [Adjoint_Prenom] nvarchar(255)  NULL,
+    [Adjoint_Email] nvarchar(255)  NULL,
+    [Adjoint_Tel] nvarchar(255)  NULL,
+    [Adjoint_Structure] nvarchar(255)  NULL,
+    [Gestionnaire_SID] nvarchar(64)  NULL,
+    [Gestionnaire_Login] nvarchar(255)  NULL,
+    [Gestionnaire_Nom] nvarchar(255)  NULL,
+    [Gestionnaire_Prenom] nvarchar(255)  NULL,
+    [Gestionnaire_Email] nvarchar(255)  NULL,
+    [Gestionnaire_Tel] nvarchar(255)  NULL,
+    [Gestionnaire_Structure] nvarchar(255)  NULL,
+    [Gestionnaire2_SID] nvarchar(64)  NULL,
+    [Gestionnaire2_Login] nvarchar(255)  NULL,
+    [Gestionnaire2_Nom] nvarchar(255)  NULL,
+    [Gestionnaire2_Prenom] nvarchar(255)  NULL,
+    [Gestionnaire2_Email] nvarchar(255)  NULL,
+    [Gestionnaire2_Tel] nvarchar(255)  NULL,
+    [Gestionnaire2_Structure] nvarchar(255)  NULL
+);
+GO
+
+-- Creating table 'ActionsCLAS'
+CREATE TABLE [dbo].[ActionsCLAS] (
+    [College_Id] nvarchar(8)  NOT NULL,
+    [Action] bit  NULL,
+    [Commentaire] nvarchar(max)  NULL
+);
+GO
+
+-- Creating table 'Annees'
+CREATE TABLE [dbo].[Annees] (
     [Id] int IDENTITY(1,1) NOT NULL,
-    [Nom] nvarchar(100)  NOT NULL,
-    [CasqueCornu] bit  NOT NULL,
-    [NombreVictoires] int  NULL,
-    [Description] nvarchar(max)  NULL,
-    [DateCreation] datetime  NOT NULL,
-    [DateEdition] datetime  NOT NULL,
-    [TypeVikingId] int  NOT NULL
+    [libelle] nvarchar(max)  NOT NULL
 );
 GO
 
@@ -60,15 +149,39 @@ GO
 -- Creating all PRIMARY KEY constraints
 -- --------------------------------------------------
 
--- Creating primary key on [Id] in table 'TypesViking'
-ALTER TABLE [dbo].[TypesViking]
-ADD CONSTRAINT [PK_TypesViking]
+-- Creating primary key on [Id] in table 'TypesCollege'
+ALTER TABLE [dbo].[TypesCollege]
+ADD CONSTRAINT [PK_TypesCollege]
+    PRIMARY KEY CLUSTERED ([Id] ASC);
+GO
+
+-- Creating primary key on [Id] in table 'Territoires'
+ALTER TABLE [dbo].[Territoires]
+ADD CONSTRAINT [PK_Territoires]
+    PRIMARY KEY CLUSTERED ([Id] ASC);
+GO
+
+-- Creating primary key on [Id] in table 'Colleges'
+ALTER TABLE [dbo].[Colleges]
+ADD CONSTRAINT [PK_Colleges]
     PRIMARY KEY CLUSTERED ([Id] ASC);
 GO
 
--- Creating primary key on [Id] in table 'Vikings'
-ALTER TABLE [dbo].[Vikings]
-ADD CONSTRAINT [PK_Vikings]
+-- Creating primary key on [College_Id] in table 'Identites'
+ALTER TABLE [dbo].[Identites]
+ADD CONSTRAINT [PK_Identites]
+    PRIMARY KEY CLUSTERED ([College_Id] ASC);
+GO
+
+-- Creating primary key on [College_Id] in table 'ActionsCLAS'
+ALTER TABLE [dbo].[ActionsCLAS]
+ADD CONSTRAINT [PK_ActionsCLAS]
+    PRIMARY KEY CLUSTERED ([College_Id] ASC);
+GO
+
+-- Creating primary key on [Id] in table 'Annees'
+ALTER TABLE [dbo].[Annees]
+ADD CONSTRAINT [PK_Annees]
     PRIMARY KEY CLUSTERED ([Id] ASC);
 GO
 
@@ -76,19 +189,67 @@ GO
 -- Creating all FOREIGN KEY constraints
 -- --------------------------------------------------
 
--- Creating foreign key on [TypeVikingId] in table 'Vikings'
-ALTER TABLE [dbo].[Vikings]
-ADD CONSTRAINT [FK_TypeVikingViking]
-    FOREIGN KEY ([TypeVikingId])
-    REFERENCES [dbo].[TypesViking]
+-- Creating foreign key on [Territoire_Id] in table 'Colleges'
+ALTER TABLE [dbo].[Colleges]
+ADD CONSTRAINT [FK_Colleges_Territoires]
+    FOREIGN KEY ([Territoire_Id])
+    REFERENCES [dbo].[Territoires]
+        ([Id])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_Colleges_Territoires'
+CREATE INDEX [IX_FK_Colleges_Territoires]
+ON [dbo].[Colleges]
+    ([Territoire_Id]);
+GO
+
+-- Creating foreign key on [TypeCollege_Id] in table 'Colleges'
+ALTER TABLE [dbo].[Colleges]
+ADD CONSTRAINT [FK_Colleges_TypesCollege]
+    FOREIGN KEY ([TypeCollege_Id])
+    REFERENCES [dbo].[TypesCollege]
+        ([Id])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating non-clustered index for FOREIGN KEY 'FK_Colleges_TypesCollege'
+CREATE INDEX [IX_FK_Colleges_TypesCollege]
+ON [dbo].[Colleges]
+    ([TypeCollege_Id]);
+GO
+
+-- Creating foreign key on [College_Id] in table 'Identites'
+ALTER TABLE [dbo].[Identites]
+ADD CONSTRAINT [FK_FicheIdentite_College]
+    FOREIGN KEY ([College_Id])
+    REFERENCES [dbo].[Colleges]
+        ([Id])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating foreign key on [College_Id] in table 'ActionsCLAS'
+ALTER TABLE [dbo].[ActionsCLAS]
+ADD CONSTRAINT [FK_Actions_CLAS_College]
+    FOREIGN KEY ([College_Id])
+    REFERENCES [dbo].[Colleges]
+        ([Id])
+    ON DELETE NO ACTION ON UPDATE NO ACTION;
+GO
+
+-- Creating foreign key on [Annee_Id] in table 'Colleges'
+ALTER TABLE [dbo].[Colleges]
+ADD CONSTRAINT [FK_AnneeCollege]
+    FOREIGN KEY ([Annee_Id])
+    REFERENCES [dbo].[Annees]
         ([Id])
     ON DELETE NO ACTION ON UPDATE NO ACTION;
 GO
 
--- Creating non-clustered index for FOREIGN KEY 'FK_TypeVikingViking'
-CREATE INDEX [IX_FK_TypeVikingViking]
-ON [dbo].[Vikings]
-    ([TypeVikingId]);
+-- Creating non-clustered index for FOREIGN KEY 'FK_AnneeCollege'
+CREATE INDEX [IX_FK_AnneeCollege]
+ON [dbo].[Colleges]
+    ([Annee_Id]);
 GO
 
 -- --------------------------------------------------

+ 14 - 0
CD67.FicheCollege.Factory/AnneeFactory.cs

@@ -0,0 +1,14 @@
+using CD67.FicheCollege.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Data.Entity;
+
+namespace CD67.FicheCollege.Factory
+{
+    public partial class ActionCLASFactory : Internal.BaseFactory<Entity.ActionCLAS>
+    {
+
+    }
+}

+ 1 - 0
CD67.FicheCollege.Factory/CD67.FicheCollege.Factory.csproj

@@ -54,6 +54,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AnneeFactory.cs" />
     <Compile Include="CollegeFactory.cs" />
     <Compile Include="ActionCLASFactory.cs" />
     <Compile Include="IdentiteFactory.cs" />