Sfoglia il codice sorgente

NEW Ajout de l'exemple Viking avec table liée pour le type

julien.legrand 9 anni fa
parent
commit
4186ced43f
34 ha cambiato i file con 1043 aggiunte e 326 eliminazioni
  1. 8 4
      CD67.ModeleMVC.Entity/CD67.ModeleMVC.Entity.csproj
  2. 29 0
      CD67.ModeleMVC.Entity/EXEMPLE_TYPE_VIKING.cs
  3. 7 4
      CD67.ModeleMVC.Entity/EXEMPLE_VIKINGS.cs
  4. 2 1
      CD67.ModeleMVC.Entity/EntityModel.Context.cs
  5. 84 23
      CD67.ModeleMVC.Entity/EntityModel.edmx
  6. 5 3
      CD67.ModeleMVC.Entity/EntityModel.edmx.diagram
  7. 31 0
      CD67.ModeleMVC.Entity/Extend/EXEMPLE_TYPE_VIKING.cs
  8. 14 10
      CD67.ModeleMVC.Entity/Extend/EXEMPLE_VIKINGS.cs
  9. 2 1
      CD67.ModeleMVC.Factory/CD67.ModeleMVC.Factory.csproj
  10. 13 13
      CD67.ModeleMVC.Factory/TYPE_VIKINGFactory.cs
  11. 72 0
      CD67.ModeleMVC.Factory/VIKINGSFactory.cs
  12. 1 1
      CD67.ModeleMVC.MVC/App_Start/RouteConfig.cs
  13. 14 6
      CD67.ModeleMVC.MVC/CD67.ModeleMVC.MVC.csproj
  14. 17 0
      CD67.ModeleMVC.MVC/Controllers/HomeController.cs
  15. 40 40
      CD67.ModeleMVC.MVC/Controllers/TYPE_VIKINGController.cs
  16. 142 0
      CD67.ModeleMVC.MVC/Controllers/VIKINGSController.cs
  17. 12 0
      CD67.ModeleMVC.MVC/Views/Home/Index.cshtml
  18. 0 52
      CD67.ModeleMVC.MVC/Views/PARAMs/Create.cshtml
  19. 0 41
      CD67.ModeleMVC.MVC/Views/PARAMs/Delete.cshtml
  20. 0 35
      CD67.ModeleMVC.MVC/Views/PARAMs/Details.cshtml
  21. 0 46
      CD67.ModeleMVC.MVC/Views/PARAMs/Edit.cshtml
  22. 0 40
      CD67.ModeleMVC.MVC/Views/PARAMs/Index.cshtml
  23. 5 3
      CD67.ModeleMVC.MVC/Views/Shared/_AppLayout.cshtml
  24. 47 0
      CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Create.cshtml
  25. 38 0
      CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Delete.cshtml
  26. 27 0
      CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Details.cshtml
  27. 39 0
      CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Edit.cshtml
  28. 34 0
      CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Index.cshtml
  29. 80 0
      CD67.ModeleMVC.MVC/Views/VIKINGS/Create.cshtml
  30. 77 0
      CD67.ModeleMVC.MVC/Views/VIKINGS/Delete.cshtml
  31. 66 0
      CD67.ModeleMVC.MVC/Views/VIKINGS/Details.cshtml
  32. 72 0
      CD67.ModeleMVC.MVC/Views/VIKINGS/Edit.cshtml
  33. 58 0
      CD67.ModeleMVC.MVC/Views/VIKINGS/Index.cshtml
  34. 7 3
      README.md

+ 8 - 4
CD67.ModeleMVC.Entity/CD67.ModeleMVC.Entity.csproj

@@ -73,12 +73,16 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>EntityModel.edmx</DependentUpon>
     </Compile>
-    <Compile Include="Extend\PARAM.cs" />
-    <Compile Include="Internal\Entities.cs" />
-    <Compile Include="Internal\FormattedDbEntityValidationException.cs" />
-    <Compile Include="PARAM.cs">
+    <Compile Include="EXEMPLE_TYPE_VIKING.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="EXEMPLE_VIKINGS.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>
+    <Compile Include="Extend\EXEMPLE_VIKINGS.cs" />
+    <Compile Include="Extend\EXEMPLE_TYPE_VIKING.cs" />
+    <Compile Include="Internal\Entities.cs" />
+    <Compile Include="Internal\FormattedDbEntityValidationException.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>

+ 29 - 0
CD67.ModeleMVC.Entity/EXEMPLE_TYPE_VIKING.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.ModeleMVC.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class EXEMPLE_TYPE_VIKING
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public EXEMPLE_TYPE_VIKING()
+        {
+            this.EXEMPLE_VIKINGS = new HashSet<EXEMPLE_VIKINGS>();
+        }
+    
+        public int ID { get; set; }
+        public string TYPE { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<EXEMPLE_VIKINGS> EXEMPLE_VIKINGS { get; set; }
+    }
+}

+ 7 - 4
CD67.ModeleMVC.Entity/PARAM.cs → CD67.ModeleMVC.Entity/EXEMPLE_VIKINGS.cs

@@ -12,10 +12,13 @@ namespace CD67.ModeleMVC.Entity
     using System;
     using System.Collections.Generic;
     
-    public partial class PARAM
+    public partial class EXEMPLE_VIKINGS
     {
-        public string PRM_CLE { get; set; }
-        public string PRM_LIB1 { get; set; }
-        public string PRM_LIB2 { get; set; }
+        public int ID { get; set; }
+        public string NOM { get; set; }
+        public int ID_TYPE { get; set; }
+        public string DESCRIPTION { get; set; }
+    
+        public virtual EXEMPLE_TYPE_VIKING EXEMPLE_TYPE_VIKING { get; set; }
     }
 }

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

@@ -25,6 +25,7 @@ namespace CD67.ModeleMVC.Entity
             throw new UnintentionalCodeFirstException();
         }
     
-        public virtual DbSet<PARAM> PARAM { get; set; }
+        public virtual DbSet<EXEMPLE_TYPE_VIKING> EXEMPLE_TYPE_VIKING { get; set; }
+        public virtual DbSet<EXEMPLE_VIKINGS> EXEMPLE_VIKINGS { get; set; }
     }
 }

+ 84 - 23
CD67.ModeleMVC.Entity/EntityModel.edmx

@@ -5,48 +5,109 @@
     <!-- SSDL content -->
     <edmx:StorageModels>
     <Schema Namespace="Model.Store" Provider="Oracle.ManagedDataAccess.Client" ProviderManifestToken="11.2" 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="PARAM">
+        <EntityType Name="EXEMPLE_TYPE_VIKING">
           <Key>
-            <PropertyRef Name="PRM_CLE" />
+            <PropertyRef Name="ID" />
           </Key>
