Selaa lähdekoodia

Merge branch '18-poc-actions-educatives-sportives-et-culturelles' into 'experiment'

Resolve "POC Actions éducatives, sportives et culturelles"

Closes #18

See merge request Culture-Territo-BI/FicheCollege!4
LEGRAND Julien 8 vuotta sitten
vanhempi
commit
6106da4838
26 muutettua tiedostoa jossa 502 lisäystä ja 10 poistoa
  1. 7 0
      CD67.FicheCollege.BDD/Actions-CLAS.sql
  2. 7 0
      CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.refactorlog
  3. 1 0
      CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj
  4. 23 0
      CD67.FicheCollege.Entity/ActionCLAS.cs
  5. 4 0
      CD67.FicheCollege.Entity/CD67.FicheCollege.Entity.csproj
  6. 1 0
      CD67.FicheCollege.Entity/College.cs
  7. 1 0
      CD67.FicheCollege.Entity/EntityModel.Context.cs
  8. 61 0
      CD67.FicheCollege.Entity/EntityModel.edmx
  9. 2 0
      CD67.FicheCollege.Entity/EntityModel.edmx.diagram
  10. 28 0
      CD67.FicheCollege.Entity/Extend/ActionCLAS.cs
  11. 30 0
      CD67.FicheCollege.Factory/ActionCLASFactory.cs
  12. 4 0
      CD67.FicheCollege.Factory/CD67.FicheCollege.Factory.csproj
  13. 9 0
      CD67.FicheCollege.Factory/CollegeFactory.cs
  14. 6 5
      CD67.FicheCollege.Factory/IdentiteFactory.cs
  15. 21 0
      CD67.FicheCollege.Factory/Internal/ActionCLASFactory.cs
  16. 5 0
      CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj
  17. 87 0
      CD67.FicheCollege.MVC/Controllers/ActionsCLASController.cs
  18. 22 0
      CD67.FicheCollege.MVC/Controllers/GestionActionsController.cs
  19. 6 0
      CD67.FicheCollege.MVC/Mvc.sitemap
  20. 48 0
      CD67.FicheCollege.MVC/Views/ActionsCLAS/Details.cshtml
  21. 54 0
      CD67.FicheCollege.MVC/Views/ActionsCLAS/Edit.cshtml
  22. 1 0
      CD67.FicheCollege.MVC/Views/Colleges/Details.cshtml
  23. 8 2
      CD67.FicheCollege.MVC/Views/Colleges/Index.cshtml
  24. 55 0
      CD67.FicheCollege.MVC/Views/GestionActions/Index.cshtml
  25. 1 0
      CD67.FicheCollege.MVC/Views/Identites/Details.cshtml
  26. 10 3
      CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml

+ 7 - 0
CD67.FicheCollege.BDD/Actions-CLAS.sql

@@ -0,0 +1,7 @@
+CREATE TABLE [dbo].[Actions-CLAS]
+(
+	[College_Id] NVARCHAR(8) NOT NULL PRIMARY KEY, 
+    [Action] BIT NULL, 
+    [Commentaire] NTEXT NULL, 
+    CONSTRAINT [FK_Actions-CLAS_College] FOREIGN KEY ([College_Id]) REFERENCES [Colleges]([Id])
+)

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

@@ -77,4 +77,11 @@
     <Property Name="ParentElementType" Value="SqlTable" />
     <Property Name="NewName" Value="College_Id" />
   </Operation>
+  <Operation Name="Rename Refactor" Key="fadf50e8-62b2-46e4-b427-254e6321825b" ChangeDateTime="01/11/2018 16:43:18">
+    <Property Name="ElementName" Value="[dbo].[Actions_CLAS].[b]" />
+    <Property Name="ElementType" Value="SqlSimpleColumn" />
+    <Property Name="ParentElementName" Value="[dbo].[Actions_CLAS]" />
+    <Property Name="ParentElementType" Value="SqlTable" />
+    <Property Name="NewName" Value="Action" />
+  </Operation>
 </Operations>

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

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

+ 23 - 0
CD67.FicheCollege.Entity/ActionCLAS.cs

@@ -0,0 +1,23 @@
+//------------------------------------------------------------------------------
+// <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 ActionCLAS
+    {
+        public string College_Id { get; set; }
+        public Nullable<bool> Action { get; set; }
+        public string Commentaire { get; set; }
+    
+        public virtual College College { get; set; }
+    }
+}

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

