浏览代码

FIX Corrections #39

olivier.massot 7 年之前
父节点
当前提交
7272a4fb66

+ 3 - 2
CD67.FicheCollege.Entity/ActionEdu.cs

@@ -17,16 +17,17 @@ namespace CD67.FicheCollege.Entity
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public ActionEdu()
         {
-            this.Montant = 0m;
             this.ActionsEduColleges = new HashSet<ActionEduCollege>();
         }
     
         public int Id { get; set; }
         public string Numero { get; set; }
         public string Nom { get; set; }
-        public decimal Montant { get; set; }
+        public Nullable<decimal> Montant { get; set; }
         public string TiersSid { get; set; }
         public string Description { get; set; }
+        public string CommentairePublic { get; set; }
+        public string CommentaireInterne { get; set; }
         public bool Neutralise { get; set; }
         public int Ordre { get; set; }
         public int ActionEduThematiqueId { get; set; }

+ 2 - 8
CD67.FicheCollege.Entity/ActionEduCollege.cs

@@ -17,18 +17,12 @@ namespace CD67.FicheCollege.Entity
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public ActionEduCollege()
         {
-            this.NbEleves = 0;
             this.ActionEduMissions = new HashSet<ActionEduMission>();
         }
     
         public int Id { get; set; }
-        public string CommentaireInterne { get; set; }
-        public string CommentairePublic { get; set; }
-        public long NbEleves { get; set; }
-        public string TiersAstre_Code { get; set; }
-        public string TiersAstre_Nom { get; set; }
-        public string TiersAstre_CodeFamille { get; set; }
-        public string TiersAstre_Description { get; set; }
+        public Nullable<long> NbEleves { get; set; }
+        public string Commentaire { get; set; }
         public int CollegeId { get; set; }
         public int ActionEduId { get; set; }
     

+ 15 - 24
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -41,9 +41,11 @@
           <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="Numero" Type="nvarchar(max)" Nullable="false" />
           <Property Name="Nom" Type="nvarchar(max)" Nullable="false" />
-          <Property Name="Montant" Type="decimal" Precision="18" Scale="0" Nullable="false" />
+          <Property Name="Montant" Type="decimal" Precision="18" Scale="0" />
           <Property Name="TiersSid" Type="nvarchar" MaxLength="7" />
           <Property Name="Description" Type="nvarchar(max)" />
+          <Property Name="CommentaireInterne" Type="nvarchar(max)" />
+          <Property Name="CommentairePublic" Type="nvarchar(max)" />
           <Property Name="Neutralise" Type="bit" Nullable="false" />
           <Property Name="Ordre" Type="int" Nullable="false" />
           <Property Name="ActionEduThematiqueId" Type="int" Nullable="false" />
@@ -54,13 +56,8 @@
             <PropertyRef Name="Id" />
           </Key>
           <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
-          <Property Name="CommentaireInterne" Type="nvarchar(max)" />
-          <Property Name="CommentairePublic" Type="nvarchar(max)" />
-          <Property Name="NbEleves" Type="bigint" Nullable="false" />
-          <Property Name="TiersAstre_Code" Type="nvarchar(max)" />
-          <Property Name="TiersAstre_Nom" Type="nvarchar(max)" />
-          <Property Name="TiersAstre_CodeFamille" Type="nvarchar(max)" />
-          <Property Name="TiersAstre_Description" Type="nvarchar(max)" />
+          <Property Name="Commentaire" Type="nvarchar(max)" />
+          <Property Name="NbEleves" Type="bigint" />
           <Property Name="CollegeId" Type="int" Nullable="false" />
           <Property Name="ActionEduId" Type="int" Nullable="false" />
         </EntityType>
@@ -451,9 +448,11 @@
           <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="Numero" Type="String" Nullable="false" MaxLength="Max" Unicode="true" FixedLength="false" />
           <Property Name="Nom" Type="String" Nullable="false" MaxLength="Max" Unicode="true" FixedLength="false" />
-          <Property Name="Montant" Type="Decimal" Nullable="false" DefaultValue="0" Precision="18" Scale="0" />
-          <Property Name="TiersSid" Type="String" />
+          <Property Name="Montant" Type="Decimal" Precision="18" Scale="0" Nullable="true" />
+          <Property Name="TiersSid" Type="String" MaxLength="7" Unicode="true" FixedLength="false" />
           <Property Name="Description" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
