Parcourir la source

Colleges CRUD ok

olivier.massot il y a 7 ans
Parent
commit
5d87d679df

+ 1 - 1
CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj

@@ -174,7 +174,7 @@
     <Compile Include="Internal\Navigation.cs" />
     <Compile Include="Internal\UtilisateurConnecteFactory.cs" />
     <Compile Include="Models\TopModel.cs" />
-    <Compile Include="Models\CollegeViewModel.cs" />
+    <Compile Include="Models\CollegeViewModel_old.cs" />
     <Compile Include="Models\ContactViewModel.cs" />
     <Compile Include="Models\ModeAcces.cs" />
     <Compile Include="Models\UtilisateurConnecte.cs" />

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/ActionsCLASController.cs

@@ -63,9 +63,9 @@ namespace CD67.FicheCollege.MVC.Controllers
             return View(GetViewModel(Contenu, Models.ModeAcces.Modification));
         }
 
-        private Models.CollegeViewModel GetViewModel(Entity.ActionCLAS action, Models.ModeAcces Acces)
+        private Models.CollegeViewModel_old GetViewModel(Entity.ActionCLAS action, Models.ModeAcces Acces)
         {
-            return new Models.CollegeViewModel()
+            return new Models.CollegeViewModel_old()
             {
                 College_Id = action.College.Id,
                 //CodeRne = action.College.CodeRne,

+ 1 - 1
CD67.FicheCollege.MVC/Controllers/AnneesController.cs

@@ -25,7 +25,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return HttpNotFound();
             }
 
-            TopModel model = new TopModel(annee);
+            AnneeViewModel model = new AnneeViewModel(annee);
             return View(model);
         }
     }

+ 31 - 35
CD67.FicheCollege.MVC/Controllers/CollegesController.cs

@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.Entity;
-using System.Linq;
-using System.Net;
-using System.Web;
+using System.Net;
 using System.Web.Mvc;
 using CD67.FicheCollege.Entity;
 using CD67.FicheCollege.Factory;
@@ -17,18 +11,20 @@ namespace CD67.FicheCollege.MVC.Controllers
     {
         private Entities db = new Entities();
 
-        // GET: College
+        // GET: Colleges
         public ActionResult Index(int? annee_id)
         {
             if (annee_id == null)
             {
                 return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
             }
-            TopModel model = new TopModel(db.Colleges.Where(c=>c.Annee_Id == annee_id), ModeAcces.Lecture);
+            AnneeFactory fact = new AnneeFactory(db);
+            Annee annee = fact.getById(annee_id);
+            AnneeViewModel model = new AnneeViewModel(annee, ModeAcces.Lecture);
             return View(model);
         }
 
-        // GET: College/Details/5
+        // GET: Colleges/Details/5
         public ActionResult Details(int? id)
         {
             if (id == null)
@@ -42,45 +38,46 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return HttpNotFound();
             }
 
-            TopModel model = new TopModel(college, ModeAcces.Lecture);
+            CollegeViewModel model = new CollegeViewModel(college, ModeAcces.Lecture);
 
             return View(model);
         }
 
-        // GET: College/Create
-        public ActionResult Create()
+        // GET: Colleges/Create
+        public ActionResult Create(int? annee_id)
         {
+            if (annee_id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
             Entity.College college = new Entity.College();
+            college.Annee_Id = annee_id.Value;
 
-            TopModel model = new TopModel(college, ModeAcces.Creation);
-            model.Bag["Select_TypeCollege"] = new SelectList(db.TypesCollege.OrderBy(t=>t.Ordre).ToList());
-            model.Bag["Select_CodePostaux"] = new SelectList(Referentiel.GetCodesPostaux(college.Commune_Insee));
+            CollegeViewModel model = new CollegeViewModel(college, ModeAcces.Creation);
 
             return View("Edit", model);
         }
 
-        // POST: College/Create
+        // POST: Colleges/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(Entity.College college, string commentaire)
+        public ActionResult Create(Entity.College college)
         {
             if (ModelState.IsValid)
             {
                 CollegeFactory collegeFactory = new CollegeFactory(db);
                 collegeFactory.add(ref college);
-                return RedirectToAction("Index");
+                return RedirectToAction("Details", new { id = college.Id });
             }
 
-            TopModel model = new TopModel(college, ModeAcces.Creation);
-            model.Bag["Select_TypeCollege"] = new SelectList(db.TypesCollege.ToList(), college.TypeCollege_Id);
-            model.Bag["Select_CodePostaux"] = new SelectList(Referentiel.GetCodesPostaux(college.Commune_Insee), college.Commune_Insee);
+            CollegeViewModel model = new CollegeViewModel(college, ModeAcces.Creation);
 
             return View("Edit", model);
         }
 
-        // GET: College/Edit/5
+        // GET: Colleges/Edit/5
         public ActionResult Edit(int? id)
         {
             CollegeFactory collegeFactory = new CollegeFactory(db);
@@ -90,14 +87,12 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return HttpNotFound();
             }
 
-            TopModel model = new TopModel(college, ModeAcces.Modification);
-            model.Bag["Select_TypeCollege"] = new SelectList(db.TypesCollege.ToList(), college.TypeCollege_Id);
-            model.Bag["Select_CodePostaux"] = new SelectList(Referentiel.GetCodesPostaux(college.Commune_Insee), college.Commune_Insee);
+            CollegeViewModel model = new CollegeViewModel(college, ModeAcces.Modification);
 
             return View(model);
         }
 
