Edit.cshtml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ActionEduViewModel
  3. @{
  4. ViewBag.Title = "Les Actions Educatives " + Model.Annee_Lib;
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. ActionEdu actionEdu = Model.Obj;
  7. }
  8. <header>
  9. @if (Model.Acces == ModeAcces.Modification)
  10. {
  11. <h2>@actionEdu.Nom</h2>
  12. }
  13. else
  14. {
  15. <h2>Nouvelle Action Educative</h2>
  16. }
  17. </header>
  18. @using (Html.BeginForm())
  19. {
  20. @Html.AntiForgeryToken()
  21. <div class="form-horizontal">
  22. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  23. @Html.HiddenFor(model => actionEdu.Id)
  24. @Html.HiddenFor(model => actionEdu.Ordre)
  25. @Html.HiddenFor(model => actionEdu.AnneeId)
  26. @Html.HiddenFor(model => actionEdu.TokenId)
  27. @if (Model.Acces == ModeAcces.Creation) { @Html.HiddenFor(model => actionEdu.Neutralise) }
  28. <div class="form-group">
  29. @Html.LabelFor(model => actionEdu.ActionEduThematiqueId, htmlAttributes: new { @class = "control-label col-md-2" })
  30. <div class="col-md-10">
  31. @Html.DropDownListFor(model => actionEdu.ActionEduThematiqueId, Model.Sel_Thematique, htmlAttributes: new { @class = "form-control" })
  32. @Html.ValidationMessageFor(model => actionEdu.ActionEduThematiqueId, "", new { @class = "text-danger" })
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. @Html.LabelFor(model => actionEdu.Numero, htmlAttributes: new { @class = "control-label col-md-2" })
  37. <div class="col-md-10">
  38. @Html.EditorFor(model => actionEdu.Numero, new { htmlAttributes = new { @class = "form-control" } })
  39. @Html.ValidationMessageFor(model => actionEdu.Numero, "", new { @class = "text-danger" })
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. @Html.LabelFor(model => actionEdu.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
  44. <div class="col-md-10">
  45. @Html.EditorFor(model => actionEdu.Nom, new { htmlAttributes = new { @class = "form-control" } })
  46. @Html.ValidationMessageFor(model => actionEdu.Nom, "", new { @class = "text-danger" })
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. @Html.LabelFor(model => actionEdu.Montant, htmlAttributes: new { @class = "control-label col-md-2" })
  51. <div class="col-md-10">
  52. @Html.EditorFor(model => actionEdu.Montant, new { htmlAttributes = new { @class = "form-control" } })
  53. @Html.ValidationMessageFor(model => actionEdu.Montant, "", new { @class = "text-danger" })
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. @Html.LabelFor(model => actionEdu.StatutId, htmlAttributes: new { @class = "control-label col-md-2" })
  58. <div class="col-md-10">
  59. @Html.DropDownListFor(model => actionEdu.StatutId, Model.Sel_Statut, htmlAttributes: new { @class = "form-control" })
  60. @Html.ValidationMessageFor(model => actionEdu.StatutId, "", new { @class = "text-danger" })
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. @Html.LabelFor(model => actionEdu.Description, htmlAttributes: new { @class = "control-label col-md-2" })
  65. <div class="col-md-10">
  66. @Html.EditorFor(model => actionEdu.Description, new { htmlAttributes = new { @class = "form-control" } })
  67. @Html.ValidationMessageFor(model => actionEdu.Description, "", new { @class = "text-danger" })
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. @Html.LabelFor(model => actionEdu.CommentairePublic, htmlAttributes: new { @class = "control-label col-md-2" })
  72. <div class="col-md-10">
  73. @Html.EditorFor(model => actionEdu.CommentairePublic, new { htmlAttributes = new { @class = "form-control" } })
  74. @Html.ValidationMessageFor(model => actionEdu.CommentairePublic, "", new { @class = "text-danger" })
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. @Html.LabelFor(model => actionEdu.CommentaireInterne, htmlAttributes: new { @class = "control-label col-md-2" })
  79. <div class="col-md-10">
  80. @Html.EditorFor(model => actionEdu.CommentaireInterne, new { htmlAttributes = new { @class = "form-control" } })
  81. @Html.ValidationMessageFor(model => actionEdu.CommentaireInterne, "", new { @class = "text-danger" })
  82. </div>
  83. </div>
  84. @if (Model.Acces == ModeAcces.Modification)
  85. {
  86. <div class="form-group">
  87. @Html.LabelFor(model => actionEdu.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })
  88. <div class="col-md-10">
  89. @Html.EditorFor(model => actionEdu.Neutralise, new { htmlAttributes = new { @class = "form-control" } })
  90. @Html.ValidationMessageFor(model => actionEdu.Neutralise, "", new { @class = "text-danger" })
  91. </div>
  92. </div>
  93. }
  94. <div class="form-group btn-bar">
  95. @if (Model.Acces == ModeAcces.Modification)
  96. {
  97. <a href=@Url.Action("Details", new { id = actionEdu.Id }) class="btn btn-default">Annuler</a>
  98. }
  99. else
  100. {
  101. <a href=@Url.Action("Index", new { annee_id = actionEdu.AnneeId }) class="btn btn-default">Annuler</a>
  102. }
  103. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  104. </div>
  105. </div>
  106. }
  107. @section Scripts {
  108. <script type="text/javascript">
  109. $(".removeItem").click(function () {
  110. switch ($(this).data("type")) {
  111. case 'tiers':
  112. $('#actionEdu_TiersSid').val(null);
  113. $("span[data-picker='tiers.id']").html('');
  114. $("span[data-picker='tiers.nom']").html('');
  115. default:
  116. return false;
  117. }
  118. });
  119. </script>
  120. @Scripts.Render("~/bundles/jqueryval")
  121. }