Bladeren bron

NEW Ajout de la partie BDD et Factory pour Territoires et Types de collège

julien.legrand 8 jaren geleden
bovenliggende
commit
18486294b7

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

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Operations Version="1.0" xmlns="http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02">
+  <Operation Name="Rename Refactor" Key="747db0c4-c630-4deb-9703-64837498b956" ChangeDateTime="11/24/2017 10:03:54">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[Nom]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="ReferentNom" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="e94032d9-17d3-4795-a12e-0a8220ce352f" ChangeDateTime="11/24/2017 10:04:01">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[Prénom]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="ReferentPrenom" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="eacea97e-6d3e-449b-ab2f-f1b4ed1c3aa3" ChangeDateTime="11/24/2017 10:04:03">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[Structure]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="ReferentStructure" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="f8bfd88e-b4a5-4400-8016-7aba9737f14a" ChangeDateTime="11/24/2017 10:04:05">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[Login]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="ReferentLogin" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="966a74e9-c0dd-43d7-ae4f-c951a9d7b08c" ChangeDateTime="11/24/2017 10:05:02">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[ReferentNom]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Referent_Nom" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="ad56fd49-703e-4d3b-b895-0ded61bee59d" ChangeDateTime="11/24/2017 10:05:04">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[ReferentPrenom]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Referent_Prenom" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="be0373ca-fad3-4137-9183-fb6a3f701f6f" ChangeDateTime="11/24/2017 10:05:06">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[ReferentLogin]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Referent_Login" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="488ceaba-6e3f-4265-900b-f57c6e761cca" ChangeDateTime="11/24/2017 10:05:08">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[ReferentStructure]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Referent_Structure" />
+  </Operation>
+  <Operation Name="Rename Refactor" Key="5550ca8b-5eaf-4ccb-8b08-e5509e257b75" ChangeDateTime="11/24/2017 10:05:16">
+    <Property Name="ElementName" Value="[dbo].[Territoires].[SID]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Territoires]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Referent_SID" />
+  </Operation>
+</Operations>

+ 10 - 2
CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj

@@ -8,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectVersion>4.1</ProjectVersion>
     <ProjectGuid>{104fc704-5a60-4f2b-b52b-4a95fbb7a4ab}</ProjectGuid>
-    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
+    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider</DSP>
     <OutputType>Database</OutputType>
     <RootPath>
     </RootPath>
@@ -17,12 +17,13 @@
     <ModelCollation>1033, CI</ModelCollation>
     <DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
     <DeployToDatabase>True</DeployToDatabase>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <TargetLanguage>CS</TargetLanguage>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <SqlServerVerification>False</SqlServerVerification>
     <IncludeCompositeObjects>True</IncludeCompositeObjects>
     <TargetDatabaseSet>True</TargetDatabaseSet>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <OutputPath>bin\Release\</OutputPath>
@@ -58,4 +59,11 @@
   <ItemGroup>
     <Folder Include="Properties" />
   </ItemGroup>
+  <ItemGroup>
+    <Build Include="TypesCollege.sql" />
+    <Build Include="Territoires.sql" />
+  </ItemGroup>
+  <ItemGroup>
+    <RefactorLog Include="CD67.FicheCollege.BDD.refactorlog" />
+  </ItemGroup>
 </Project>

+ 11 - 0
CD67.FicheCollege.BDD/Territoires.sql