@@ -59,6 +59,9 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ActionCLAS.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="College.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>
@@ -77,6 +80,7 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>EntityModel.edmx</DependentUpon>
     </Compile>
+    <Compile Include="Extend\ActionCLAS.cs" />
     <Compile Include="Extend\College.cs" />
     <Compile Include="Extend\Territoire.cs" />
     <Compile Include="Extend\TypeCollege.cs" />

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

@@ -32,5 +32,6 @@ namespace CD67.FicheCollege.Entity
         public virtual Territoire Territoire { get; set; }
         public virtual TypeCollege TypeCollege { get; set; }
         public virtual Identite Identite { get; set; }
+        public virtual ActionCLAS Actions_CLAS { get; set; }
     }
 }

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

@@ -29,5 +29,6 @@ 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; }
     }
 }

+ 61 - 0
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -5,6 +5,14 @@
     <!-- 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">
+        <EntityType Name="Actions-CLAS">
+          <Key>
+            <PropertyRef Name="College_Id" />
+          </Key>
+          <Property Name="College_Id" Type="nvarchar" MaxLength="8" Nullable="false" />
+          <Property Name="Action" Type="bit" />
+          <Property Name="Commentaire" Type="ntext" />
+        </EntityType>
         <EntityType Name="Colleges">
           <Key>
             <PropertyRef Name="Id" />
@@ -80,6 +88,18 @@
           <Property Name="Libelle" Type="nvarchar" MaxLength="255" Nullable="false" />
           <Property Name="Ordre" Type="int" Nullable="false" />
         </EntityType>
+        <Association Name="FK_Actions-CLAS_College">
+          <End Role="Colleges" Type="Self.Colleges" Multiplicity="1" />
+          <End Role="Actions-CLAS" Type="Self.Actions-CLAS" Multiplicity="0..1" />
+          <ReferentialConstraint>
+            <Principal Role="Colleges">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="Actions-CLAS">
+              <PropertyRef Name="College_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="*" />
@@ -117,10 +137,15 @@
           </ReferentialConstraint>
         </Association>
         <EntityContainer Name="ModeleMVCStoreContainer">
+          <EntitySet Name="Actions-CLAS" EntityType="Self.Actions-CLAS" 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" />
           <EntitySet Name="TypesCollege" EntityType="Self.TypesCollege" Schema="dbo" store:Type="Tables" />
+          <AssociationSet Name="FK_Actions-CLAS_College" Association="Self.FK_Actions-CLAS_College">
+            <End Role="Colleges" EntitySet="Colleges" />
+            <End Role="Actions-CLAS" EntitySet="Actions-CLAS" />
+          </AssociationSet>
           <AssociationSet Name="FK_Colleges_Territoires" Association="Self.FK_Colleges_Territoires">
             <End Role="Territoires" EntitySet="Territoires" />
             <End Role="Colleges" EntitySet="Colleges" />
@@ -155,6 +180,11 @@
             <End Role="College" EntitySet="Colleges" />
             <End Role="Identite" EntitySet="Identites" />
           </AssociationSet>
+          <EntitySet Name="ActionsCLAS" 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" />
+          </AssociationSet>
           </EntityContainer>
         <EntityType Name="TypeCollege">
           <Key>
@@ -201,6 +231,7 @@
           <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="Actions_CLAS" Relationship="CD67.FicheCollege.FK_Actions_CLAS_College" FromRole="College" ToRole="Actions_CLAS" />
         </EntityType>
         <Association Name="FK_Colleges_Territoires">
           <End Type="CD67.FicheCollege.Territoire" Role="Territoire" Multiplicity="0..1" />
@@ -273,6 +304,27 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityType Name="ActionCLAS">
+          <Key>
+            <PropertyRef Name="College_Id" />
+          </Key>
+          <Property Name="College_Id" Type="String" Nullable="false" MaxLength="8" FixedLength="false" Unicode="true" />
+          <Property Name="Action" Type="Boolean" />
+          <Property Name="Commentaire" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="College" Relationship="CD67.FicheCollege.FK_Actions_CLAS_College" FromRole="Actions_CLAS" ToRole="College" />
+        </EntityType>
+        <Association Name="FK_Actions_CLAS_College">
+          <End Type="CD67.FicheCollege.College" Role="College" Multiplicity="1" />
+          <End Type="CD67.FicheCollege.ActionCLAS" Role="Actions_CLAS" Multiplicity="0..1" />
+          <ReferentialConstraint>
+            <Principal Role="College">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="Actions_CLAS">
+              <PropertyRef Name="College_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
@@ -358,6 +410,15 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="ActionsCLAS">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.ActionCLAS">
+              <MappingFragment StoreEntitySet="Actions-CLAS">
+                <ScalarProperty Name="Commentaire" ColumnName="Commentaire" />
+                <ScalarProperty Name="Action" ColumnName="Action" />
+                <ScalarProperty Name="College_Id" ColumnName="College_Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
         </EntityContainerMapping>
 </Mapping></edmx:Mappings>
   </edmx:Runtime>

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

