Details.cshtml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. @using CD67.FicheCollege.MVC.Models
  2. @model CollegeViewModel
  3. @{
  4. ViewBag.Title = "Details";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. College college = Model.Contenu as College;
  7. }
  8. <h1>@college.Libelle</h1>
  9. @if(Model.Acces==ModeAcces.Suppression) {
  10. <h2 class="text-danger">Voulez-vous vraiment supprimer cet élément?</h2>
  11. <p class="text-danger">
  12. Le collège ainsi que toutes les informations liées seront supprimées.
  13. </p>
  14. }
  15. <fieldset>
  16. <legend>
  17. Détails du collège
  18. @if (Model.Acces == ModeAcces.Lecture)
  19. {
  20. <div class="pull-right">
  21. @Html.ActionLink("Supprimer", "Delete", "Colleges", new { Id = college.Id }, new { @class = "btn btn-danger" })
  22. @Html.ActionLink("Modifier", "Edit", "Colleges", new { Id = college.Id }, new { @class = "btn btn-default" })
  23. </div>
  24. }
  25. </legend>
  26. <dl class="dl-horizontal">
  27. <dt>
  28. @Html.DisplayNameFor(model => college.TypeCollege.Libelle)
  29. </dt>
  30. <dd>
  31. @Html.DisplayFor(model => college.TypeCollege.Libelle)
  32. </dd>
  33. <dt>
  34. @Html.DisplayNameFor(model => college.Adresse)
  35. </dt>
  36. <dd>
  37. @Html.DisplayFor(model => college.AdresseComplete)
  38. </dd>
  39. <dt>
  40. @Html.DisplayNameFor(model => college.Tel)
  41. </dt>
  42. <dd>
  43. @Html.DisplayFor(model => college.Tel)
  44. </dd>
  45. <dt>
  46. @Html.DisplayNameFor(model => college.Fax)
  47. </dt>
  48. <dd>
  49. @Html.DisplayFor(model => college.Fax)
  50. </dd>
  51. <dt>
  52. @Html.DisplayNameFor(model => college.Email)
  53. </dt>
  54. <dd>
  55. @Html.DisplayFor(model => college.Email)
  56. </dd>
  57. <dt>
  58. @Html.DisplayNameFor(model => college.Commune)
  59. </dt>
  60. <dd>
  61. @if (college.Commune != null)
  62. {
  63. <div class="col-sm-8 col-md-4">
  64. <div class="panel panel-default">
  65. <div class="panel-heading clearfix">
  66. <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
  67. <i class="fa fa-map-marker color1" aria-hidden="true"></i>
  68. Localisation (commune)
  69. </h4>
  70. </div>
  71. <div class="panel-body" style="text-align: center;">
  72. <span style="white-space: pre-line;">
  73. <b>@college.Commune</b>
  74. Canton : @college.Canton
  75. TAD : @college.TAD
  76. CDC : @college.CDC
  77. </span>
  78. </div>
  79. </div>
  80. </div>
  81. }
  82. </dd>
  83. </dl>
  84. </fieldset>
  85. @if (Model.Acces == ModeAcces.Suppression)
  86. {
  87. using (Html.BeginForm())
  88. {
  89. @Html.AntiForgeryToken()
  90. <div class="form-actions no-color">
  91. <input type="submit" value="@Model.Acces.EnumDisplayNameFor(MvcHtmlHelpers.DisplayValue.Prompt)" class="btn btn-danger" /> |
  92. @Html.ActionLink("Annuler", "Details", new { Id = Model.College_Id })
  93. </div>
  94. }
  95. }