瀏覽代碼

Ajout des views, controlers et viewmodels pour les axes et thématiques

olivier.massot 7 年之前
父節點
當前提交
c4d8c9c1c4

+ 1 - 1
CD67.FicheCollege.Entity/Extend/ActionEduAxe.cs

@@ -24,7 +24,7 @@ namespace CD67.FicheCollege.Entity
         public int Id { get; set; }
 
         [Required(ErrorMessage = "Obligatoire")]
-        [Display(Name = "Action")]
+        [Display(Name = "Axe")]
         public string Nom { get; set; }
 
         [Display(Name = "Neutralisé (oui/non)")]

+ 1 - 1
CD67.FicheCollege.Entity/Extend/ActionEduThematique.cs

@@ -24,7 +24,7 @@ namespace CD67.FicheCollege.Entity
         public int Id { get; set; }
 
         [Required(ErrorMessage = "Obligatoire")]
-        [Display(Name = "Action")]
+        [Display(Name = "Thématique")]
         public string Nom { get; set; }
 
         [Display(Name = "Neutralisé (oui/non)")]

+ 68 - 0
CD67.FicheCollege.Factory/ActionEduAxeFactory.cs

@@ -0,0 +1,68 @@
+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 ActionEduAxeFactory : Internal.BaseFactory<Entity.ActionEduAxe>
+    {
+        public override IQueryable<Entity.ActionEduAxe> getAll()
+        {
+            return base.getAll("Ordre");
+        }
+
+        public void Up(ref Entity.ActionEduAxe item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == 1) return;
+
+            Entity.TypeCollege itemToSubstitute = dbContext.TypesCollege.Where(i => i.Ordre == ordre - 1).First();
+            itemToSubstitute.Ordre += 1;
+            item.Ordre -= 1;
+            dbContext.SaveChanges();
+        }
+
+        public void Down(ref Entity.ActionEduAxe item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == dbContext.TypesCollege.Max(i => i.Ordre)) return;
+
+            Entity.TypeCollege itemToSubstitute = dbContext.TypesCollege.Where(i => i.Ordre == ordre + 1).First();
+            itemToSubstitute.Ordre -= 1;
+            item.Ordre += 1;
+            dbContext.SaveChanges();
+        }
+
+        private void Sort()
+        {
+            int ordre = 1;
+            foreach (Entity.ActionEduAxe statut in dbContext.ActionEduAxes.OrderBy(i => i.Ordre))
+            {
+                statut.Ordre = ordre++;
+            }
+            dbContext.SaveChanges();
+        }
+
+        public override void add(ref Entity.ActionEduAxe entity)
+        {
+            //Initialisation de l'ordre
+            if (dbContext.TypesCollege.Count() == 0) entity.Ordre = 1;
+            else entity.Ordre = dbContext.TypesCollege.Max(i => i.Ordre) + 1;
+
+            base.add(ref entity);
+        }
+
+        public override void delete(ref Entity.ActionEduAxe entity)
+        {
+            base.delete(ref entity);
+            Sort();
+        }
+    }
+}

+ 68 - 0
CD67.FicheCollege.Factory/ActionEduThematiqueFactory.cs

@@ -0,0 +1,68 @@
+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 ActionEduThematiqueFactory : Internal.BaseFactory<Entity.ActionEduThematique>
+    {
+        public override IQueryable<Entity.ActionEduThematique> getAll()
+        {
+            return base.getAll("Ordre");
+        }
+
+        public void Up(ref Entity.ActionEduThematique item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == 1) return;
+
+            Entity.TypeCollege itemToSubstitute = dbContext.TypesCollege.Where(i => i.Ordre == ordre - 1).First();
+            itemToSubstitute.Ordre += 1;
+            item.Ordre -= 1;
+            dbContext.SaveChanges();
+        }
+
+        public void Down(ref Entity.ActionEduThematique item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == dbContext.TypesCollege.Max(i => i.Ordre)) return;
+
+            Entity.TypeCollege itemToSubstitute = dbContext.TypesCollege.Where(i => i.Ordre == ordre + 1).First();
+            itemToSubstitute.Ordre -= 1;
+            item.Ordre += 1;
+            dbContext.SaveChanges();
+        }
+
+        private void Sort()
+        {
+            int ordre = 1;
+            foreach (Entity.ActionEduThematique statut in dbContext.ActionEduThematiques.OrderBy(i => i.Ordre))
+            {
+                statut.Ordre = ordre++;
+            }
+            dbContext.SaveChanges();
+        }
+
+        public override void add(ref Entity.ActionEduThematique entity)
+        {
+            //Initialisation de l'ordre
+            if (dbContext.TypesCollege.Count() == 0) entity.Ordre = 1;
+            else entity.Ordre = dbContext.TypesCollege.Max(i => i.Ordre) + 1;
+
+            base.add(ref entity);
+        }
+
+        public override void delete(ref Entity.ActionEduThematique entity)
+        {
+            base.delete(ref entity);
+            Sort();
+        }
+    }
+}

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