-        // POST: College/Edit/5
+        // POST: Colleges/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]
@@ -111,9 +106,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return RedirectToAction("Details", new { Id = college.Id });
             }
 
-            TopModel model = new TopModel(college, ModeAcces.Modification);
-            model.Bag["Select_TypeCollege"] = new SelectList(db.TypesCollege.ToList(), college.TypeCollege_Id);
-            model.Bag["Select_CodePostaux"] = new SelectList(Referentiel.GetCodesPostaux(college.Commune_Insee), college.Commune_Insee);
+            CollegeViewModel model = new CollegeViewModel(college, ModeAcces.Modification);
 
             return View(model);
         }
@@ -132,9 +125,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return HttpNotFound();
             }
 
-            TopModel model = new TopModel(college, ModeAcces.Suppression);
-            model.Bag["Select_TypeCollege"] = new SelectList(db.TypesCollege.ToList(), college.TypeCollege_Id);
-            model.Bag["Select_CodePostaux"] = new SelectList(Referentiel.GetCodesPostaux(college.Commune_Insee), college.Commune_Insee);
+            CollegeViewModel model = new CollegeViewModel(college, ModeAcces.Suppression);
 
             return View("Details", model);
         }
@@ -142,12 +133,17 @@ namespace CD67.FicheCollege.MVC.Controllers
         // POST: College/Delete/5
         [HttpPost, ActionName("Delete")]
         [ValidateAntiForgeryToken]
-        public ActionResult DeleteConfirmed(string id)
+        public ActionResult DeleteConfirmed(int? id)
         {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
             CollegeFactory collegeFactory = new CollegeFactory(db);
             Entity.College college = collegeFactory.getById(id);
+            int annee_id = college.Annee_Id;
             collegeFactory.delete(ref college);
-            return RedirectToAction("Index");
+            return RedirectToAction("Index", new { annee_id = annee_id });
         }
 
         protected override void Dispose(bool disposing)

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/IdentitesController.cs

@@ -63,7 +63,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             return View(GetViewModel(Contenu, Models.ModeAcces.Modification));
         }
 