-          <Property Name="PRM_CLE" Type="varchar2" MaxLength="10" Nullable="false" />
-          <Property Name="PRM_LIB1" Type="varchar2" MaxLength="100" />
-          <Property Name="PRM_LIB2" Type="varchar2" MaxLength="100" />
+          <Property Name="ID" Type="number" Precision="38" Scale="0" Nullable="false" StoreGeneratedPattern="Identity" />
+          <Property Name="TYPE" Type="varchar2" MaxLength="255" />
         </EntityType>
+        <EntityType Name="EXEMPLE_VIKINGS">
+          <Key>
+            <PropertyRef Name="ID" />
+          </Key>
+          <Property Name="ID" Type="number" Precision="38" Scale="0" Nullable="false" StoreGeneratedPattern="Identity" />
+          <Property Name="NOM" Type="varchar2" MaxLength="255" Nullable="false" />
+          <Property Name="ID_TYPE" Type="number" Precision="38" Scale="0" Nullable="false" />
+          <Property Name="DESCRIPTION" Type="varchar2" MaxLength="255" />
+        </EntityType>
+        <Association Name="EXEMPLE_VIKINGS_FK">
+          <End Role="EXEMPLE_TYPE_VIKING" Type="Self.EXEMPLE_TYPE_VIKING" Multiplicity="1" />
+          <End Role="EXEMPLE_VIKINGS" Type="Self.EXEMPLE_VIKINGS" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="EXEMPLE_TYPE_VIKING">
+              <PropertyRef Name="ID" />
+            </Principal>
+            <Dependent Role="EXEMPLE_VIKINGS">
+              <PropertyRef Name="ID_TYPE" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <EntityContainer Name="ModelStoreContainer">
-          <EntitySet Name="PARAM" EntityType="Self.PARAM" Schema="FER" store:Type="Tables" />
-        </EntityContainer>
+          <EntitySet Name="EXEMPLE_TYPE_VIKING" EntityType="Self.EXEMPLE_TYPE_VIKING" Schema="FER" store:Type="Tables" />
+          <EntitySet Name="EXEMPLE_VIKINGS" EntityType="Self.EXEMPLE_VIKINGS" Schema="FER" store:Type="Tables" />
+          <AssociationSet Name="EXEMPLE_VIKINGS_FK" Association="Self.EXEMPLE_VIKINGS_FK">
+            <End Role="EXEMPLE_TYPE_VIKING" EntitySet="EXEMPLE_TYPE_VIKING" />
+            <End Role="EXEMPLE_VIKINGS" EntitySet="EXEMPLE_VIKINGS" />
+          </AssociationSet>
+          </EntityContainer>
       </Schema></edmx:StorageModels>
     <!-- CSDL content -->
     <edmx:ConceptualModels>
       <Schema Namespace="Model" 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">
-        <EntityType Name="PARAM">
+        <EntityContainer Name="Entities" annotation:LazyLoadingEnabled="true">
+          <EntitySet Name="EXEMPLE_TYPE_VIKING" EntityType="Model.EXEMPLE_TYPE_VIKING" />
+          <EntitySet Name="EXEMPLE_VIKINGS" EntityType="Model.EXEMPLE_VIKINGS" />
+          <AssociationSet Name="EXEMPLE_VIKINGS_FK" Association="Model.EXEMPLE_VIKINGS_FK">
+            <End Role="EXEMPLE_TYPE_VIKING" EntitySet="EXEMPLE_TYPE_VIKING" />
+            <End Role="EXEMPLE_VIKINGS" EntitySet="EXEMPLE_VIKINGS" />
+          </AssociationSet>
+          </EntityContainer>
+        <EntityType Name="EXEMPLE_TYPE_VIKING">
           <Key>
-            <PropertyRef Name="PRM_CLE" />
+            <PropertyRef Name="ID" />
           </Key>
-          <Property Name="PRM_CLE" Type="String" MaxLength="10" FixedLength="false" Unicode="false" Nullable="false" />
-          <Property Name="PRM_LIB1" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
-          <Property Name="PRM_LIB2" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
+          <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="TYPE" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
+          <NavigationProperty Name="EXEMPLE_VIKINGS" Relationship="Model.EXEMPLE_VIKINGS_FK" FromRole="EXEMPLE_TYPE_VIKING" ToRole="EXEMPLE_VIKINGS" />
         </EntityType>
-        <EntityContainer Name="Entities" annotation:LazyLoadingEnabled="true">
-          <EntitySet Name="PARAM" EntityType="Self.PARAM" />
-        </EntityContainer>
-      </Schema>
+        <EntityType Name="EXEMPLE_VIKINGS">
+          <Key>
+            <PropertyRef Name="ID" />
+          </Key>
+          <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="NOM" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
+          <Property Name="ID_TYPE" Type="Int32" Nullable="false" />
+          <Property Name="DESCRIPTION" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
+          <NavigationProperty Name="EXEMPLE_TYPE_VIKING" Relationship="Model.EXEMPLE_VIKINGS_FK" FromRole="EXEMPLE_VIKINGS" ToRole="EXEMPLE_TYPE_VIKING" />
+        </EntityType>
+        <Association Name="EXEMPLE_VIKINGS_FK">
+          <End Type="Model.EXEMPLE_TYPE_VIKING" Role="EXEMPLE_TYPE_VIKING" Multiplicity="1" />
+          <End Type="Model.EXEMPLE_VIKINGS" Role="EXEMPLE_VIKINGS" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="EXEMPLE_TYPE_VIKING">
+              <PropertyRef Name="ID" />
+            </Principal>
+            <Dependent Role="EXEMPLE_VIKINGS">
+              <PropertyRef Name="ID_TYPE" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        </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="ModelStoreContainer" CdmEntityContainer="Entities">
-          <EntitySetMapping Name="PARAM">
-            <EntityTypeMapping TypeName="Model.PARAM">
-              <MappingFragment StoreEntitySet="PARAM">
-                <ScalarProperty Name="PRM_CLE" ColumnName="PRM_CLE" />
-                <ScalarProperty Name="PRM_LIB1" ColumnName="PRM_LIB1" />
-                <ScalarProperty Name="PRM_LIB2" ColumnName="PRM_LIB2" />
+          <EntitySetMapping Name="EXEMPLE_TYPE_VIKING">
+            <EntityTypeMapping TypeName="Model.EXEMPLE_TYPE_VIKING">
+              <MappingFragment StoreEntitySet="EXEMPLE_TYPE_VIKING">
+                <ScalarProperty Name="TYPE" ColumnName="TYPE" />
+                <ScalarProperty Name="ID" ColumnName="ID" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="EXEMPLE_VIKINGS">
+            <EntityTypeMapping TypeName="Model.EXEMPLE_VIKINGS">
+              <MappingFragment StoreEntitySet="EXEMPLE_VIKINGS">
+                <ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" />
+                <ScalarProperty Name="ID_TYPE" ColumnName="ID_TYPE" />
+                <ScalarProperty Name="NOM" ColumnName="NOM" />
+                <ScalarProperty Name="ID" ColumnName="ID" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-        </EntityContainerMapping>
+          </EntityContainerMapping>
       </Mapping>
     </edmx:Mappings>
   </edmx:Runtime>