+          <Property Name="CommentairePublic" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
+          <Property Name="CommentaireInterne" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
           <Property Name="Neutralise" Type="Boolean" Nullable="false" />
           <Property Name="Ordre" Type="Int32" Nullable="false" />
           <NavigationProperty Name="ActionEduThematique" Relationship="CD67.FicheCollege.ActionEduThematiqueActionEdu" FromRole="ActionEdu" ToRole="ActionEduThematique" />
@@ -503,15 +502,10 @@
             <PropertyRef Name="Id" />
           </Key>
           <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="CommentaireInterne" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
-          <Property Name="CommentairePublic" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
-          <Property Name="NbEleves" Type="Int64" Nullable="false" DefaultValue="0" />
-          <Property Name="TiersAstre_Code" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
-          <Property Name="TiersAstre_Nom" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
-          <Property Name="TiersAstre_CodeFamille" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
-          <Property Name="TiersAstre_Description" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
+          <Property Name="NbEleves" Type="Int64" Nullable="true" />
           <NavigationProperty Name="ActionEduMissions" Relationship="CD67.FicheCollege.ActionEduCollegeActionEduMission" FromRole="ActionEduCollege" ToRole="ActionEduMission" />
           <NavigationProperty Name="College" Relationship="CD67.FicheCollege.ActionEduCollegeCollege" FromRole="ActionEduCollege" ToRole="College" />
+          <Property Name="Commentaire" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
           <Property Name="CollegeId" Type="Int32" Nullable="false" />
           <NavigationProperty Name="ActionEdu" Relationship="CD67.FicheCollege.ActionEduCollegeActionEdu" FromRole="ActionEduCollege" ToRole="ActionEdu" />
           <Property Name="ActionEduId" Type="Int32" Nullable="false" />
@@ -651,6 +645,8 @@
     <EntitySetMapping Name="ActionsEdu">
       <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.ActionEdu)">
         <MappingFragment StoreEntitySet="ActionsEdu">
+                <ScalarProperty Name="CommentairePublic" ColumnName="CommentairePublic" />
+                <ScalarProperty Name="CommentaireInterne" ColumnName="CommentaireInterne" />
                 <ScalarProperty Name="TiersSid" ColumnName="TiersSid" />
                 <ScalarProperty Name="Montant" ColumnName="Montant" />
                 <ScalarProperty Name="Id" ColumnName="Id" />
@@ -667,14 +663,9 @@
     <EntitySetMapping Name="ActionsEduColleges">
       <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.ActionEduCollege)">
         <MappingFragment StoreEntitySet="ActionsEduColleges">
-          <ScalarProperty Name="Id" ColumnName="Id" />
-          <ScalarProperty Name="CommentaireInterne" ColumnName="CommentaireInterne" />
-          <ScalarProperty Name="CommentairePublic" ColumnName="CommentairePublic" />
+          <ScalarProperty Name="Commentaire" ColumnName="Commentaire" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
           <ScalarProperty Name="NbEleves" ColumnName="NbEleves" />
-          <ScalarProperty Name="TiersAstre_Code" ColumnName="TiersAstre_Code" />
-          <ScalarProperty Name="TiersAstre_Nom" ColumnName="TiersAstre_Nom" />
-          <ScalarProperty Name="TiersAstre_CodeFamille" ColumnName="TiersAstre_CodeFamille" />
-          <ScalarProperty Name="TiersAstre_Description" ColumnName="TiersAstre_Description" />
           <ScalarProperty Name="CollegeId" ColumnName="CollegeId" />
           <ScalarProperty Name="ActionEduId" ColumnName="ActionEduId" />
         </MappingFragment>

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

