Просмотр исходного кода

Maj tableau actions edu sur fiche collège

olivier.massot 7 лет назад
Родитель
Сommit
febbecb739

+ 1 - 1
CD67.FicheCollege.Entity/ActionEduCollege.cs

@@ -21,7 +21,7 @@ namespace CD67.FicheCollege.Entity
         }
     
         public int Id { get; set; }
-        public Nullable<long> NbEleves { get; set; }
+        public Nullable<int> NbEleves { get; set; }
         public string Commentaire { get; set; }
         public int CollegeId { get; set; }
         public int ActionEduId { get; set; }

+ 1 - 1
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -727,7 +727,7 @@
             <PropertyRef Name="Id" />
           </Key>
           <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="NbEleves" Type="Int64" Nullable="true" />
+          <Property Name="NbEleves" Type="Int32" 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" />

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

@@ -15,7 +15,7 @@ namespace CD67.FicheCollege.Entity
         {
             get
             {
-                return this.ActionsEduColleges.Sum(a => a.NbEleves);
+                return this.ActionsEduColleges.Where(a=>a.NbEleves != null).Sum(a => a.NbEleves);
             }
         }
 

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

@@ -222,22 +222,21 @@
 <table class="table datatable">
     <thead>
         <tr>
-            <th>Numéro</th>
-            <th>Nom</th>
-            <th>Nb.Elèves</th>
             <th>Axe</th>
-            <th>Thematique</th>
+            <th>Action</th>
+            <th>Nb.Elèves</th>
+            <th>Commentaire</th>
         </tr>
     </thead>
     <tbody>
+
         @foreach (ActionEduCollege item in college.ActionsEduColleges)
         {
             <tr>
-                <td>@Html.DisplayFor(model => item.ActionEdu.Numero)</td>
+                <td>@Html.DisplayFor(model => item.ActionEdu.ActionEduThematique.ActionEduAxe.Nom)</td>
                 <td>@Html.DisplayFor(model => item.ActionEdu.Nom)</td>
                 <td>@Html.DisplayFor(model => item.NbEleves)</td>
-                <td>@Html.DisplayFor(model => item.ActionEdu.ActionEduThematique.ActionEduAxe.Nom)</td>
-                <td>@Html.DisplayFor(model => item.ActionEdu.ActionEduThematique.Nom)</td>
+                <td>@Html.DisplayFor(model => item.Commentaire)</td>
             </tr>
         }
     </tbody>