+ 5 - 3
CD67.ModeleMVC.Entity/EntityModel.edmx.diagram

@@ -4,9 +4,11 @@
   <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
-      <Diagram DiagramId="9960fb8cd7934be39d08423c28f9279b" Name="Diagram1">
-        <EntityTypeShape EntityType="Model.PARAM" Width="1.5" PointX="0.75" PointY="0.75" IsExpanded="true" />
-      </Diagram>
+      <Diagram DiagramId="9960fb8cd7934be39d08423c28f9279b" Name="Diagram1" ZoomLevel="97">
+        <EntityTypeShape EntityType="Model.EXEMPLE_TYPE_VIKING" Width="1.5" PointX="0.625" PointY="1.125" />
+        <EntityTypeShape EntityType="Model.EXEMPLE_VIKINGS" Width="1.5" PointX="2.875" PointY="0.875" />
+        <AssociationConnector Association="Model.EXEMPLE_VIKINGS_FK" />
+        </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>
 </edmx:Edmx>

+ 31 - 0
CD67.ModeleMVC.Entity/Extend/EXEMPLE_TYPE_VIKING.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+// Attention à l'espace de nom, lors de la création d'une nouvelle classe celui-ci sera par défaut :
+// namespace CD67.ModeleMVC.Entity.Extend
+// Alors que pour étendre une classe il faut être dans le même namespace que l'original
+namespace CD67.ModeleMVC.Entity
+{
+    /// <summary>
+    /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
+    /// </summary>
+    [MetadataType(typeof(EXEMPLE_TYPE_VIKING_Metadata))]
+    public partial class EXEMPLE_TYPE_VIKING { }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class EXEMPLE_TYPE_VIKING_Metadata
+    {
+        [Required]
+        [Display(Name = "Clé")]
+        public int ID { get; set; }
+        [Display(Name = "Type")]
+        [StringLength(255)]
+        public string TYPE { get; set; }
+    }
+}

+ 14 - 10
CD67.ModeleMVC.Entity/Extend/PARAM.cs → CD67.ModeleMVC.Entity/Extend/EXEMPLE_VIKINGS.cs

@@ -13,8 +13,8 @@ namespace CD67.ModeleMVC.Entity
     /// <summary>
     /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
     /// </summary>
