Преглед изворни кода

NEW Ajout d'une page dédiée à la gestion des actions

julien.legrand пре 8 година
родитељ
комит
cfe473b5ae

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

@@ -159,6 +159,7 @@
     <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" />
@@ -390,6 +391,7 @@
     <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\" />

+ 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());
+        }
+    }
+}

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

@@ -22,6 +22,8 @@
       </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" />

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

@@ -0,0 +1,50 @@
+@model IEnumerable<CD67.FicheCollege.Entity.College>
+
+@{
+    ViewBag.Title = "Liste";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+}
+
+<h2>Actions</h2>
+
+<p>
+    Gestion des actions éducatives, sportives et Culturelles
+</p>
+
+<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>

+ 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>