@@ -12,6 +12,8 @@
         <AssociationConnector Association="CD67.FicheCollege.FK_Colleges_TypesCollege" />
         <EntityTypeShape EntityType="CD67.FicheCollege.Identite" Width="1.875" PointX="5.125" PointY="1.125" />
         <AssociationConnector Association="CD67.FicheCollege.FK_FicheIdentite_College" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionCLAS" Width="1.5" PointX="7.5" PointY="1.125" />
+        <AssociationConnector Association="CD67.FicheCollege.FK_Actions_CLAS_College" />
         </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 28 - 0
CD67.FicheCollege.Entity/Extend/ActionCLAS.cs

@@ -0,0 +1,28 @@
+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(ActionCLAS_Metadata))]
+    public partial class ActionCLAS
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class ActionCLAS_Metadata
+    {
+        [UIHint("YesNoBool")]
+        public Nullable<bool> Action { get; set; }
+        [DataType(DataType.MultilineText)]
+        public string Commentaire { get; set; }
+    }
+}

+ 30 - 0
CD67.FicheCollege.Factory/ActionCLASFactory.cs

@@ -0,0 +1,30 @@
+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>
+    {
+        public override Entity.ActionCLAS getById(params object[] keyValues)
+        {
+            //si l'élément n'existe pas, on le créé
+            Entity.ActionCLAS item = base.getById(keyValues);
+            if(item == null)
+            {
+                string id = keyValues[0].ToString();
+                item = new ActionCLAS()
+                {
+                    College_Id = id
+                };
+                this.add(ref item);
+                dbContext.Entry(item).Reference(i => i.College).Load();
+            }
+
+            return item;
+        }
+    }
+}

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

@@ -55,7 +55,11 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="CollegeFactory.cs" />
+    <Compile Include="ActionCLASFactory.cs" />
     <Compile Include="IdentiteFactory.cs" />
+    <Compile Include="Internal\ActionCLASFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
     <Compile Include="Internal\CollegeFactory.cs">
       <DependentUpon>GenericFactories.tt</DependentUpon>
     </Compile>

+ 9 - 0
CD67.FicheCollege.Factory/CollegeFactory.cs

@@ -21,6 +21,15 @@ namespace CD67.FicheCollege.Factory
                 identiteFactory.delete(ref identite);
             }
 
+            //ActionsCLAS
+            ActionCLASFactory actionCLASFactory = new ActionCLASFactory(dbContext);
+            if (entity.Actions_CLAS == null) dbContext.Entry(entity).Reference(i => i.Actions_CLAS).Load();
+            if (entity.Actions_CLAS != null)
+            {
+                Entity.ActionCLAS actionCLAS = entity.Actions_CLAS;
+                actionCLASFactory.delete(ref actionCLAS);
+            }
+
             base.delete(ref entity);
         }
     }

+ 6 - 5
CD67.FicheCollege.Factory/IdentiteFactory.cs

@@ -12,18 +12,19 @@ namespace CD67.FicheCollege.Factory
         public override Identite getById(params object[] keyValues)
         {
             //si l'élément n'existe pas, on le créé
-            Entity.Identite identite = base.getById(keyValues);
-            if(identite ==null)
+            Entity.Identite item = base.getById(keyValues);
+            if(item ==null)
             {
                 string id = keyValues[0].ToString();
-                identite = new Identite()
+                item = new Identite()
                 {
                     College_Id = id
                 };
-                this.add(ref identite);
+                this.add(ref item);
+                dbContext.Entry(item).Reference(i => i.College).Load();
             }
 
-            return identite;
+            return item;
         }
     }
 }

+ 21 - 0
CD67.FicheCollege.Factory/Internal/ActionCLASFactory.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 ActionCLASFactory : Internal.BaseFactory<Entity.ActionCLAS>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public ActionCLASFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 5 - 0
CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj

@@ -156,8 +156,10 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App_Start\BundleConfig.cs" />
+    <Compile Include="Controllers\ActionsCLASController.cs" />
     <Compile Include="Controllers\AdminController.cs" />
     <Compile Include="Controllers\CollegesController.cs" />
+    <Compile Include="Controllers\GestionActionsController.cs" />
     <Compile Include="Controllers\HomeController.cs" />
     <Compile Include="Controllers\IdentitesController.cs" />
     <Compile Include="Controllers\TerritoireController.cs" />
@@ -387,6 +389,9 @@
     <Content Include="Views\Colleges\Index.cshtml" />
     <Content Include="Views\Identites\Details.cshtml" />
     <Content Include="Views\Identites\Edit.cshtml" />
+    <Content Include="Views\ActionsCLAS\Details.cshtml" />
+    <Content Include="Views\ActionsCLAS\Edit.cshtml" />
+    <Content Include="Views\GestionActions\Index.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />

+ 87 - 0
CD67.FicheCollege.MVC/Controllers/ActionsCLASController.cs

@@ -0,0 +1,87 @@
+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.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+
+namespace CD67.FicheCollege.MVC.Controllers
+{
+    public class ActionsCLASController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: ActionCLAS/Details/5
+        public ActionResult Details(string id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionCLASFactory actionClasFactory = new ActionCLASFactory(db);
+            Entity.ActionCLAS actionClas = actionClasFactory.getById(id);
+            if (actionClas == null)
+            {
+                return HttpNotFound();
+            }
+            return View(GetViewModel(actionClas, Models.ModeAcces.Lecture));
+        }
+
+        // GET: ActionCLAS/Edit/5
+        public ActionResult Edit(string id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionCLASFactory actionClasFactory = new ActionCLASFactory(db);
+            Entity.ActionCLAS actionClas = actionClasFactory.getById(id);
+            if (actionClas == null)
+            {
+                return HttpNotFound();
+            }
+            return View(GetViewModel(actionClas, Models.ModeAcces.Modification));
+        }
+
+        // POST: ActionCLAS/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(ActionCLAS Contenu)
+        {
+            if (ModelState.IsValid)
+            {
+                ActionCLASFactory actionClasFactory = new ActionCLASFactory(db);
+                actionClasFactory.update(ref Contenu);
+                return RedirectToAction("Index");
+            }
+            return View(GetViewModel(Contenu, Models.ModeAcces.Modification));
+        }
+
+        private Models.CollegeViewModel GetViewModel(Entity.ActionCLAS entity, Models.ModeAcces Acces)
+        {
+            return new Models.CollegeViewModel()
+            {
+                College_Id = entity.College.Id,
+                College_Libelle = entity.College.Libelle,
+                Contenu = entity,
+                Acces = Acces,
+                Listes = null
+            };
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+    }
+}

+ 22 - 0
CD67.FicheCollege.MVC/Controllers/GestionActionsController.cs

@@ -0,0 +1,22 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Controllers
+{
+    public class GestionActionsController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: GestionActions
+        public ActionResult Index()
+        {
+            CollegeFactory collegeFactory = new CollegeFactory(db);
+            return View(collegeFactory.getAll());
+        }
+    }
+}

+ 6 - 0
CD67.FicheCollege.MVC/Mvc.sitemap

@@ -14,10 +14,16 @@
         <mvcSiteMapNode title="Identité" controller="Identites" action="Details" preservedRouteParameters="id" >
           <mvcSiteMapNode title="Edition de l'identité" controller="Identites" action="Edit" preservedRouteParameters="id" />
         </mvcSiteMapNode>
+
+        <mvcSiteMapNode title="Actions" controller="ActionsCLAS" action="Details" preservedRouteParameters="id" >
+          <mvcSiteMapNode title="Edition d'une action CLAS" controller="ActionsCLAS" action="Edit" preservedRouteParameters="id" />
+        </mvcSiteMapNode>
           
       </mvcSiteMapNode>
     </mvcSiteMapNode>
 
+    <mvcSiteMapNode title="Gestion des Actions" controller="GestionActions" action="Index" />
+    
     <mvcSiteMapNode title="Administration" controller="Admin" action="Index">
       <mvcSiteMapNode title="Types de collège" controller="TypeCollege" action="Index">
         <mvcSiteMapNode title="Création d'un type de collège" controller="TypeCollege" action="Create" />