-    [MetadataType(typeof(PARAM_Metadata))]
-    public partial class PARAM
+    [MetadataType(typeof(EXEMPLE_VIKINGS_Metadata))]
+    public partial class EXEMPLE_VIKINGS
     {
         //Peut contenir une extension utile à la classe (méthode static ou non, nouvelles propriétés, propriétés construites dynamiquement selon d'autres de la classe, etc.)
 
@@ -34,25 +34,29 @@ namespace CD67.ModeleMVC.Entity
     /// <summary>
     /// Classe contenant les DataAnnotations pour chaque champ
     /// </summary>
-    public class PARAM_Metadata
+    public class EXEMPLE_VIKINGS_Metadata
     {
         [Required]
         [Display(Name = "Clé")]
-        public string PRM_CLE;
+        public int ID { get; set; }
         [Required]
-        [Display(Name = "Libellé")]
-        public string PRM_LIB1;
+        [Display(Name = "Nom")]
+        [StringLength(255)]
+        public string NOM { get; set; }
         [Required]
-        [Display(Name = "Valeur")]
+        [Display(Name = "Type")]
+        public int ID_TYPE { get; set; }
+        [Display(Name = "Description")]
+        [StringLength(255)]
         [DataType(DataType.MultilineText)]
-        public string PRM_LIB2;
+        public string DESCRIPTION { get; set; }
 
         //Propriétés ajoutées dans la classe partielle et qui utilise un affichage customisé MVC "YesNo", qui se trouve ici : "Views\Shared\DisplayTemplates" et "Views\Shared\EditorTemplates"
-        [Display(Name = "Toujours Oui")]
+        [Display(Name = "A faim?", Description = "Toujours oui")]
         [Range(0, 1)]
         [UIHint("YesNo")]
         public Nullable<int> alwaysYes;
-        [Display(Name = "toujours Non")]
+        [Display(Name = "Intellectuel?", Description = "Toujours non")]
         [Range(0, 1)]
         [UIHint("YesNo")]
         public Nullable<int> alwaysNo;

+ 2 - 1
CD67.ModeleMVC.Factory/CD67.ModeleMVC.Factory.csproj

@@ -56,7 +56,8 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="PARAMFactory.cs" />
+    <Compile Include="VIKINGSFactory.cs" />
+    <Compile Include="TYPE_VIKINGFactory.cs" />
     <Compile Include="Internal\BaseFactory.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>

+ 13 - 13
CD67.ModeleMVC.Factory/PARAMFactory.cs → CD67.ModeleMVC.Factory/TYPE_VIKINGFactory.cs

@@ -8,40 +8,41 @@ using System.Threading.Tasks;
 
 namespace CD67.ModeleMVC.Factory
 {
-    public class PARAMFactory : Internal.BaseFactory
+    public class TYPE_VIKINGFactory : Internal.BaseFactory
     {
         /// <summary>
         /// Constructeur public lié au constructeur de base
         /// </summary>
         /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
-        public PARAMFactory(Entities dbContext) : base(dbContext) { }
+        public TYPE_VIKINGFactory(Entities dbContext) : base(dbContext) { }
 
         /// <summary>
         /// Retourne un objet par son Id
         /// </summary>
         /// <param name="Id">Id recherché</param>
         /// <returns>Objet recherché</returns>
-        public PARAM getById(string Id)
+        public EXEMPLE_TYPE_VIKING getById(int Id)
         {
-            return dbContext.PARAM.Find(Id);
+            return dbContext.EXEMPLE_TYPE_VIKING.Find(Id);
         }
 
         /// <summary>
         /// Retourne tous les objets
         /// </summary>
         /// <returns>Liste d'objets</returns>
-        public List<PARAM> getAll()
+        public List<EXEMPLE_TYPE_VIKING> getAll()
         {
-            return dbContext.PARAM.ToList();
+            //avec un tri parceque c'est toujours mieux quand c'est trié
+            return dbContext.EXEMPLE_TYPE_VIKING.OrderBy(item => item.TYPE).ToList();
         }
 
         /// <summary>
         /// Ajout de l'objet dans le context
         /// </summary>
         /// <param name="param">Objet à ajouter passé en référence pour obtenir le résultat des triggers ou numéroauto</param>
-        public void add(ref PARAM param)
+        public void add(ref EXEMPLE_TYPE_VIKING param)
         {
-            dbContext.PARAM.Add(param);
+            dbContext.EXEMPLE_TYPE_VIKING.Add(param);
             dbContext.SaveChanges();
         }
 
@@ -49,10 +50,10 @@ namespace CD67.ModeleMVC.Factory
         /// Mise à jour de l'objet dans le context
         /// </summary>
         /// <param name="param">Objet à mettre à jour passé en référence pour obtenir le résultat des triggers ou numéroauto</param>
-        public void update(ref PARAM param)
+        public void update(ref EXEMPLE_TYPE_VIKING param)
         {
             // On attache l'objet en paramètre au contexte, on le note bien comme modifié pour qu'il soit mis à jour
-            dbContext.PARAM.Attach(param);
+            dbContext.EXEMPLE_TYPE_VIKING.Attach(param);
             dbContext.Entry(param).State = EntityState.Modified;
             dbContext.SaveChanges();
         }
@@ -61,11 +62,10 @@ namespace CD67.ModeleMVC.Factory
         /// Suppression de l'objet dans le context
         /// </summary>
         /// <param name="param">Objet à supprimer</param>
-        public void delete(ref PARAM param)
+        public void delete(ref EXEMPLE_TYPE_VIKING param)
         {
             // Attention à ajouter ici d'éventuel contrôle ou suppression en cascade
-
-            dbContext.PARAM.Remove(param);
+            dbContext.EXEMPLE_TYPE_VIKING.Remove(param);
             dbContext.SaveChanges();
         }
     }

+ 72 - 0
CD67.ModeleMVC.Factory/VIKINGSFactory.cs

@@ -0,0 +1,72 @@
+using CD67.ModeleMVC.Entity;
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CD67.ModeleMVC.Factory
+{
+    public class VIKINGSFactory : Internal.BaseFactory
+    {
+        /// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <viking name="dbContext">Context Entity Framework utilisé dans la classe</viking>
+        public VIKINGSFactory(Entities dbContext) : base(dbContext) { }
+
+        /// <summary>
+        /// Retourne un objet par son Id
+        /// </summary>
+        /// <viking name="Id">Id recherché</viking>
+        /// <returns>Objet recherché</returns>
+        public EXEMPLE_VIKINGS getById(int Id)
+        {
+            return dbContext.EXEMPLE_VIKINGS.Find(Id);
+        }
+
+        /// <summary>
+        /// Retourne tous les objets
+        /// </summary>
+        /// <returns>Liste d'objets</returns>
+        public List<EXEMPLE_VIKINGS> getAll()
+        {
+            //Ce n'est pas nécessaire ici (un lazy loading est présent par défaut), mais j'ai ajouté un include explicite pour charger les sous-objets "EXEMPLE_TYPE_VIKING"
+            return dbContext.EXEMPLE_VIKINGS.Include(item => item.EXEMPLE_TYPE_VIKING).ToList();
+        }
+
+        /// <summary>
+        /// Ajout de l'objet dans le context
+        /// </summary>
+        /// <viking name="viking">Objet à ajouter passé en référence pour obtenir le résultat des triggers ou numéroauto</viking>
+        public void add(ref EXEMPLE_VIKINGS viking)
+        {
+            dbContext.EXEMPLE_VIKINGS.Add(viking);
+            dbContext.SaveChanges();
+        }
+
+        /// <summary>
+        /// Mise à jour de l'objet dans le context
+        /// </summary>
+        /// <viking name="viking">Objet à mettre à jour passé en référence pour obtenir le résultat des triggers ou numéroauto</viking>
+        public void update(ref EXEMPLE_VIKINGS viking)
+        {
+            // On attache l'objet en paramètre au contexte, on le note bien comme modifié pour qu'il soit mis à jour
+            dbContext.EXEMPLE_VIKINGS.Attach(viking);
+            dbContext.Entry(viking).State = EntityState.Modified;
+            dbContext.SaveChanges();
+        }
+
+        /// <summary>
+        /// Suppression de l'objet dans le context
+        /// </summary>
+        /// <viking name="viking">Objet à supprimer</viking>
+        public void delete(ref EXEMPLE_VIKINGS viking)
+        {
+            // Attention à ajouter ici d'éventuel contrôle ou suppression en cascade
+            dbContext.EXEMPLE_VIKINGS.Remove(viking);
+            dbContext.SaveChanges();
+        }
+    }
+}

+ 1 - 1
CD67.ModeleMVC.MVC/App_Start/RouteConfig.cs

@@ -16,7 +16,7 @@ namespace CD67.ModeleMVC.MVC
             routes.MapRoute(
                 name: "Default",
                 url: "{controller}/{action}/{id}",
-                defaults: new { controller = "PARAMs", action = "Index", id = UrlParameter.Optional }
+                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
             );
         }
     }

+ 14 - 6
CD67.ModeleMVC.MVC/CD67.ModeleMVC.MVC.csproj

@@ -141,7 +141,9 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App_Start\BundleConfig.cs" />
-    <Compile Include="Controllers\PARAMsController.cs" />
+    <Compile Include="Controllers\HomeController.cs" />
+    <Compile Include="Controllers\TYPE_VIKINGController.cs" />
+    <Compile Include="Controllers\VIKINGSController.cs" />
     <Compile Include="Global.asax.cs">
       <DependentUpon>Global.asax</DependentUpon>
     </Compile>
@@ -199,11 +201,17 @@
     <Content Include="Views\Shared\_AppLayout.cshtml" />
     <Content Include="Views\Shared\DisplayTemplates\YesNo.cshtml" />
     <Content Include="Views\Shared\EditorTemplates\YesNo.cshtml" />
-    <Content Include="Views\PARAMs\Create.cshtml" />
-    <Content Include="Views\PARAMs\Delete.cshtml" />
-    <Content Include="Views\PARAMs\Details.cshtml" />
-    <Content Include="Views\PARAMs\Edit.cshtml" />
-    <Content Include="Views\PARAMs\Index.cshtml" />
+    <Content Include="Views\Home\Index.cshtml" />
+    <Content Include="Views\TYPE_VIKING\Create.cshtml" />
+    <Content Include="Views\TYPE_VIKING\Delete.cshtml" />
+    <Content Include="Views\TYPE_VIKING\Details.cshtml" />
+    <Content Include="Views\TYPE_VIKING\Edit.cshtml" />
+    <Content Include="Views\TYPE_VIKING\Index.cshtml" />
+    <Content Include="Views\VIKINGS\Create.cshtml" />
+    <Content Include="Views\VIKINGS\Delete.cshtml" />
+    <Content Include="Views\VIKINGS\Details.cshtml" />
+    <Content Include="Views\VIKINGS\Edit.cshtml" />
+    <Content Include="Views\VIKINGS\Index.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />

+ 17 - 0
CD67.ModeleMVC.MVC/Controllers/HomeController.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+
+namespace CD67.ModeleMVC.MVC.Controllers
+{
+    public class HomeController : Controller
+    {
+        // GET: Home
+        public ActionResult Index()
+        {
+            return View();
+        }
+    }
+}

+ 40 - 40
CD67.ModeleMVC.MVC/Controllers/PARAMsController.cs → CD67.ModeleMVC.MVC/Controllers/TYPE_VIKINGController.cs

@@ -11,113 +11,113 @@ using CD67.ModeleMVC.Factory;
 
 namespace CD67.ModeleMVC.MVC.Controllers
 {
-    public class PARAMsController : Controller
+    public class TYPE_VIKINGController : Controller
     {
         private Entities db = new Entities();
 
-        // GET: PARAMs
+        // GET: TYPE_VIKING
         public ActionResult Index()
         {
-            PARAMFactory paramFactory = new PARAMFactory(db);
-            return View(paramFactory.getAll());
+            TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+            return View(typeVikingFactory.getAll());
         }
 
-        // GET: PARAMs/Details/5
-        public ActionResult Details(string id)
+        // GET: TYPE_VIKING/Details/5
+        public ActionResult Details(int? id)
         {
             if (id == null)
             {
                 return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
             }
-            PARAMFactory paramFactory = new PARAMFactory(db);
-            PARAM param = paramFactory.getById(id);
-            if (param == null)
+            TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+            EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id.Value);
+            if (typeViking == null)
             {
                 return HttpNotFound();
             }
-            return View(param);
+            return View(typeViking);
         }
 
-        // GET: PARAMs/Create
+        // GET: TYPE_VIKING/Create
         public ActionResult Create()
         {
-            PARAM param = new PARAM();
-            return View(param);
+            EXEMPLE_TYPE_VIKING typeViking = new EXEMPLE_TYPE_VIKING();
+            return View(typeViking);
         }
 
-        // POST: PARAMs/Create
+        // POST: TYPE_VIKING/Create
         // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
         // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public ActionResult Create([Bind(Include = "PRM_CLE,PRM_LIB1,PRM_LIB2")] PARAM param)
+        public ActionResult Create([Bind(Include = "ID,TYPE")] EXEMPLE_TYPE_VIKING typeViking)
         {
             if (ModelState.IsValid)
             {
-                PARAMFactory paramFactory = new PARAMFactory(db);
-                paramFactory.add(ref param);
+                TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+                typeVikingFactory.add(ref typeViking);
                 return RedirectToAction("Index");
             }
 
-            return View(param);
+            return View(typeViking);
         }
 
-        // GET: PARAMs/Edit/5
-        public ActionResult Edit(string id)
+        // GET: TYPE_VIKING/Edit/5
+        public ActionResult Edit(int? id)
         {
             if (id == null)
             {
                 return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
             }
-            PARAMFactory paramFactory = new PARAMFactory(db);
-            PARAM param = paramFactory.getById(id);
-            if (param == null)
+            TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+            EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id.Value);
+            if (typeViking == null)
             {
                 return HttpNotFound();
             }
-            return View(param);
+            return View(typeViking);
         }
 
-        // POST: PARAMs/Edit/5
+        // POST: TYPE_VIKING/Edit/5
         // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
         // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public ActionResult Edit([Bind(Include = "PRM_CLE,PRM_LIB1,PRM_LIB2")] PARAM param)
+        public ActionResult Edit([Bind(Include = "ID,TYPE")] EXEMPLE_TYPE_VIKING typeViking)
         {
             if (ModelState.IsValid)
             {
-                PARAMFactory paramFactory = new PARAMFactory(db);
-                paramFactory.update(ref param);
+                TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+                typeVikingFactory.update(ref typeViking);
                 return RedirectToAction("Index");
             }
-            return View(param);
+            return View(typeViking);
         }
 
-        // GET: PARAMs/Delete/5
-        public ActionResult Delete(string id)
+        // GET: TYPE_VIKING/Delete/5
+        public ActionResult Delete(int? id)
         {
             if (id == null)
             {
                 return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
             }
-            PARAMFactory paramFactory = new PARAMFactory(db);
-            PARAM param = paramFactory.getById(id);
-            if (param == null)
+            TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+            EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id.Value);
+            if (typeViking == null)
             {
                 return HttpNotFound();
             }
-            return View(param);
+            return View(typeViking);
         }
 