@@ -11,11 +11,11 @@ namespace CD67.FicheCollege.Entity
     [MetadataType(typeof(ActionEdu_Metadata))]
     public partial class ActionEdu
     {
-        public long totalEleves
+        public long? totalEleves
         {
             get
             {
-                return this.ActionsEduColleges.Sum(mbox => mbox.NbEleves);
+                return this.ActionsEduColleges.Sum(a => a.NbEleves);
             }
         }
 
@@ -57,9 +57,8 @@ namespace CD67.FicheCollege.Entity
         [Display(Name = "Nom")]
         public string Nom { get; set; }
 
-        [Required]
         [DataType(DataType.Currency)]
-        [Display(Name = "Montant")]
+        [Display(Name = "Montant indicatif")]
         public decimal Montant { get; set; }
 
         [Display(Name = "Tiers")]
@@ -69,6 +68,14 @@ namespace CD67.FicheCollege.Entity
         [DataType(DataType.MultilineText)]
         public string Description { get; set; }
 
+        [Display(Name = "Commentaire Public")]
+        [DataType(DataType.MultilineText)]
+        public string CommentairePublic { get; set; }
+
+        [Display(Name = "Commentaire Interne")]
+        [DataType(DataType.MultilineText)]
+        public string CommentaireInterne { get; set; }
+
         [Display(Name = "Neutralisé (oui/non)")]
         public bool Neutralise { get; set; }
 

+ 2 - 6
CD67.FicheCollege.Entity/Extend/ActionEduCollege.cs

@@ -30,12 +30,8 @@ namespace CD67.FicheCollege.Entity
         public int NbEleves { get; set; }
 
         [DataType(DataType.MultilineText)]
-        [Display(Name = "Commentaire (interne)")]
-        public int CommentaireInterne { get; set; }
-
-        [DataType(DataType.MultilineText)]
-        [Display(Name = "Commentaire (public)")]
-        public int CommentairePublic { get; set; }
+        [Display(Name = "Commentaire")]
+        public int Commentaire { get; set; }
 
     }
 }

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

@@ -71,6 +71,22 @@
                 @Html.ValidationMessageFor(model => actionEdu.Description, "", new { @class = "text-danger" })
             </div>
         </div>
+        
+        <div class="form-group">
+            @Html.LabelFor(model => actionEdu.CommentairePublic, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => actionEdu.CommentairePublic, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => actionEdu.CommentairePublic, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => actionEdu.CommentaireInterne, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => actionEdu.CommentaireInterne, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => actionEdu.CommentaireInterne, "", new { @class = "text-danger" })
+            </div>
+        </div>
 
         <div class="form-group">
             <div class="col-md-offset-2 col-md-10">

+ 11 - 7
CD67.FicheCollege.MVC/Views/ActionsEdu/Details.cshtml

@@ -46,6 +46,12 @@
 
         <dt>@Html.DisplayNameFor(model => actionEdu.Description)</dt>
         <dd>@Html.DisplayFor(model => actionEdu.Description)</dd>
+        
+        <dt>@Html.DisplayNameFor(model => actionEdu.CommentairePublic)</dt>
+        <dd>@Html.DisplayFor(model => actionEdu.CommentairePublic)</dd>
+        
+        <dt>@Html.DisplayNameFor(model => actionEdu.CommentaireInterne)</dt>
+        <dd>@Html.DisplayFor(model => actionEdu.CommentaireInterne)</dd>
 
         <dt>@Html.DisplayNameFor(model => actionEdu.Neutralise)</dt>
         <dd>@Html.DisplayFor(model => actionEdu.Neutralise)</dd>
@@ -57,7 +63,9 @@
     <legend>
         Collège(s) concerné(s)
         <span class="pull-right">
-            @Html.ActionLink("Ajouter", "Create", "ActionsEduCollege", new { actionEdu_id = actionEdu.Id }, new { @class = "btn btn-default" })
+            <a class="btn btn-default" href="@Url.Action("Create", "ActionsEduCollege", new { actionEdu_id = actionEdu.Id })">
+                <i class="fa fa-plus"></i> Ajouter
+            </a>
         </span>
     </legend>
 
@@ -66,9 +74,7 @@
             <tr>
                 <th>Collège</th>
                 <th>Nombre d'élèves</th>
-                <th>Tiers</th>
-                <th>Commentaire interne</th>
-                <th>Commentaire public</th>
+                <th>Commentaire</th>
             </tr>
         </thead>
         <tbody>
@@ -77,9 +83,7 @@
             <tr data-url="@Url.Action("Details", "ActionsEduCollege", new { Id = item.Id })">
                 <td>@Html.DisplayFor(model => item.College.Libelle)</td>
                 <td>@Html.DisplayFor(model => item.NbEleves)</td>
-                <td>@Html.DisplayFor(model => item.TiersAstre_Nom)</td>
-                <td>@Html.DisplayFor(model => item.CommentaireInterne)</td>
-                <td>@Html.DisplayFor(model => item.CommentairePublic)</td>
+                <td>@Html.DisplayFor(model => item.Commentaire)</td>
             </tr>
             }
         </tbody>

+ 16 - 0
CD67.FicheCollege.MVC/Views/ActionsEdu/Edit.cshtml

@@ -70,6 +70,22 @@
                 @Html.ValidationMessageFor(model => actionEdu.Description, "", new { @class = "text-danger" })
             </div>
         </div>
