Explorar o código

#33 Creation Edition ok

olivier.massot %!s(int64=7) %!d(string=hai) anos
pai
achega
515257acf6

+ 4 - 3
CD67.FicheCollege.Entity/Extend/ActionEdu.cs

@@ -66,13 +66,14 @@ namespace CD67.FicheCollege.Entity
         [Display(Name = "Nom")]
         public string Nom { get; set; }
 
+        [Required]
+        [Display(Name = "Statut")]
+        public int StatutId { get; set; }
+
         [DataType(DataType.Currency)]
         [Display(Name = "Montant indicatif")]
         public decimal Montant { get; set; }
 
-        [Display(Name = "Tiers")]
-        public string TiersSid { get; set; }
-
         [Display(Name = "Description")]
         [DataType(DataType.MultilineText)]
         public string Description { get; set; }

+ 1 - 1
CD67.FicheCollege.Factory/ActionEduFactory.cs

@@ -79,12 +79,12 @@ namespace CD67.FicheCollege.Factory
             clone.Numero = actionEdu.Numero;
             clone.Nom = actionEdu.Nom;
             clone.Montant = actionEdu.Montant;
-            clone.TiersSid = actionEdu.TiersSid;
             clone.Description = actionEdu.Description;
             clone.CommentaireInterne = actionEdu.CommentaireInterne;
             clone.CommentairePublic = actionEdu.CommentairePublic;
             clone.Neutralise = actionEdu.Neutralise;
             clone.Ordre = actionEdu.Ordre;
+            clone.StatutId = actionEdu.StatutId;
             clone.ActionEduThematiqueId = actionEdu.ActionEduThematiqueId;
             clone.TokenId = actionEdu.TokenId;
 

+ 6 - 2
CD67.FicheCollege.MVC/Models/ActionEduViewModel.cs

@@ -9,13 +9,17 @@ namespace CD67.FicheCollege.MVC.Models
     public class ActionEduViewModel : BaseViewModel<ActionEdu>
     {
         public SelectList Sel_Thematique;
+        public SelectList Sel_Statut;
 
         public ActionEduViewModel(ActionEdu model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
         {
             if (acces == ModeAcces.Creation | acces == ModeAcces.Modification)
             {
-                ActionEduThematiqueFactory fact = new ActionEduThematiqueFactory(dbContext);
-                Sel_Thematique = new SelectList(fact.getAll(), "Id", "Nom", Obj.ActionEduThematiqueId);
+                ActionEduThematiqueFactory fact_thema = new ActionEduThematiqueFactory(dbContext);
+                Sel_Thematique = new SelectList(fact_thema.getAll(), "Id", "Nom", Obj.ActionEduThematiqueId);
+
+                ActionEduStatutFactory fact_statuts = new ActionEduStatutFactory(dbContext);
+                Sel_Statut = new SelectList(fact_statuts.getAll(), "Id", "Nom", Obj.StatutId);
             }
         }
 

+ 8 - 0
CD67.FicheCollege.MVC/Views/ActionsEdu/Create.cshtml

@@ -47,6 +47,14 @@
             </div>
         </div>
         
+        <div class="form-group">
+            @Html.LabelFor(model => actionEdu.StatutId, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.DropDownListFor(model => actionEdu.StatutId, Model.Sel_Statut, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => actionEdu.StatutId, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
         <div class="form-group">
             @Html.LabelFor(model => actionEdu.Montant, htmlAttributes: new { @class = "control-label col-md-2" })
             <div class="col-md-10">

+ 3 - 5
CD67.FicheCollege.MVC/Views/ActionsEdu/Edit.cshtml

@@ -55,13 +55,11 @@
         </div>
 
         <div class="form-group">
-            @Html.LabelFor(model => actionEdu.TiersSid, htmlAttributes: new { @class = "control-label col-md-2" })
-            @Html.HiddenFor(model => actionEdu.TiersSid, new { data_picker = "tiers.id" })
+            @Html.LabelFor(model => actionEdu.StatutId, htmlAttributes: new { @class = "control-label col-md-2" })
             <div class="col-md-10">
-                <span data-picker="tiers.id">@Html.DisplayFor(model => actionEdu.tiers.Id)</span> - <span data-picker="tiers.nom">@Html.DisplayFor(model => actionEdu.tiers.Nom)</span>
+                @Html.DropDownListFor(model => actionEdu.StatutId, Model.Sel_Statut, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => actionEdu.StatutId, "", new { @class = "text-danger" })
             </div>
-            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="tiers"></span> 
-            <a class="modal-window cboxElement" href="http://referentiel.bas-rhin.fr/picker/cd67/tier67/" title="Selection tiers (nouvelle fenetre)">Sélectionner un tiers</a>
         </div>
 
         <div class="form-group">