@@ -0,0 +1,11 @@
+CREATE TABLE [dbo].[Territoires]
+(
+	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
+    [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, 
+    [Ordre] INT NOT NULL
+)

+ 6 - 0
CD67.FicheCollege.BDD/TypesCollege.sql

@@ -0,0 +1,6 @@
+CREATE TABLE [dbo].[TypesCollege]
+(
+	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
+    [Libelle] NVARCHAR(255) NOT NULL, 
+    [Ordre] INT NOT NULL
+)

+ 5 - 9
CD67.FicheCollege.Entity/App.config

@@ -2,9 +2,7 @@
 <configuration>
   <!-- Configuration minimale pour avoir accès à la connexion à la base de données pour le Model -->
   <configSections>
-    <section name="entityFramework"
-      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
-      requirePermission="false"/>
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
     <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
   </configSections>
   <entityFramework>
@@ -13,21 +11,19 @@
     -->
     <providers>
       <!--<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>-->
-      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
+      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
     </providers>
     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
       <parameters>
-        <parameter value="mssqllocaldb"/>
+        <parameter value="mssqllocaldb" />
       </parameters>
     </defaultConnectionFactory>
   </entityFramework>
   <connectionStrings>
     <!-- Copie locale de la chaine de connexion pour l'éditeur graphique de modèle -->
-    <add name="ModeleMVCEntities"
-      connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=T-MSSQL-02\SQLSTD2K14;initial catalog=FicheCollege;persist security info=True;user id=FicheCollege_admin;password=bk9JFwqSwYw7mEPiOhnu;MultipleActiveResultSets=True;App=EntityFramework&quot;"
-      providerName="System.Data.EntityClient"/>
+    <add name="Entities" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=T-MSSQL-02\SQLSTD2K14;initial catalog=FicheCollege;persist security info=True;user id=FicheCollege_admin;password=bk9JFwqSwYw7mEPiOhnu;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
   </connectionStrings>
   <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
   </startup>
 </configuration>

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

@@ -74,9 +74,17 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>EntityModel.edmx</DependentUpon>
     </Compile>
+    <Compile Include="Extend\Territoire.cs" />
+    <Compile Include="Extend\TypeCollege.cs" />
     <Compile Include="Internal\Entities.cs" />
     <Compile Include="Internal\FormattedDbEntityValidationException.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Territoire.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="TypeCollege.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config">
@@ -109,9 +117,7 @@
       <LastGenOutput>EntityModel.cs</LastGenOutput>
     </Content>
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Extend\" />
-  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

+ 5 - 3
CD67.FicheCollege.Entity/EntityModel.Context.cs

@@ -13,10 +13,10 @@ namespace CD67.FicheCollege.Entity
     using System.Data.Entity;
     using System.Data.Entity.Infrastructure;
     
-    public partial class ModeleMVCEntities : DbContext
+    public partial class Entities : DbContext
     {
-        public ModeleMVCEntities()
-            : base("name=ModeleMVCEntities")
+        public Entities()
+            : base("name=Entities")
         {
         }
     
@@ -25,5 +25,7 @@ namespace CD67.FicheCollege.Entity
             throw new UnintentionalCodeFirstException();
         }
     
+        public virtual DbSet<Territoire> Territoires { get; set; }
+        public virtual DbSet<TypeCollege> TypesCollege { get; set; }
     }
 }

+ 78 - 9
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -4,22 +4,91 @@
   <edmx:Runtime>
     <!-- SSDL content -->
     <edmx:StorageModels>
-    <Schema Namespace="ModeleMVC.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2012" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
-  <EntityContainer Name="ModeleMVCStoreContainer">
-    </EntityContainer>
-</Schema></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">
+        <EntityType Name="Territoires">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Libelle" Type="nvarchar" MaxLength="255" Nullable="false" />
+          <Property Name="Referent_SID" Type="nvarchar" MaxLength="64" />
+          <Property Name="Referent_Nom" Type="nvarchar" MaxLength="255" />
+          <Property Name="Referent_Prenom" Type="nvarchar" MaxLength="255" />
+          <Property Name="Referent_Structure" Type="nvarchar" MaxLength="255" />
+          <Property Name="Referent_Login" Type="nvarchar" MaxLength="255" />
+          <Property Name="Ordre" Type="int" Nullable="false" />
+        </EntityType>
+        <EntityType Name="TypesCollege">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Libelle" Type="nvarchar" MaxLength="255" Nullable="false" />
+          <Property Name="Ordre" Type="int" Nullable="false" />
+        </EntityType>
+        <EntityContainer Name="ModeleMVCStoreContainer">
+          <EntitySet Name="Territoires" EntityType="Self.Territoires" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="TypesCollege" EntityType="Self.TypesCollege" Schema="dbo" store:Type="Tables" />
+        </EntityContainer>
+      </Schema></edmx:StorageModels>
     <!-- CSDL content -->
     <edmx:ConceptualModels>