-        private Models.CollegeViewModel GetViewModel(Entity.Identite entity, Models.ModeAcces Acces)
+        private Models.CollegeViewModel_old GetViewModel(Entity.Identite entity, Models.ModeAcces Acces)
         {
             object contenu;
             if (Acces == Models.ModeAcces.Lecture)
@@ -77,7 +77,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
             else contenu = entity;
 
-            return new Models.CollegeViewModel()
+            return new Models.CollegeViewModel_old()
             {
                 College_Id = entity.College.Id,
                 College_Libelle = entity.College.Libelle,

+ 1 - 1
CD67.FicheCollege.MVC/Models/CollegeViewModel.cs → CD67.FicheCollege.MVC/Models/CollegeViewModel_old.cs

@@ -6,7 +6,7 @@ using System.Web.Mvc;
 
 namespace CD67.FicheCollege.MVC.Models
 {
-    public class CollegeViewModel
+    public class CollegeViewModel_old
     {
         public int College_Id { get; set; }
         public string College_Libelle { get; set; }

+ 57 - 25
CD67.FicheCollege.MVC/Models/TopModel.cs

@@ -1,22 +1,23 @@
 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
 {
     // Wrapper du modele qui permet d'emmener des informations supplementaires avec celui-ci.
-    public class TopModel
+    public abstract class TopModel
     {
-        // Modele de la page en cours
-        public dynamic Model { get; set; }
-        // Obj est l'equivalent de Model, en peut-être plus clair
-        public dynamic Obj { get { return Model; } }
+        internal object _Obj;
+
+        public abstract string Annee_Lib { get; }
 
         // (Facultatif) Mode d'accès à la page
         // Defaut: Lecture
         public ModeAcces Acces { get; set; }
 
-        // Permet d'emporter d'éventuelles données complémentaires
+        // (Facultatif) Permet d'emporter d'éventuelles données complémentaires
         // comme les listes qui serviront entre autre à peupler les listes déroulantes.
         public Dictionary<string, object> Bag { get; set; } = new Dictionary<string, object>();
 
@@ -25,43 +26,74 @@ namespace CD67.FicheCollege.MVC.Models
 
         // ***************************
         // Constructeur de base
-        public TopModel(object model, 
+        public TopModel(object model,
             ModeAcces acces = ModeAcces.Lecture,
             Dictionary<string, object> bag = null)
         {
-            Model = model;
+            _Obj = model;
             Acces = acces;
             if (bag != null)
                 Bag = bag;
         }
 
-        // Constructeurs particuliers
-        public TopModel(Annee model,
-            ModeAcces acces = ModeAcces.Lecture,
-            Dictionary<string, object> bag = null)
+    }
+
+    public class AnneeViewModel : TopModel
+    {
+        public AnneeViewModel(object model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
         {
-            Model = model;
-            Acces = acces;
-            if (bag != null)
-                Bag = bag;
+        }
 
-            Bag["Annee_Lib"] = model.Libelle;
+        public Annee Obj
+        {
+            get
+            {
+                return (_Obj as Annee);
+            }
         }
 
-        public TopModel(College model,
-            ModeAcces acces = ModeAcces.Lecture,
-            Dictionary<string, object> bag = null)
+        public override string Annee_Lib
         {
-            Model = model;
-            Acces = acces;
-            if (bag != null)
-                Bag = bag;
+            get
+            {
+                return Obj.Libelle;
+            }
+        }
+
+    }
+
+    public class CollegeViewModel : TopModel
+    {
+        private Entities db = new Entities();
 
-            Bag["Annee_Lib"] = model.Annee.Libelle;
+        public SelectList Sel_TypesCollege;
+        public SelectList Sel_CodesPostaux;
+
+        public CollegeViewModel(object model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+            if (acces == ModeAcces.Creation | acces == ModeAcces.Modification)
+            {
+                TypeCollegeFactory fact = new TypeCollegeFactory(db);
+                Sel_TypesCollege = new SelectList(fact.getAll(), "Id", "Libelle", Obj.TypeCollege_Id);
+                Sel_CodesPostaux = new SelectList(Referentiel.GetCodesPostaux(Obj.Commune_Insee), Obj.Code_Postal);
+            }
         }
 
+        public College Obj {
+            get {
+                return (_Obj as College);
+            }
+        }
+
+        public override string Annee_Lib
+        {
+            get {
+                return Obj.Annee.Libelle;
+            }
+        }
 
 
 
     }
+
 }

+ 6 - 7
CD67.FicheCollege.MVC/Views/Annees/Details.cshtml

@@ -1,16 +1,15 @@
 @using CD67.FicheCollege.MVC.Models
-@model TopModel
+@model AnneeViewModel
 
-<title>Fiches Collèges @Model.Bag["Annee_Lib"]</title>
+<title>Fiches Collèges @Model.Annee_Lib</title>
 
 @{
-    ViewBag.Title = "Fiches Collèges " + @Model.Bag["Annee_Lib"];
+    ViewBag.Title = "Fiches Collèges " + @Model.Annee_Lib;
     Layout = "~/Views/Shared/_Layout.cshtml";
-    Annee annee = (Model.Obj as Annee);
 }
 
-<h1>Accueil @(annee.Libelle)</h1>
+<h1>Accueil @(Model.Obj.Libelle)</h1>
 
-@Html.ActionLink("Les collèges", "Index", "Colleges", new { annee_id = annee.Id }, null)<br />
-@Html.ActionLink("Les actions éducatives, sportives et culturelles", "Index", "Colleges", new { annee_id = annee.Id }, null)<br />
+@Html.ActionLink("Les collèges", "Index", "Colleges", new { annee_id = Model.Obj.Id }, null)<br />
+@Html.ActionLink("Les actions éducatives, sportives et culturelles", "Index", "Colleges", new { annee_id = Model.Obj.Id }, null)<br />
 @Html.ActionLink("La page d'administration du site", "Index", "Admin")<br />

+ 2 - 2
CD67.FicheCollege.MVC/Views/Colleges/Details.cshtml

@@ -1,10 +1,10 @@
 @using CD67.FicheCollege.MVC.Models
-@model TopModel
+@model CollegeViewModel
 
 @{
     ViewBag.Title = "Details";
     Layout = "~/Views/Shared/_Layout.cshtml";
-    College college = (Model.Obj as College);
+    College college = Model.Obj;
 }
 
 <h1>

+ 23 - 14
CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml

@@ -1,42 +1,47 @@
 @using CD67.FicheCollege.MVC.Models
-@model TopModel
+@model CollegeViewModel
 
 @{
     ViewBag.Title = "Ajout";
     Layout = "~/Views/Shared/_Layout.cshtml";
-    College college = (Model.Obj as College);
+    College college = Model.Obj;
 }
 
-<h1>@college.Libelle</h1>
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h1>@college.Libelle</h1>
+}
+else
+{
+    <h1>Nouveau collège</h1>
+}
 
 @using (Html.BeginForm())
 {
     @Html.AntiForgeryToken()
 
     <fieldset>
+
         <legend>
             Informations générales - @Model.Acces.ToString()
         </legend>
+
         <div class="form-horizontal">
             <h4>Collège</h4>
             <hr />
+
             @Html.ValidationSummary(true, "", new { @class = "text-danger" })
 
             @if (Model.Acces == ModeAcces.Modification)
             {
                 @Html.HiddenFor(model => college.Id)
             }
+            @Html.HiddenFor(model => college.Annee_Id)
+
             <div class="form-group">
                 @Html.LabelFor(model => college.CodeRne, htmlAttributes: new { @class = "control-label col-md-2" })
                 <div class="col-md-10">
-                    @if (Model.Acces == ModeAcces.Modification)
-                    {
-                        @Html.EditorFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control", @disabled = true } })
-                    }
-                    else
-                    {
-                        @Html.EditorFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control" } })
-                    }
+                    @Html.EditorFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control" } })
                     @Html.ValidationMessageFor(model => college.CodeRne, "", new { @class = "text-danger" })
                 </div>
             </div>
@@ -52,7 +57,7 @@
             <div class="form-group">
                 @Html.LabelFor(model => college.TypeCollege_Id, htmlAttributes: new { @class = "control-label col-md-2" })
                 <div class="col-md-10">
-                    @Html.DropDownListFor(model => college.TypeCollege_Id, (Model.Bag["Select_TypeCollege"] as IEnumerable<SelectListItem>), htmlAttributes: new { @class = "form-control" })
+                    @Html.DropDownListFor(model => college.TypeCollege_Id, Model.Sel_TypesCollege, htmlAttributes: new { @class = "form-control" })
                     @Html.ValidationMessageFor(model => college.TypeCollege_Id, "", new { @class = "text-danger" })
                 </div>
             </div>
@@ -102,9 +107,13 @@
             <div class="form-group">
                 @Html.LabelFor(model => college.Code_Postal, htmlAttributes: new { @class = "control-label col-md-2" })
                 <div class="col-md-10">
-                    Code(s) postal(aux) associé(s) à la commune <span id="CP-warning" class="text-danger" style="@if ((Model.Bag["Select_CodePostaux"] as IEnumerable<SelectListItem>).Count() == 1) { <text>display: none;</text> }">(attention, plusieurs choix possibles)</span> : <input id="code_postaux" data-picker="commune.code_postal" value="@String.Join(",", (Model.Bag["Select_CodePostaux"] as IEnumerable<SelectListItem>).Select(i => i.Text))" class="disabled-input-as-label" />
+                    Code(s) postal(aux) associé(s) à la commune 
+                    @if (Model.Sel_CodesPostaux.Count() > 1) {
+                        <span id="CP-warning" class="text-danger">(attention, plusieurs choix possibles)</span>
+                    }
+                     : <input id="code_postaux" data-picker="commune.code_postal" value="@String.Join(",", Model.Sel_CodesPostaux.Select(i => i.Text))" class="disabled-input-as-label" />
                     <br />
-                    @Html.DropDownListFor(model => college.Code_Postal, (Model.Bag["Select_CodePostaux"] as IEnumerable<SelectListItem>), htmlAttributes: new { @class = "form-control" })
+                    @Html.DropDownListFor(model => college.Code_Postal, Model.Sel_CodesPostaux, htmlAttributes: new { @class = "form-control" })
                     @Html.ValidationMessageFor(model => college.Code_Postal, "", new { @class = "text-danger" })
                 </div>
             </div>

+ 22 - 23
CD67.FicheCollege.MVC/Views/Colleges/Index.cshtml

@@ -1,17 +1,16 @@
 @using CD67.FicheCollege.MVC.Models
-@model TopModel
-@*IEnumerable<CD67.FicheCollege.Entity.College>*@
+@model AnneeViewModel
 
 @{
     ViewBag.Title = "Liste";
     Layout = "~/Views/Shared/_Layout.cshtml";
-    IEnumerable<CD67.FicheCollege.Entity.College> colleges = Model.Obj;
+    College college_model = new College();
 }
 
 <h2>Index</h2>
 
 <p>
-    <a href="@Url.Action("Create")">
+    <a href="@Url.Action("Create", new { annee_id = Model.Obj.Id })">
         <span class="glyphicon glyphicon-plus-sign fa-2x color1" style="vertical-align: middle" aria-hidden="true"></span>
         Ajouter un nouveau collège
     </a>
@@ -20,62 +19,62 @@
 <table class="table">
     <tr>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Id)
+            @Html.DisplayNameFor(model => college_model.Id)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Libelle)
+            @Html.DisplayNameFor(model => college_model.Libelle)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Adresse)
+            @Html.DisplayNameFor(model => college_model.Adresse)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).CDC)
+            @Html.DisplayNameFor(model => college_model.CDC)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Tel)
+            @Html.DisplayNameFor(model => college_model.Tel)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Fax)
+            @Html.DisplayNameFor(model => college_model.Fax)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Email)
+            @Html.DisplayNameFor(model => college_model.Email)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).Territoire.Libelle)
+            @Html.DisplayNameFor(model => college_model.Territoire.Libelle)
         </th>
         <th>