-        // POST: PARAMs/Delete/5
+        // POST: TYPE_VIKING/Delete/5
         [HttpPost, ActionName("Delete")]
         [ValidateAntiForgeryToken]
-        public ActionResult DeleteConfirmed(string id)
+        public ActionResult DeleteConfirmed(int id)
         {
-            PARAMFactory paramFactory = new PARAMFactory(db);
-            PARAM param = paramFactory.getById(id);
-            paramFactory.delete(ref param);
+            TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+            EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id);
+            typeVikingFactory.delete(ref typeViking);
             return RedirectToAction("Index");
         }
 

+ 142 - 0
CD67.ModeleMVC.MVC/Controllers/VIKINGSController.cs

@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.Entity;
+using System.Linq;
+using System.Net;
+using System.Web;
+using System.Web.Mvc;
+using CD67.ModeleMVC.Entity;
+using CD67.ModeleMVC.Factory;
+
+namespace CD67.ModeleMVC.MVC.Controllers
+{
+    public class VIKINGSController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: VIKINGS
+        public ActionResult Index()
+        {
+            VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+            return View(vikingsFactory.getAll());
+        }
+
+        // GET: VIKINGS/Details/5
+        public ActionResult Details(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+            EXEMPLE_VIKINGS viking = vikingsFactory.getById(id.Value);
+            if (viking == null)
+            {
+                return HttpNotFound();
+            }
+            return View(viking);
+        }
+
+        // GET: VIKINGS/Create
+        public ActionResult Create()
+        {
+            EXEMPLE_VIKINGS viking = new EXEMPLE_VIKINGS();
+            FillSelect(viking);
+            return View(viking);
+        }
+
+        // POST: VIKINGS/Create
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Create([Bind(Include = "ID,NOM,ID_TYPE,DESCRIPTION")] EXEMPLE_VIKINGS viking)
+        {
+            if (ModelState.IsValid)
+            {
+                VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+                vikingsFactory.add(ref viking);
+                return RedirectToAction("Index");
+            }
+            FillSelect(viking);
+            return View(viking);
+        }
+
+        // GET: VIKINGS/Edit/5
+        public ActionResult Edit(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+            EXEMPLE_VIKINGS viking = vikingsFactory.getById(id.Value);
+            if (viking == null)
+            {
+                return HttpNotFound();
+            }
+            FillSelect(viking);
+            return View(viking);
+        }
+
+        // POST: VIKINGS/Edit/5
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit([Bind(Include = "ID,NOM,ID_TYPE,DESCRIPTION")] EXEMPLE_VIKINGS viking)
+        {
+            if (ModelState.IsValid)
+            {
+                VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+                vikingsFactory.update(ref viking);
+                return RedirectToAction("Index");
+            }
+            FillSelect(viking);
+            return View(viking);
+        }
+
+        // GET: VIKINGS/Delete/5
+        public ActionResult Delete(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+            EXEMPLE_VIKINGS viking = vikingsFactory.getById(id.Value);
+            if (viking == null)
+            {
+                return HttpNotFound();
+            }
+            return View(viking);
+        }
+
+        // POST: VIKINGS/Delete/5
+        [HttpPost, ActionName("Delete")]
+        [ValidateAntiForgeryToken]
+        public ActionResult DeleteConfirmed(int id)
+        {
+            VIKINGSFactory vikingsFactory = new VIKINGSFactory(db);
+            EXEMPLE_VIKINGS viking = vikingsFactory.getById(id);
+            vikingsFactory.delete(ref viking);
+            return RedirectToAction("Index");
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        private void FillSelect(EXEMPLE_VIKINGS viking)
+        {
+            TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
+            ViewBag.ID_TYPE = new SelectList(typeVikingFactory.getAll(), "ID", "TYPE", viking.ID_TYPE);
+        }
+    }
+}