+                
+        <div class="form-group">
+            @Html.LabelFor(model => actionEdu.CommentairePublic, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => actionEdu.CommentairePublic, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => actionEdu.CommentairePublic, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => actionEdu.CommentaireInterne, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => actionEdu.CommentaireInterne, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => actionEdu.CommentaireInterne, "", new { @class = "text-danger" })
+            </div>
+        </div>
 
         <div class="form-group">
             @Html.LabelFor(model => actionEdu.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })

+ 0 - 6
CD67.FicheCollege.MVC/Views/ActionsEdu/Index.cshtml

@@ -33,9 +33,6 @@
             <th>
                 Thematique
             </th>
-            <th>
-                @Html.DisplayNameFor(model => action_model.Montant)
-            </th>
             <th>
                 Nb.Collèges
             </th>
@@ -66,9 +63,6 @@
                 <td>
                     @Html.DisplayFor(model => item.ActionEduThematique.Nom)
                 </td>
-                <td data-order="@item.Montant">
-                    @Html.DisplayFor(model => item.Montant)
-                </td>
                 <td>
                     @item.ActionsEduColleges.Count().ToString()
                 </td>

+ 3 - 11
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Create.cshtml

@@ -37,18 +37,10 @@
         </div>
 
         <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.CommentaireInterne, htmlAttributes: new { @class = "control-label col-md-2" })
+            @Html.LabelFor(model => actionEduCollege.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
             <div class="col-md-10">
-                @Html.EditorFor(model => actionEduCollege.CommentaireInterne, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduCollege.CommentaireInterne, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.CommentairePublic, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEduCollege.CommentairePublic, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduCollege.CommentairePublic, "", new { @class = "text-danger" })
+                @Html.EditorFor(model => actionEduCollege.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => actionEduCollege.Commentaire, "", new { @class = "text-danger" })
             </div>
         </div>
 

+ 3 - 12
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Delete.cshtml

@@ -11,24 +11,15 @@
     <h2>Suppression</h2>
 </header>
 
-<h3>Voulez-vous vraiment supprimer cette affectation de l'action '@actionEduCollege.ActionEdu.Nom'?</h3>
+<h3>Retirer le college</h3>
 <div>
-    <dl class="dl-horizontal">
-        <dt>
-            @Html.DisplayNameFor(model => actionEduCollege.College.Libelle)
-        </dt>
-        <dd>
-            @Html.DisplayFor(model => actionEduCollege.College.Libelle)
-        </dd>
-
-    </dl>
-
     @using (Html.BeginForm()) {
         @Html.AntiForgeryToken()
 
+        <p>Voulez-vous vraiment retirer le college <b>@actionEduCollege.College.Libelle</b> des colleges concernés par l'action <b>@actionEduCollege.ActionEdu.Nom</b>?</p>
+
         <div class="form-actions no-color">
             <input type="submit" value="Supprimer" class="btn btn-default" />
-            
         </div>
     }
 </div>

+ 2 - 5
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Details.cshtml

@@ -27,11 +27,8 @@
         <dt>@Html.DisplayNameFor(model => actionEduCollege.NbEleves)</dt>
         <dd>@Html.DisplayFor(model => actionEduCollege.NbEleves)</dd>
 
-        <dt>@Html.DisplayNameFor(model => actionEduCollege.CommentaireInterne)</dt>
-        <dd>@Html.DisplayFor(model => actionEduCollege.CommentaireInterne)</dd>
-
-        <dt>@Html.DisplayNameFor(model => actionEduCollege.CommentairePublic)</dt>
-        <dd>@Html.DisplayFor(model => actionEduCollege.CommentairePublic)</dd>
+        <dt>@Html.DisplayNameFor(model => actionEduCollege.Commentaire)</dt>
+        <dd>@Html.DisplayFor(model => actionEduCollege.Commentaire)</dd>
     </dl>
 </fieldset>
 

+ 3 - 12
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Edit.cshtml

@@ -39,22 +39,13 @@
         </div>
 
         <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.CommentaireInterne, htmlAttributes: new { @class = "control-label col-md-2" })
+            @Html.LabelFor(model => actionEduCollege.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
             <div class="col-md-10">
-                @Html.EditorFor(model => actionEduCollege.CommentaireInterne, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduCollege.CommentaireInterne, "", new { @class = "text-danger" })
+                @Html.EditorFor(model => actionEduCollege.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => actionEduCollege.Commentaire, "", new { @class = "text-danger" })
             </div>
         </div>
 
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.CommentairePublic, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEduCollege.CommentairePublic, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduCollege.CommentairePublic, "", 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" />