-            @Html.DisplayNameFor(model => (model.Obj as College).TypeCollege.Libelle)
+            @Html.DisplayNameFor(model => college_model.TypeCollege.Libelle)
         </th>
     </tr>
 
-@foreach (College item in Model.Obj) {
+@foreach (College college in Model.Obj.Colleges) {
     <tr>
         <td>
-            @Html.ActionLink(item.CodeRne.ToString(), "Details", new { id = item.Id })
+            @Html.ActionLink(college.CodeRne.ToString(), "Details", new { id = college.Id })
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.Libelle)
+            @Html.DisplayFor(modelcollege => college.Libelle)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.AdresseComplete)
+            @Html.DisplayFor(modelcollege => college.AdresseComplete)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.CDC)
+            @Html.DisplayFor(modelcollege => college.CDC)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.Tel)
+            @Html.DisplayFor(modelcollege => college.Tel)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.Fax)
+            @Html.DisplayFor(modelcollege => college.Fax)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.Email)
+            @Html.DisplayFor(modelcollege => college.Email)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.Territoire.Libelle)
+            @Html.DisplayFor(modelcollege => college.Territoire.Libelle)
         </td>
         <td>
-            @Html.DisplayFor(modelItem => item.TypeCollege.Libelle)
+            @Html.DisplayFor(modelcollege => college.TypeCollege.Libelle)
         </td>
     </tr>
 }

+ 8 - 8
CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml

@@ -13,14 +13,14 @@
     int? annee_Id = null;
     string annee_Libelle = null;
 
-    if (Model is CollegeViewModel && Model.College_Id != null)
-    {
-        editionCollege = true;
-        college_Id = (Model as CollegeViewModel).College_Id;
-        college_Libelle = (Model as CollegeViewModel).College_Libelle;
-        annee_Id = (Model as CollegeViewModel).Annee_Id;
-        annee_Libelle = (Model as CollegeViewModel).Annee_Lib;
-    }
+    //if (Model is CollegeViewModel && Model.College_Id != null)
+    //{
+    //    editionCollege = true;
+    //    college_Id = (Model as CollegeViewModel).College_Id;
+    //    college_Libelle = (Model as CollegeViewModel).College_Libelle;
+    //    annee_Id = (Model as CollegeViewModel).Annee_Id;
+    //    annee_Libelle = (Model as CollegeViewModel).Annee_Lib;
+    //}
 }
 <!DOCTYPE html>
 <html lang="fr">