+ 12 - 0
CD67.ModeleMVC.MVC/Views/Home/Index.cshtml

@@ -0,0 +1,12 @@
+
+@{
+    ViewBag.Title = "Accueil";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Accueil</h2>
+
+<br />
+@Html.ActionLink("Gestion des Vikings", "index", "VIKINGS")
+<br /><br />
+@Html.ActionLink("Gestion des types de Vikings", "index", "TYPE_VIKING")

+ 0 - 52
CD67.ModeleMVC.MVC/Views/PARAMs/Create.cshtml

@@ -1,52 +0,0 @@
-@model CD67.ModeleMVC.Entity.PARAM
-
-@{
-    ViewBag.Title = "Create";
-    Layout = "~/Views/Shared/_AppLayout.cshtml";
-}
-
-<h2>Create</h2>
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>PARAM</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        <div class="form-group">
-            @Html.LabelFor(model => model.PRM_CLE, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => model.PRM_CLE, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => model.PRM_CLE, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => model.PRM_LIB1, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => model.PRM_LIB1, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => model.PRM_LIB1, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => model.PRM_LIB2, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => model.PRM_LIB2, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => model.PRM_LIB2, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            <div class="col-md-offset-2 col-md-10">
-                <input type="submit" value="Create" class="btn btn-default" />
-            </div>
-        </div>
-    </div>
-}
-
-<div>
-    @Html.ActionLink("Back to List", "Index")
-</div>

+ 0 - 41
CD67.ModeleMVC.MVC/Views/PARAMs/Delete.cshtml

@@ -1,41 +0,0 @@
-@model CD67.ModeleMVC.Entity.PARAM
-
-@{
-    ViewBag.Title = "Delete";
-    Layout = "~/Views/Shared/_AppLayout.cshtml";
-}
-
-<h2>Delete</h2>
-
-<h3>Are you sure you want to delete this?</h3>
-<div>
-    <h4>PARAM</h4>
-    <hr />
-    <dl class="dl-horizontal">
-        <dt>
-            @Html.DisplayNameFor(model => model.PRM_LIB1)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.PRM_LIB1)
-        </dd>
-
-        <dt>
-            @Html.DisplayNameFor(model => model.PRM_LIB2)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.PRM_LIB2)
-        </dd>
-
-    </dl>
-
-    @using (Html.BeginForm()) {
-        @Html.AntiForgeryToken()
-
-        <div class="form-actions no-color">
-            <input type="submit" value="Delete" class="btn btn-default" /> |
-            @Html.ActionLink("Back to List", "Index")
-        </div>
-    }
-</div>

+ 0 - 35
CD67.ModeleMVC.MVC/Views/PARAMs/Details.cshtml

@@ -1,35 +0,0 @@
-@model CD67.ModeleMVC.Entity.PARAM
-
-@{
-    ViewBag.Title = "Details";
-    Layout = "~/Views/Shared/_AppLayout.cshtml";
-}
-
-<h2>Details</h2>
-
-<div>
-    <h4>PARAM</h4>
-    <hr />
-    <dl class="dl-horizontal">
-        <dt>
-            @Html.DisplayNameFor(model => model.PRM_LIB1)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.PRM_LIB1)
-        </dd>
-
-        <dt>
-            @Html.DisplayNameFor(model => model.PRM_LIB2)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.PRM_LIB2)
-        </dd>
-
-    </dl>
-</div>
-<p>
-    @Html.ActionLink("Edit", "Edit", new { id = Model.PRM_CLE }) |
-    @Html.ActionLink("Back to List", "Index")
-</p>

+ 0 - 46
CD67.ModeleMVC.MVC/Views/PARAMs/Edit.cshtml

@@ -1,46 +0,0 @@
-@model CD67.ModeleMVC.Entity.PARAM
-
-@{
-    ViewBag.Title = "Edit";
-    Layout = "~/Views/Shared/_AppLayout.cshtml";
-}
-
-<h2>Edit</h2>
-
-@using (Html.BeginForm())
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>PARAM</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => model.PRM_CLE)
-
-        <div class="form-group">
-            @Html.LabelFor(model => model.PRM_LIB1, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => model.PRM_LIB1, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => model.PRM_LIB1, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => model.PRM_LIB2, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => model.PRM_LIB2, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => model.PRM_LIB2, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            <div class="col-md-offset-2 col-md-10">
-                <input type="submit" value="Save" class="btn btn-default" />
-            </div>
-        </div>
-    </div>
-}
-
-<div>
-    @Html.ActionLink("Back to List", "Index")
-</div>

+ 0 - 40
CD67.ModeleMVC.MVC/Views/PARAMs/Index.cshtml

