Index.cshtml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. @using CD67.FicheCollege.MVC.Models
  2. @model AnneeViewModel
  3. @using CD67.FicheCollege.Entity;
  4. @{
  5. ViewBag.Title = "Restauration " + Model.Annee_Lib;
  6. Layout = "~/Views/Shared/_Layout.cshtml";
  7. College college_model = new College();
  8. bool ouverture = ViewBag.Ouverture;
  9. }
  10. <header>
  11. <h2>La Restauration</h2>
  12. <span class="mask-ss">
  13. <a class="start-trace" href="@Url.Action("Edit", "RestaurationParametres", new { annee_id = Model.Annee_Id })"> <span class="glyphicon glyphicon-cog color1"></span> Paramètres</a>
  14. <a class="start-trace" href="@Url.Action("Index", "RestaurationTypesRepas")"> <span class="glyphicon glyphicon-cog color1"></span> Repas</a>
  15. <a class="start-trace" href="@Url.Action("Index", "RestaurationTypes")"> <span class="glyphicon glyphicon-cog color1"></span> Types</a>
  16. </span>
  17. </header>
  18. <div class="mask-ss">
  19. @if (ouverture == true)
  20. {
  21. <h4>Ouverture de la campagne de saisie <a href="@Url.Action("EditCampagne", "RestaurationParametres", new { annee_id = Model.Annee_Id, edit = false })"> <span class="fa fa-toggle-on color1"></span> </a></h4><br />
  22. }
  23. else
  24. {
  25. <h4>Ouverture de la campagne de saisie <a href="@Url.Action("EditCampagne", "RestaurationParametres", new { annee_id = Model.Annee_Id, edit = true })"> <span class="fa fa-toggle-off color1"></span> </a></h4><br />
  26. }
  27. </div>
  28. <table id="table-actions" class="datatable table" data-order="[[ 1, &quot;asc&quot; ]]">
  29. <thead>
  30. <tr>
  31. <th>
  32. @Html.DisplayNameFor(model => college_model.CodeRne)
  33. </th>
  34. <th data-priority="1">
  35. @Html.DisplayNameFor(model => college_model.Libelle)
  36. </th>
  37. <th>
  38. Adresse complète
  39. </th>
  40. <th data-priority="2">
  41. @Html.DisplayNameFor(model => college_model.RestaurationType_Id)
  42. </th>
  43. <th data-priority="3">
  44. Statut du formulaire
  45. </th>
  46. <th>
  47. Actions
  48. </th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. @foreach (College college in Model.Obj.Colleges.OrderBy(c=>c.Libelle))
  53. {
  54. <tr>
  55. <td>
  56. @Html.DisplayFor(modelcollege => college.CodeRne)
  57. </td>
  58. <td>
  59. <a href="@Url.Action("Details", "Colleges", new { id = college.Id })">@Html.DisplayFor(modelcollege => college.Libelle)</a>
  60. </td>
  61. <td>
  62. @Html.DisplayFor(modelcollege => college.AdresseComplete)
  63. </td>
  64. <td>
  65. <div style="text-align:left">
  66. @Html.DisplayFor(modelcollege => college.RestaurationType.Libelle)
  67. </div>
  68. <div class="mask-ss" style="text-align:right">
  69. <a href="@Url.Action("Type", "Colleges", new { id = college.Id })">
  70. <span class="glyphicon glyphicon-pencil fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
  71. </a>
  72. </div>
  73. </td>
  74. @if (college.RestaurationFormulaires.Count() > 0)
  75. {
  76. foreach (RestaurationFormulaire form in college.RestaurationFormulaires)
  77. {
  78. <td>
  79. @Html.DisplayFor(modelcollege => form.Statut)
  80. </td>
  81. }
  82. }
  83. else
  84. {
  85. <td>A saisir</td>
  86. }
  87. <td>
  88. <a href="@Url.Action("Details", "RestaurationFormulaires", new { id = college.Id })">
  89. <span class="fa fa-file-text fa-2x color1" title="Détails" style="vertical-align: middle" aria-hidden="true"></span>
  90. </a>
  91. </td>
  92. </tr>
  93. }
  94. </tbody>
  95. </table>