@@ -54,6 +54,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ActionEduThematiqueFactory.cs" />
     <Compile Include="AnneeFactory.cs" />
     <Compile Include="CollegeFactory.cs" />
     <Compile Include="IdentiteFactory.cs" />
@@ -89,6 +90,7 @@
     </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="TerritoireFactory.cs" />
+    <Compile Include="ActionEduAxeFactory.cs" />
     <Compile Include="TypeCollegeFactory.cs" />
   </ItemGroup>
   <ItemGroup>

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

@@ -175,6 +175,8 @@
     <Compile Include="Internal\MvcHtmlHelpers.cs" />
     <Compile Include="Internal\Navigation.cs" />
     <Compile Include="Internal\UtilisateurConnecteFactory.cs" />
+    <Compile Include="Models\ActionEduAxeViewModel.cs" />
+    <Compile Include="Models\ActionEduThematiqueViewModel.cs" />
     <Compile Include="Models\TypeCollegeViewModel.cs" />
     <Compile Include="Models\ActionEduViewModel.cs" />
     <Compile Include="Models\IdentiteViewModel.cs" />
@@ -399,11 +401,17 @@
     <Content Include="Views\Annees\Index.cshtml" />
     <Content Include="Views\Colleges\Index.cshtml" />
     <Content Include="Views\ActionsEdu\Index.cshtml" />
+    <Content Include="Views\ActionEduAxes\Create.cshtml" />
+    <Content Include="Views\ActionEduAxes\Delete.cshtml" />
+    <Content Include="Views\ActionEduAxes\Edit.cshtml" />
+    <Content Include="Views\ActionEduAxes\Index.cshtml" />
+    <Content Include="Views\ActionEduThematiques\Create.cshtml" />
+    <Content Include="Views\ActionEduThematiques\Delete.cshtml" />
+    <Content Include="Views\ActionEduThematiques\Edit.cshtml" />
+    <Content Include="Views\ActionEduThematiques\Index.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />
-    <Folder Include="Views\ActionEduAxes\" />
-    <Folder Include="Views\ActionEduThematiques\" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="packages.config">

+ 148 - 5
CD67.FicheCollege.MVC/Controllers/ActionEduAxesController.cs