+ 48 - 0
CD67.FicheCollege.MVC/Views/ActionsCLAS/Details.cshtml

@@ -0,0 +1,48 @@
+@using CD67.FicheCollege.MVC.Models
+@model CollegeViewModel
+
+@{
+    ViewBag.Title = "Details";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionCLAS contenu = Model.Contenu as ActionCLAS;
+}
+
+<!-- Menu de niveau 2 -->
+<div>
+    <ul id="menu-l2">
+        <li id="li-menu-l2"><a id="a-li-menu-l2" class="btn-sm" href="@Url.Action("Details", "Colleges", new { Id = Model.College_Id })">Général</a></li>
+        <li id="li-menu-l2"><a id="a-li-menu-l2" class="btn-sm" href="@Url.Action("Details", "Identites", new { Id = Model.College_Id })/">Identité</a></li>
+        <li id="li-menu-l2"><a id="a-li-menu-l2-active" class="btn-sm" href="@Url.Action("Details", "ActionsCLAS", new { Id = Model.College_Id })/">Actions</a></li>
+    </ul>
+</div>
+
+
+<h1>@Model.College_Libelle</h1>
+
+<fieldset>
+    <legend>
+        Actions CLAS
+        @if (Model.Acces == ModeAcces.Lecture)
+        {
+            <div class="pull-right">
+                @Html.ActionLink("Modifier", "Edit", "ActionsCLAS", new { Id = Model.College_Id }, new { @class = "btn btn-default" })
+            </div>
+        }
+    </legend>
+
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => contenu.Action)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => contenu.Action)
+        </dd>
+
+        <dt>
+            @Html.DisplayNameFor(model => contenu.Commentaire)
+        </dt>
+
+        <dd style="white-space: pre-line;">@Html.DisplayFor(model => contenu.Commentaire)</dd>
+    </dl>
+</fieldset>

+ 54 - 0
CD67.FicheCollege.MVC/Views/ActionsCLAS/Edit.cshtml

@@ -0,0 +1,54 @@
+@using CD67.FicheCollege.MVC.Models
+@model CollegeViewModel
+
+@{
+    ViewBag.Title = "Edit";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionCLAS contenu = Model.Contenu as ActionCLAS;
+}
+
+<h1>@Model.College_Libelle</h1>
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+    
+        <fieldset>
+        <legend>
+            Actions CLAS - @Model.Acces.ToString()
+        </legend>
+        <div class="form-horizontal">
+            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+            @Html.HiddenFor(model => contenu.College_Id)
+
+            <div class="form-group">
+                @Html.LabelFor(model => contenu.Action, htmlAttributes: new { @class = "control-label col-md-2" })
+                <div class="col-md-10">
+                    <div class="checkbox">
+                        @Html.EditorFor(model => contenu.Action)
+                        @Html.ValidationMessageFor(model => contenu.Action, "", new { @class = "text-danger" })
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group">
+                @Html.LabelFor(model => contenu.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
+                <div class="col-md-10">
+                    @Html.EditorFor(model => contenu.Commentaire, new { htmlAttributes = new { @class = "form-control", @rows = 10 } })
+                    @Html.ValidationMessageFor(model => contenu.Commentaire, "", new { @class = "text-danger" })
+                </div>
+            </div>
+
+            <div class="form-group">
+                <div class="col-md-offset-2 col-md-10">
+                    <input type="submit" value="@Model.Acces.EnumDisplayNameFor(MvcHtmlHelpers.DisplayValue.Prompt)" class="btn btn-default" /> |
+                    @Html.ActionLink("Annuler", "Details", new { Id = Model.College_Id })
+                </div>
+            </div>
+        </div>
+    </fieldset>
+}
+
+@section Scripts {
+    @Scripts.Render("~/bundles/jqueryval")
+}

+ 1 - 0
CD67.FicheCollege.MVC/Views/Colleges/Details.cshtml

@@ -12,6 +12,7 @@
     <ul id="menu-l2">
         <li id="li-menu-l2"><a id="a-li-menu-l2-active" class="btn-sm" href="@Url.Action("Details", "Colleges", new { Id = Model.College_Id })">Général</a></li>
         <li id="li-menu-l2"><a id="a-li-menu-l2" class="btn-sm" href="@Url.Action("Details", "Identites", new { Id = Model.College_Id })/">Identité</a></li>