@@ -1,40 +0,0 @@
-@model IEnumerable<CD67.ModeleMVC.Entity.PARAM>
-
-@{
-    ViewBag.Title = "Index";
-    Layout = "~/Views/Shared/_AppLayout.cshtml";
-}
-
-<h2>Index</h2>
-
-<p>
-    @Html.ActionLink("Create New", "Create")
-</p>
-<table class="table">
-    <tr>
-        <th>
-            @Html.DisplayNameFor(model => model.PRM_LIB1)
-        </th>
-        <th>
-            @Html.DisplayNameFor(model => model.PRM_LIB2)
-        </th>
-        <th></th>
-    </tr>
-
-@foreach (var item in Model) {
-    <tr>
-        <td>
-            @Html.DisplayFor(modelItem => item.PRM_LIB1)
-        </td>
-        <td>
-            @Html.DisplayFor(modelItem => item.PRM_LIB2)
-        </td>
-        <td>
-            @Html.ActionLink("Edit", "Edit", new { id=item.PRM_CLE }) |
-            @Html.ActionLink("Details", "Details", new { id=item.PRM_CLE }) |
-            @Html.ActionLink("Delete", "Delete", new { id=item.PRM_CLE })
-        </td>
-    </tr>
-}
-
-</table>

+ 5 - 3
CD67.ModeleMVC.MVC/Views/Shared/_AppLayout.cshtml

@@ -19,9 +19,11 @@
 </head>
 <body>
     <h1>
-        <span class="glyphicon glyphicon-home"></span> <!-- Exemple de Glyphicon Bootstrap --> 
-        <i class="fa fa-rocket" aria-hidden="true"></i> <!-- Exemple d'icône fontAwesome --> 
-        Application Modèle
+        <a href="@Url.Action("Index", "Home")">
+            <span class="glyphicon glyphicon-home"></span> <!-- Exemple de Glyphicon Bootstrap -->
+            <i class="fa fa-rocket" aria-hidden="true"></i> <!-- Exemple d'icône fontAwesome -->
+            Application Modèle
+        </a>
     </h1>
     <hr />
     <div>

+ 47 - 0
CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Create.cshtml

@@ -0,0 +1,47 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_TYPE_VIKING
+
+@{
+    ViewBag.Title = "Create";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Creation</h2>
+
+@using (Html.BeginForm()) 
+{
+    @Html.AntiForgeryToken()
+
+    <div class="form-horizontal">
+        <h4>Type de Viking</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+
+        @*Contenu généré mais masqué car inutile, la clé est générée automatiquement dans mon exemple par un trigger/sequence*@
+        @*<div class="form-group">
+            @Html.LabelFor(model => model.ID, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.ID, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" })
+            </div>
+        </div>*@
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.TYPE, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.TYPE, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Ajouter" class="btn btn-success" />
+                <input type="reset" value="Annuler" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour", "Index")
+</div>

+ 38 - 0
CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Delete.cshtml

@@ -0,0 +1,38 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_TYPE_VIKING
+
+@{
+    ViewBag.Title = "Delete";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Suppression</h2>
+
+<h3>Voulez-vous vraiment supprimer cet enregistrement?</h3>
+<div>
+    <h4>Type de Viking</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => model.TYPE)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.TYPE)
+        </dd>
+
+    </dl>
+
+    @using (Html.BeginForm())
+    {
+        @Html.AntiForgeryToken()
+
+        <div class="form-actions no-color">
+            <input type="submit" value="Supprimer" class="btn btn-danger" />
+        </div>
+    }
+</div>
+
+<br />
+<div>
+    @Html.ActionLink("Retour", "Index")
+</div>

+ 27 - 0
CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Details.cshtml

@@ -0,0 +1,27 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_TYPE_VIKING
+
+@{
+    ViewBag.Title = "Details";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Details</h2>
+
+<div>
+    <h4>Type de Viking</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => model.TYPE)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.TYPE)
+        </dd>
+
+    </dl>
+</div>
+<p>
+    @Html.ActionLink("Editer", "Edit", new { id = Model.ID }) |
+    @Html.ActionLink("Retour", "Index")
+</p>

+ 39 - 0
CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Edit.cshtml

@@ -0,0 +1,39 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_TYPE_VIKING
+
+@{
+    ViewBag.Title = "Edit";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Edition</h2>
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+
+    <div class="form-horizontal">
+        <h4>Type de Viking</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => model.ID)
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.TYPE, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.TYPE, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Enregistrer" class="btn btn-primary" />
+                <input type="reset" value="Annuler" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour", "Index")
+</div>

+ 34 - 0
CD67.ModeleMVC.MVC/Views/TYPE_VIKING/Index.cshtml

@@ -0,0 +1,34 @@
+@model IEnumerable<CD67.ModeleMVC.Entity.EXEMPLE_TYPE_VIKING>
+
+@{
+    ViewBag.Title = "Index";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Index</h2>
+
+<p>
+    @Html.ActionLink("Ajouter", "Create")
+</p>
+<table class="table">
+    <tr>
+        <th>
+            @Html.DisplayNameFor(model => model.TYPE)
+        </th>
+        <th></th>
+    </tr>
+
+@foreach (var item in Model) {
+    <tr>
+        <td>
+            @Html.DisplayFor(modelItem => item.TYPE)
+        </td>
+        <td>
+            @Html.ActionLink("Editer", "Edit", new { id=item.ID }) |
+            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
+            @Html.ActionLink("Supprimer", "Delete", new { id=item.ID })
+        </td>
+    </tr>
+}
+
+</table>

+ 80 - 0
CD67.ModeleMVC.MVC/Views/VIKINGS/Create.cshtml

@@ -0,0 +1,80 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
+
+@{
+    ViewBag.Title = "Create";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Creation</h2>
+
+@using (Html.BeginForm()) 
+{
+    @Html.AntiForgeryToken()
+
+    <div class="form-horizontal">
+        <h4>Viking</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        
+        @*Contenu généré mais masqué car inutile, la clé est générée automatiquement dans mon exemple par un trigger/sequence*@
+        @*<div class="form-group">
+            @Html.LabelFor(model => model.ID, "ID", htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.DropDownList("ID", null, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" })
+            </div>
+        </div>*@
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.NOM, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.NOM, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.NOM, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        @*Liste de choix pour le type, rempli gràce au ViewBag dans le contrôleur*@
+        <div class="form-group">
+            @Html.LabelFor(model => model.ID_TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.DropDownList("ID_TYPE", null, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => model.ID_TYPE, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.alwaysYes, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.alwaysYes, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.alwaysYes, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.alwaysNo, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.alwaysNo, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.alwaysNo, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Ajouter" class="btn btn-success" />
+                <input type="reset" value="Annuler" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour", "Index")
+</div>

+ 77 - 0
CD67.ModeleMVC.MVC/Views/VIKINGS/Delete.cshtml

@@ -0,0 +1,77 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
+
+@{
+    ViewBag.Title = "Delete";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Suppression</h2>
+
+<h3>Voulez-vous vraiment supprimer cet enregistrement?</h3>
+<div>
+    <h4>Viking</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => model.NOM)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.NOM)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.ID_TYPE)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.ID_TYPE)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.DESCRIPTION)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.DESCRIPTION)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.EXEMPLE_TYPE_VIKING.TYPE)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.EXEMPLE_TYPE_VIKING.TYPE)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.alwaysYes)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.alwaysYes)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.alwaysNo)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.alwaysNo)
+        </dd>
+    </dl>
+
+    @using (Html.BeginForm())
+    {
+        @Html.AntiForgeryToken()
+
+        <div class="form-actions no-color">
+            <input type="submit" value="Supprimer" class="btn btn-danger" />
+        </div>
+    }
+</div>
+
+<br />
+<div>
+    @Html.ActionLink("Retour", "Index")
+</div>