@@ -1,17 +1,160 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Models;
+using System.Net;
 using System.Web.Mvc;
 
 namespace CD67.FicheCollege.MVC.Controllers
 {
     public class ActionEduAxesController : Controller
     {
+        private Entities db = new Entities();
+
         // GET: ActionAxes
         public ActionResult Index()
         {
-            return View();
+            ActionEduAxeFactory fact = new ActionEduAxeFactory(db);
+            ActionEduAxeIndexViewModel model = new ActionEduAxeIndexViewModel(fact.getAll());
+            return View(model);
+        }
+
+        // GET: ActionEduAxe/Details/5
+        public ActionResult Details(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+            Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
+            if (ActionEduAxe == null)
+            {
+                return HttpNotFound();
+            }
+            ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
+            return View(model);
+        }
+
+        // GET: ActionEduAxe/Create
+        public ActionResult Create()
+        {
+            ActionEduAxe ActionEduAxe = new ActionEduAxe();
+
+            ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
+            return View(model);
+        }
+
+        // POST: ActionEduAxe/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(ActionEduAxe ActionEduAxe)
+        {
+            if (ModelState.IsValid)
+            {
+                ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+                ActionEduAxeFactory.add(ref ActionEduAxe);
+                return RedirectToAction("Index");
+            }
+
+            ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
+            return View(model);
+        }
+
+        // GET: ActionEduAxe/Edit/5
+        public ActionResult Edit(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+            Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
+            if (ActionEduAxe == null)
+            {
+                return HttpNotFound();
+            }
+            ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
+            return View(model);
+        }
+
+        // POST: ActionEduAxe/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(ActionEduAxe ActionEduAxe)
+        {
+            if (ModelState.IsValid)
+            {
+                ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+                ActionEduAxeFactory.update(ref ActionEduAxe);
+                return RedirectToAction("Index");
+            }
+            ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
+            return View(model);
+        }
+
+        // GET: ActionEduAxe/Delete/5
+        public ActionResult Delete(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+            Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
+            if (ActionEduAxe == null)
+            {
+                return HttpNotFound();
+            }
+            ActionEduAxeViewModel model = new ActionEduAxeViewModel(ActionEduAxe);
+            return View(model);
+        }
+
+        // POST: ActionEduAxe/Delete/5
+        [HttpPost, ActionName("Delete")]
+        [ValidateAntiForgeryToken]
+        public ActionResult DeleteConfirmed(int id)
+        {
+            ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+            Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id);
+            ActionEduAxeFactory.delete(ref ActionEduAxe);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Up(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+            Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
+            ActionEduAxeFactory.Up(ref ActionEduAxe);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Down(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduAxeFactory ActionEduAxeFactory = new ActionEduAxeFactory(db);
+            Entity.ActionEduAxe ActionEduAxe = ActionEduAxeFactory.getById(id.Value);
+            ActionEduAxeFactory.Down(ref ActionEduAxe);
+            return RedirectToAction("Index");
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
         }
     }
 }

+ 148 - 6
CD67.FicheCollege.MVC/Controllers/ActionEduThematiquesController.cs

@@ -1,17 +1,159 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Models;
+using System.Net;
 using System.Web.Mvc;
 
 namespace CD67.FicheCollege.MVC.Controllers
 {
     public class ActionEduThematiquesController : Controller
     {
-        // GET: ActionThematiques
+        private Entities db = new Entities();
+
+        // GET: ActionAxes
         public ActionResult Index()
         {
-            return View();
+            ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(db);
+            ActionEduThematiqueIndexViewModel model = new ActionEduThematiqueIndexViewModel(fact.getAll());
+            return View(model);
+        }
+
+        // GET: ActionEduThematique/Details/5
+        public ActionResult Details(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+            Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
+            if (ActionEduThematique == null)
+            {
+                return HttpNotFound();
+            }
+            ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
+            return View(model);
+        }
+
+        // GET: ActionEduThematique/Create
+        public ActionResult Create()
+        {
+            Entity.ActionEduThematique ActionEduThematique = new Entity.ActionEduThematique();
+            ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
+            return View(model);
+        }
+
+        // POST: ActionEduThematique/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(ActionEduThematique ActionEduThematique)
+        {
+            if (ModelState.IsValid)
+            {
+                ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+                ActionEduThematiqueFactory.add(ref ActionEduThematique);
+                return RedirectToAction("Index");
+            }
+
+            ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
+            return View(model);
+        }
+
+        // GET: ActionEduThematique/Edit/5
+        public ActionResult Edit(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+            Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
+            if (ActionEduThematique == null)
+            {
+                return HttpNotFound();
+            }
+            ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
+            return View(model);
+        }
+
+        // POST: ActionEduThematique/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(ActionEduThematique ActionEduThematique)
+        {
+            if (ModelState.IsValid)
+            {
+                ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+                ActionEduThematiqueFactory.update(ref ActionEduThematique);
+                return RedirectToAction("Index");
+            }
+            ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
+            return View(model);
+        }
+
+        // GET: ActionEduThematique/Delete/5
+        public ActionResult Delete(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+            Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
+            if (ActionEduThematique == null)
+            {
+                return HttpNotFound();
+            }
+            ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(ActionEduThematique);
+            return View(model);
+        }
+
+        // POST: ActionEduThematique/Delete/5
+        [HttpPost, ActionName("Delete")]
+        [ValidateAntiForgeryToken]
+        public ActionResult DeleteConfirmed(int id)
+        {
+            ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+            Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id);
+            ActionEduThematiqueFactory.delete(ref ActionEduThematique);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Up(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+            Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
+            ActionEduThematiqueFactory.Up(ref ActionEduThematique);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Down(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            ActionEduThematiqueFactory ActionEduThematiqueFactory = new ActionEduThematiqueFactory(db);
+            Entity.ActionEduThematique ActionEduThematique = ActionEduThematiqueFactory.getById(id.Value);
+            ActionEduThematiqueFactory.Down(ref ActionEduThematique);
+            return RedirectToAction("Index");
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
         }
     }
 }

+ 27 - 0
CD67.FicheCollege.MVC/Models/ActionEduAxeViewModel.cs

@@ -0,0 +1,27 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Internal;
+using System.Collections.Generic;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Models
+{
+    public class ActionEduAxeViewModel : BaseViewModel<ActionEduAxe>
+    {
+        public ActionEduAxeViewModel(ActionEduAxe model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override string Annee_Lib { get { return ""; } }
+    }
+
+    public class ActionEduAxeIndexViewModel : BaseViewModel<IEnumerable<ActionEduAxe>>
+    {
+        public ActionEduAxeIndexViewModel(IEnumerable<ActionEduAxe> model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override string Annee_Lib { get { return ""; } }
+
+    }
+}

+ 27 - 0
CD67.FicheCollege.MVC/Models/ActionEduThematiqueViewModel.cs

@@ -0,0 +1,27 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Internal;
+using System.Collections.Generic;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Models
+{
+    public class ActionEduThematiqueViewModel : BaseViewModel<ActionEduThematique>
+    {
+        public ActionEduThematiqueViewModel(ActionEduThematique model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override string Annee_Lib { get { return ""; } }
+    }
+
+    public class ActionEduThematiqueIndexViewModel : BaseViewModel<IEnumerable<ActionEduThematique>>
+    {
+        public ActionEduThematiqueIndexViewModel(IEnumerable<ActionEduThematique> model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override string Annee_Lib { get { return ""; } }
+
+    }
+}

+ 44 - 0
CD67.FicheCollege.MVC/Views/ActionEduAxes/Create.cshtml

@@ -0,0 +1,44 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduAxeViewModel
+
+@{
+    ViewBag.Title = "Création";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionEduAxe axe = Model.Obj;
+}
+
+
+@using (Html.BeginForm()) 
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Axes</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => axe.Id)
+        @Html.HiddenFor(model => axe.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => axe.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => axe.Nom, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => axe.Nom, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Créer" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 35 - 0
CD67.FicheCollege.MVC/Views/ActionEduAxes/Delete.cshtml

@@ -0,0 +1,35 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduAxeViewModel
+
+@{
+    ViewBag.Title = "Suppression";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionEduAxe axe = Model.Obj;
+}
+
+<h2>Suppression</h2>
+
+<h3>Voulez-vous vraiment supprimer cet élément?</h3>
+<div>
+    <h4>Type collège</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => axe.Nom)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => axe.Nom)
+        </dd>
+
+    </dl>
+
+    @using (Html.BeginForm()) {
+        @Html.AntiForgeryToken()
+
+        <div class="form-actions no-color">
+            <input type="submit" value="Supprimer" class="btn btn-default" /> |
+            @Html.ActionLink("Retour à la liste", "Index")
+        </div>
+    }
+</div>

+ 46 - 0
CD67.FicheCollege.MVC/Views/ActionEduAxes/Edit.cshtml

@@ -0,0 +1,46 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduAxeViewModel
+
+@{
+    ViewBag.Title = "Modification";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionEduAxe axe = Model.Obj;
+}
+
+<h2>Modification</h2>
+
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Type collège</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => axe.Id)
+        @Html.HiddenFor(model => axe.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => axe.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => axe.Nom, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => axe.Nom, "", 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-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 67 - 0
CD67.FicheCollege.MVC/Views/ActionEduAxes/Index.cshtml

@@ -0,0 +1,67 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduAxeIndexViewModel
+
+@{
+    ViewBag.Title = "Liste";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
+    int row = 1;
+}
+
+<h2>Liste</h2>
+
+<p>
+    <a href="@Url.Action("Create")">
+        <span class="glyphicon glyphicon-plus-sign fa-2x color1" style="vertical-align: middle" aria-hidden="true"></span>
+        Créer un nouvel élément
+    </a>
+</p>
+
+<table class="table">
+    <tr>
+        <th>
+            @*@Html.DisplayNameFor(model => model.Obj.Libelle)*@
+        </th>
+        <th></th>
+    </tr>
+
+    @foreach (var item in Model.Obj)
+    {
+        <tr>
+            <td>
+                @Html.DisplayFor(modelItem => item.Nom)
+            </td>
+        
+            <td>
+                @if (row != 1)
+                    {
+                    <a href="@Url.Action("Up", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-up fa-2x color1" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-up fa-2x color2" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                @if (item.Ordre != maxOrdre)
+                    {
+                    <a href="@Url.Action("Down", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-down fa-2x color1" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-down fa-2x color2" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                <a href="@Url.Action("Edit", new { id = item.Id })">
+                    <span class="glyphicon glyphicon-edit fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
+                </a>
+                <a href="@Url.Action("Delete", new { id = item.Id })">
+                    <span class="glyphicon glyphicon-remove-sign fa-2x color1" title="Supprimer" style="vertical-align: middle" aria-hidden="true"></span>
+                </a>
+            </td>
+        </tr>
+        row += 1;
+    }
+
+</table>

+ 44 - 0
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Create.cshtml

@@ -0,0 +1,44 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduThematiqueViewModel
+
+@{
+    ViewBag.Title = "Création";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionEduThematique thematique = Model.Obj;
+}
+
+
+@using (Html.BeginForm()) 
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Thématique</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => thematique.Id)
+        @Html.HiddenFor(model => thematique.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => thematique.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => thematique.Nom, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => thematique.Nom, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Créer" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 35 - 0
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Delete.cshtml

@@ -0,0 +1,35 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduThematiqueViewModel
+
+@{
+    ViewBag.Title = "Suppression";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionEduThematique thematique = Model.Obj;
+}
+
+<h2>Suppression</h2>
+
+<h3>Voulez-vous vraiment supprimer cet élément?</h3>
+<div>
+    <h4>Type collège</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => thematique.Nom)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => thematique.Nom)
+        </dd>
+
+    </dl>
+
+    @using (Html.BeginForm()) {
+        @Html.AntiForgeryToken()
+
+        <div class="form-actions no-color">
+            <input type="submit" value="Supprimer" class="btn btn-default" /> |
+            @Html.ActionLink("Retour à la liste", "Index")
+        </div>
+    }
+</div>

+ 46 - 0
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Edit.cshtml

@@ -0,0 +1,46 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduThematiqueViewModel
+
+@{
+    ViewBag.Title = "Modification";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    ActionEduThematique thematique = Model.Obj;
+}
+
+<h2>Modification</h2>
+
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Type collège</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => thematique.Id)
+        @Html.HiddenFor(model => thematique.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => thematique.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => thematique.Nom, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => thematique.Nom, "", 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-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 67 - 0
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Index.cshtml

@@ -0,0 +1,67 @@
+@using CD67.FicheCollege.MVC.Models
+@model ActionEduThematiqueIndexViewModel
+
+@{
+    ViewBag.Title = "Liste";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
+    int row = 1;
+}
+
+<h2>Liste</h2>
+
+<p>
+    <a href="@Url.Action("Create")">
+        <span class="glyphicon glyphicon-plus-sign fa-2x color1" style="vertical-align: middle" aria-hidden="true"></span>
+        Créer un nouvel élément
+    </a>
+</p>
+
+<table class="table">
+    <tr>
+        <th>
+            @*@Html.DisplayNameFor(model => model.Obj.Libelle)*@
+        </th>
+        <th></th>
+    </tr>
+
+    @foreach (var item in Model.Obj)
+    {
+        <tr>
+            <td>
+                @Html.DisplayFor(modelItem => item.Nom)
+            </td>
+        
+            <td>
+                @if (row != 1)
+                    {
+                    <a href="@Url.Action("Up", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-up fa-2x color1" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-up fa-2x color2" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                @if (item.Ordre != maxOrdre)
+                    {
+                    <a href="@Url.Action("Down", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-down fa-2x color1" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-down fa-2x color2" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                <a href="@Url.Action("Edit", new { id = item.Id })">
+                    <span class="glyphicon glyphicon-edit fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
+                </a>
+                <a href="@Url.Action("Delete", new { id = item.Id })">
+                    <span class="glyphicon glyphicon-remove-sign fa-2x color1" title="Supprimer" style="vertical-align: middle" aria-hidden="true"></span>
+                </a>
+            </td>
+        </tr>
+        row += 1;
+    }
+
+</table>