+        <li id="li-menu-l2"><a id="a-li-menu-l2" class="btn-sm" href="@Url.Action("Details", "ActionsCLAS", new { Id = Model.College_Id })/">Actions</a></li>
     </ul>
 </div>
 

+ 8 - 2
CD67.FicheCollege.MVC/Views/Colleges/Index.cshtml

@@ -19,6 +19,9 @@
         <th>
             @Html.DisplayNameFor(model => model.Id)
         </th>
+        <th>
+            @Html.DisplayNameFor(model => model.Libelle)
+        </th>
         <th>
             @Html.DisplayNameFor(model => model.Adresse)
         </th>
@@ -44,9 +47,12 @@
 
 @foreach (var item in Model) {
     <tr>
-        <th>
+        <td>
             @Html.ActionLink(item.Id, "Details", new { id = item.Id })
-        </th>
+        </td>
+        <td>
+            @Html.DisplayFor(modelItem => item.Libelle)
+        </td>
         <td>
             @Html.DisplayFor(modelItem => item.AdresseComplete)
         </td>

+ 55 - 0
CD67.FicheCollege.MVC/Views/GestionActions/Index.cshtml

@@ -0,0 +1,55 @@
+@model IEnumerable<CD67.FicheCollege.Entity.College>
+
+@{
+    ViewBag.Title = "Liste";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+}
+
+
+<h1>Actions</h1>
+
+<fieldset>
+    <legend>
+        Gestion des actions éducatives, sportives et Culturelles
+    </legend>
+
+    @Model.Count(i => i.Actions_CLAS.Action == true) collège(s) avec une action CLAS
+    <br /><br />
+    <table class="table">
+        <tr>
+            <th>
+                @Html.DisplayNameFor(model => model.Id)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Libelle)
+            </th>
+            <th>
+                CLAS
+            </th>
+            <th>
+                Commentaire CLAS
+            </th>
+            <th></th>
+        </tr>
+
+        @foreach (var item in Model)
+        {
+            <tr>
+                <td>
+                    @Html.DisplayFor(modelItem => item.Id)
+                </td>
+                <td>
+                    @Html.DisplayFor(modelItem => item.Libelle)
+                </td>
+                <td>
+                    @Html.DisplayFor(modelItem => item.Actions_CLAS.Action)
+                </td>
+                <td style="white-space: pre-line;">@Html.DisplayFor(modelItem => item.Actions_CLAS.Commentaire)</td>
+                <td>
+                    @Html.ActionLink("Modifier", "Details", "ActionsCLAS", new { id = item.Id }, null)
+                </td>
+            </tr>
+        }
+
+    </table>
+</fieldset>

+ 1 - 0
CD67.FicheCollege.MVC/Views/Identites/Details.cshtml

@@ -12,6 +12,7 @@
     <ul id="menu-l2">
         <li id="li-menu-l2"><a id="a-li-menu-l2" class="btn-sm" href="@Url.Action("Details", "Colleges", new { Id = Model.College_Id })">Général</a></li>
         <li id="li-menu-l2"><a id="a-li-menu-l2-active" class="btn-sm" href="@Url.Action("Details", "Identites", new { Id = Model.College_Id })/">Identité</a></li>
+        <li id="li-menu-l2"><a id="a-li-menu-l2" class="btn-sm" href="@Url.Action("Details", "ActionsCLAS", new { Id = Model.College_Id })/">Actions</a></li>
     </ul>
 </div>
 

+ 10 - 3
CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml

@@ -84,21 +84,28 @@
             <ul class="sidebar-nav nav-stacked menu_principal">
                 <li>
                     <a href="@Url.Action("Index", "home", new { })">
-                        <div class="active menu-1">
+                        <div class="menu-1">
                             <span class="fa fa-home title">Accueil</span>
                         </div>
                     </a>
                 </li>
                 <li>
                     <a href="@Url.Action("Index", "Colleges", new { })">
-                        <div class="active menu-1">
+                        <div class="menu-1">
                             <span class="fa fa-building title">Collèges</span>
                         </div>
                     </a>
                 </li>
+                <li>
+                    <a href="@Url.Action("Index", "GestionActions", new { })">
+                        <div class="menu-1">
+                            <span class="fa fa-graduation-cap title">Actions</span>
+                        </div>
+                    </a>
+                </li>
                 <li>
                     <a href="@Url.Action("Index", "Admin", new { })">
-                        <div class="active menu-1">
+                        <div class="menu-1">
                             <span class="fa fa-cog title">Administration</span>
                         </div>
                     </a>