-      <Schema Namespace="ModeleMVC" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
-        <EntityContainer Name="ModeleMVCEntities" annotation:LazyLoadingEnabled="true">
+      <Schema Namespace="CD67.FicheCollege" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
+        <EntityContainer Name="Entities" annotation:LazyLoadingEnabled="true">
+          <EntitySet Name="Territoires" EntityType="CD67.FicheCollege.Territoire" />
+          <EntitySet Name="TypesCollege" EntityType="CD67.FicheCollege.TypeCollege" />
         </EntityContainer>
+        <EntityType Name="Territoire">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" />
+          <Property Name="Libelle" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Referent_SID" Type="String" MaxLength="64" FixedLength="false" Unicode="true" />
+          <Property Name="Referent_Nom" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Referent_Prenom" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Referent_Structure" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Referent_Login" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Ordre" Type="Int32" Nullable="false" />
+        </EntityType>
+        <EntityType Name="TypeCollege">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="Libelle" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Ordre" Type="Int32" Nullable="false" />
+        </EntityType>
       </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
     <edmx:Mappings>
     <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
-  <EntityContainerMapping StorageEntityContainer="ModeleMVCStoreContainer" CdmEntityContainer="ModeleMVCEntities">
-  </EntityContainerMapping>
+  <EntityContainerMapping StorageEntityContainer="ModeleMVCStoreContainer" CdmEntityContainer="Entities">
+          <EntitySetMapping Name="Territoires">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.Territoire">
+              <MappingFragment StoreEntitySet="Territoires">
+                <ScalarProperty Name="Ordre" ColumnName="Ordre" />
+                <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" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <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>
+        </EntityContainerMapping>
 </Mapping></edmx:Mappings>
   </edmx:Runtime>
   <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
@@ -32,7 +101,7 @@
     <Options>
       <DesignerInfoPropertySet>
         <DesignerProperty Name="ValidateOnBuild" Value="true" />
-        <DesignerProperty Name="EnablePluralization" Value="false" />
+        <DesignerProperty Name="EnablePluralization" Value="True" />
         <DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
         <DesignerProperty Name="UseLegacyProvider" Value="False" />
         <DesignerProperty Name="CodeGenerationStrategy" Value="Aucun" />

+ 2 - 0
CD67.FicheCollege.Entity/EntityModel.edmx.diagram

@@ -5,6 +5,8 @@
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
       <Diagram DiagramId="86b727c7572a49c5b7e8139c8d489465" Name="Diagram1">
+        <EntityTypeShape EntityType="CD67.FicheCollege.Territoire" Width="1.5" PointX="0.75" PointY="0.75" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.TypeCollege" Width="1.5" PointX="2.75" PointY="0.75" />
       </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 44 - 0
CD67.FicheCollege.Entity/Extend/Territoire.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CD67.FicheCollege.Entity
+{
+    /// <summary>
+    /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
+    /// </summary>
+    [MetadataType(typeof(Territoire_Metadata))]
+    public partial class Territoire
+    {
+        public string Referent => $"{this.Referent_Prenom} {this.Referent_Nom}";
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class Territoire_Metadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public int Id { get; set; }
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Territoire")]
+        public string Libelle { get; set; }
+        [Display(Name = "SID du référent")]
+        public string Referent_SID { get; set; }
+        [Display(Name = "Nom du référent")]
+        public string Referent_Nom { get; set; }
+        [Display(Name = "Prénom du référent")]
+        public string Referent_Prenom { get; set; }
+        [Display(Name = "Structure du référent")]
+        public string Referent_Structure { get; set; }
+        [Display(Name = "Login du référent")]
+        public string Referent_Login { get; set; }
+        public int Ordre { get; set; }
+
+        [Display(Name = "Référent")]
+        public string Referent;
+    }
+}

+ 30 - 0
CD67.FicheCollege.Entity/Extend/TypeCollege.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CD67.FicheCollege.Entity
+{
+    /// <summary>
+    /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
+    /// </summary>
+    [MetadataType(typeof(TypeCollege_Metadata))]
+    public partial class TypeCollege
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class TypeCollege_Metadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public int Id { get; set; }
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Type de collège")]
+        public string Libelle { get; set; }
+        public int Ordre { get; set; }
+    }
+}

+ 1 - 1
CD67.FicheCollege.Entity/Internal/Entities.cs