+ 66 - 0
CD67.ModeleMVC.MVC/Views/VIKINGS/Details.cshtml

@@ -0,0 +1,66 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
+
+@{
+    ViewBag.Title = "Details";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Details</h2>
+
+<div>
+    <h4>Viking</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => model.NOM)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.NOM)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.ID_TYPE)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.ID_TYPE)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.DESCRIPTION)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.DESCRIPTION)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.EXEMPLE_TYPE_VIKING.TYPE)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.EXEMPLE_TYPE_VIKING.TYPE)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.alwaysYes)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.alwaysYes)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => model.alwaysNo)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => model.alwaysNo)
+        </dd>
+    </dl>
+</div>
+<p>
+    @Html.ActionLink("Editer", "Edit", new { id = Model.ID }) |
+    @Html.ActionLink("Retour", "Index")
+</p>

+ 72 - 0
CD67.ModeleMVC.MVC/Views/VIKINGS/Edit.cshtml

@@ -0,0 +1,72 @@
+@model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
+
+@{
+    ViewBag.Title = "Edit";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Edition</h2>
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+
+    <div class="form-horizontal">
+        <h4>Viking</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => model.ID)
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.NOM, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.NOM, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.NOM, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        @*Liste de choix pour le type, rempli gràce au ViewBag dans le contrôleur*@
+        <div class="form-group">
+            @Html.LabelFor(model => model.ID_TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.DropDownList("ID_TYPE", null, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => model.ID_TYPE, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.alwaysYes, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.alwaysYes, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.alwaysYes, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => model.alwaysNo, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => model.alwaysNo, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => model.alwaysNo, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Enregistrer" class="btn btn-primary" />
+                <input type="reset" value="Annuler" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour", "Index")
+</div>

+ 58 - 0
CD67.ModeleMVC.MVC/Views/VIKINGS/Index.cshtml

@@ -0,0 +1,58 @@
+@model IEnumerable<CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS>
+
+@{
+    ViewBag.Title = "Index";
+    Layout = "~/Views/Shared/_AppLayout.cshtml";
+}
+
+<h2>Index</h2>
+
+<p>
+    @Html.ActionLink("Ajouter", "Create")
+</p>
+<table class="table">
+    <tr>
+        <th>
+            @Html.DisplayNameFor(model => model.NOM)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.EXEMPLE_TYPE_VIKING.TYPE)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.DESCRIPTION)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.alwaysYes)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.alwaysNo)
+        </th>
+        <th></th>
+    </tr>
+
+@foreach (var item in Model) {
+    <tr>
+        <td>
+            @Html.DisplayFor(modelItem => item.NOM)
+        </td>
+        <td>
+            @Html.DisplayFor(modelItem => item.EXEMPLE_TYPE_VIKING.TYPE)
+        </td>
+        <td>
+            @Html.DisplayFor(modelItem => item.DESCRIPTION)
+        </td>
+        <td>
+            @Html.DisplayFor(modelItem => item.alwaysYes)
+        </td>
+        <td>
+            @Html.DisplayFor(modelItem => item.alwaysNo)
+        </td>
+        <td>
+            @Html.ActionLink("Editer", "Edit", new { id=item.ID }) |
+            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
+            @Html.ActionLink("Supprimer", "Delete", new { id=item.ID })
+        </td>
+    </tr>
+}
+
+</table>

+ 7 - 3
README.md

@@ -8,10 +8,14 @@ v0.1 15/07/2016 (Julien Legrand) : 1
 # Actions à faire après copie
 1. Renommer les projets en suivant ce schéma : "CD67.[nom appli].[Entity/Factory/MVC/Tests/Batchs]"
 2. Renommer également les assemblies et espaces de nom de chaque projet (dans les propriétés des projets, onglet "Application")
+3. Option : Ajouter une projet de type base de données
 
-x. Créer vos propres fichiers d'extension avec DataAnnotation ici : "CD67.ModeleMVC.Entity\Extend" et supprimer le fichier d'exemple "CD67.ModeleMVC.Entity\Extend\PARAM.cs"
-x. Créer vos propres factory ici : "CD67.ModeleMVC.Factory" et supprimer le fichier d'exemple "CD67.ModeleMVC.Factory\PARAMFactory.cs"
-x. Créer vos propres controller/vues ici : "CD67.ModeleMVC.MVC\Controllers" et supprimer les fichiers d'exemple : 
+x. Mettre à jour le modèle par rapport à la base de données pour ajouter de nouvelles tables et vues
+x. Vérifier les types des entités générées depuis la base de données, particulièrement les clés en numéro auto ou avec un trigger/sequence Oracle, le champ "StoreGeneratedPattern" doit être égal à "Identity"
+
+x. Créer vos propres fichiers d'extension avec DataAnnotation ici : "CD67.ModeleMVC.Entity\Extend" et supprimer les fichiers d'exemple "CD67.ModeleMVC.Entity\Extend\EXEMPLE_VIKINGS.cs" et "CD67.ModeleMVC.Entity\Extend\EXEMPLE_TYPE_VIKING.cs"
+x. Créer vos propres factory ici : "CD67.ModeleMVC.Factory" et supprimer les fichiers d'exemple "CD67.ModeleMVC.Factory\VIKINGSFactory.cs" et "CD67.ModeleMVC.Factory\TYPE_VIKINGFactory.cs"
+x. Créer vos propres controller/vues ici : "CD67.ModeleMVC.MVC\Controllers" et supprimer les fichiers d'exemple 
 (NOTE : personellement j'utilise à la création du controller le modèle "Contrôleur MV5 avec vues, utilisant Entity Framework" en générant les vues et avec la page de disposition que je souhaite, ensuite je modifie le code du contrôleur pour utiliser les classes "Factory")
 x. Modifier le fichier "CD67.ModeleMVC.MVC\App_Start\RouteConfig.cs" par rapport à vos contrôleurs