@@ -2,7 +2,7 @@
 
 namespace CD67.FicheCollege.Entity
 {
-    public partial class ModeleMVCEntities
+    public partial class Entities
     {
         /// <summary>
         /// Ajout d'une meilleure gestion des exceptions Entity pour la méthode "SaveChanges"

+ 26 - 0
CD67.FicheCollege.Entity/Territoire.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <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 Territoire
+    {
+        public int Id { get; set; }
+        public string Libelle { get; set; }
+        public string Referent_SID { get; set; }
+        public string Referent_Nom { get; set; }
+        public string Referent_Prenom { get; set; }
+        public string Referent_Structure { get; set; }
+        public string Referent_Login { get; set; }
+        public int Ordre { get; set; }
+    }
+}

+ 21 - 0
CD67.FicheCollege.Entity/TypeCollege.cs

@@ -0,0 +1,21 @@
+//------------------------------------------------------------------------------
+// <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 TypeCollege
+    {
+        public int Id { get; set; }
+        public string Libelle { get; set; }
+        public int Ordre { get; set; }
+    }
+}

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

@@ -60,6 +60,12 @@
       <DependentUpon>GenericFactories.tt</DependentUpon>
     </Compile>
     <Compile Include="Internal\BaseFactory.cs" />
+    <Compile Include="Internal\TerritoireFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Internal\TypeCollegeFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>

+ 2 - 2
CD67.FicheCollege.Factory/Internal/BaseFactory.cs

@@ -18,7 +18,7 @@ namespace CD67.FicheCollege.Factory.Internal
         /// <summary>
         /// Context Entity Framework utilisé dans la classe
         /// </summary>
-        protected ModeleMVCEntities dbContext;
+        protected Entities dbContext;
 
         #region Constructeurs
         /// <summary>
@@ -30,7 +30,7 @@ namespace CD67.FicheCollege.Factory.Internal
         /// Constructeur avec initialisation du context Entity Framework
         /// </summary>
         /// <param name="dbContext">Context Entity Framework</param>
-        public BaseFactory(ModeleMVCEntities dbContext)
+        public BaseFactory(Entities dbContext)
         {
             this.dbContext = dbContext;
         }

+ 1 - 1
CD67.FicheCollege.Factory/Internal/GenericFactories.tt

@@ -32,7 +32,7 @@ namespace CD67.FicheCollege.Factory
         /// Constructeur public lié au constructeur de base
         /// </summary>
         /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
-		<#=Accessibility.ForType(entity)#> <#=code.Escape(entity)#>Factory(ModeleMVCEntities dbContext) : base(dbContext) { }
+		<#=Accessibility.ForType(entity)#> <#=code.Escape(entity)#>Factory(Entities dbContext) : base(dbContext) { }
 	}
 }
 	<#

+ 21 - 0
CD67.FicheCollege.Factory/Internal/TerritoireFactory.cs

@@ -0,0 +1,21 @@
+using CD67.FicheCollege.Entity;
+using System.Linq;
+
+namespace CD67.FicheCollege.Factory
+{
+	/// <summary>
+    /// NE PAS MODIFIER
+    /// C'est une classe partielle, elle peut être complétée avec une classe partielle du même nom
+    /// Factory générée automatiquement à l'aide du fichier GenericFactories.tt
+    /// pour toutes les entités du fichier entity : /CD67.FicheCollege.Entity/EntityModel.edmx
+    /// </summary>
+	public partial class TerritoireFactory : Internal.BaseFactory<Entity.Territoire>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public TerritoireFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 21 - 0
CD67.FicheCollege.Factory/Internal/TypeCollegeFactory.cs

@@ -0,0 +1,21 @@
+using CD67.FicheCollege.Entity;
+using System.Linq;
+
+namespace CD67.FicheCollege.Factory
+{
+	/// <summary>
+    /// NE PAS MODIFIER
+    /// C'est une classe partielle, elle peut être complétée avec une classe partielle du même nom
+    /// Factory générée automatiquement à l'aide du fichier GenericFactories.tt
+    /// pour toutes les entités du fichier entity : /CD67.FicheCollege.Entity/EntityModel.edmx
+    /// </summary>
+	public partial class TypeCollegeFactory : Internal.BaseFactory<Entity.TypeCollege>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public TypeCollegeFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+