Edit.cshtml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ActionEduViewModel
  3. @{
  4. ViewBag.Title = "Modification";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. ActionEdu actionEdu = Model.Obj;
  7. }
  8. <header>
  9. <h2>Edition de l'Action Educative '@actionEdu.Nom'</h2>
  10. </header>
  11. @using (Html.BeginForm())
  12. {
  13. @Html.AntiForgeryToken()
  14. <div class="form-horizontal">
  15. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  16. @Html.HiddenFor(model => actionEdu.Id)
  17. @Html.HiddenFor(model => actionEdu.Ordre)
  18. @Html.HiddenFor(model => actionEdu.AnneeId)
  19. <div class="form-group">
  20. @Html.LabelFor(model => actionEdu.ActionEduThematiqueId, htmlAttributes: new { @class = "control-label col-md-2" })
  21. <div class="col-md-10">
  22. @Html.DropDownListFor(model => actionEdu.ActionEduThematiqueId, Model.Sel_Thematique, htmlAttributes: new { @class = "form-control" })
  23. @Html.ValidationMessageFor(model => actionEdu.ActionEduThematiqueId, "", new { @class = "text-danger" })
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. @Html.LabelFor(model => actionEdu.Numero, htmlAttributes: new { @class = "control-label col-md-2" })
  28. <div class="col-md-10">
  29. @Html.EditorFor(model => actionEdu.Numero, new { htmlAttributes = new { @class = "form-control" } })
  30. @Html.ValidationMessageFor(model => actionEdu.Numero, "", new { @class = "text-danger" })
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. @Html.LabelFor(model => actionEdu.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
  35. <div class="col-md-10">
  36. @Html.EditorFor(model => actionEdu.Nom, new { htmlAttributes = new { @class = "form-control" } })
  37. @Html.ValidationMessageFor(model => actionEdu.Nom, "", new { @class = "text-danger" })
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. @Html.LabelFor(model => actionEdu.Montant, htmlAttributes: new { @class = "control-label col-md-2" })
  42. <div class="col-md-10">
  43. @Html.EditorFor(model => actionEdu.Montant, new { htmlAttributes = new { @class = "form-control" } })
  44. @Html.ValidationMessageFor(model => actionEdu.Montant, "", new { @class = "text-danger" })
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. @Html.LabelFor(model => actionEdu.TiersSid, htmlAttributes: new { @class = "control-label col-md-2" })
  49. @Html.HiddenFor(model => actionEdu.TiersSid, new { data_picker = "tiers.id" })
  50. <div class="col-md-10">
  51. <span data-picker="tiers.id">@Html.DisplayFor(model => actionEdu.tiers.Id)</span> - <span data-picker="tiers.nom">@Html.DisplayFor(model => actionEdu.tiers.Nom)</span>
  52. </div>
  53. <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="tiers"></span>
  54. <a class="modal-window cboxElement" href="http://referentiel.bas-rhin.fr/picker/cd67/tier67/" title="Selection tiers (nouvelle fenetre)">Sélectionner un tiers</a>
  55. </div>
  56. <div class="form-group">
  57. @Html.LabelFor(model => actionEdu.Description, htmlAttributes: new { @class = "control-label col-md-2" })
  58. <div class="col-md-10">
  59. @Html.EditorFor(model => actionEdu.Description, new { htmlAttributes = new { @class = "form-control" } })
  60. @Html.ValidationMessageFor(model => actionEdu.Description, "", new { @class = "text-danger" })
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. @Html.LabelFor(model => actionEdu.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })
  65. <div class="col-md-10">
  66. @Html.EditorFor(model => actionEdu.Neutralise, new { htmlAttributes = new { @class = "form-control" } })
  67. @Html.ValidationMessageFor(model => actionEdu.Neutralise, "", new { @class = "text-danger" })
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <div class="col-md-offset-2 col-md-10">
  72. <input type="submit" value="Enregistrer" class="btn btn-default" />
  73. </div>
  74. </div>
  75. </div>
  76. }
  77. <div>
  78. @Html.ActionLink("Annuler", "Details", new { id = actionEdu.Id })
  79. </div>
  80. @section Scripts {
  81. <script type="text/javascript">
  82. $(".removeItem").click(function () {
  83. switch ($(this).data("type")) {
  84. case 'tiers':
  85. $('#actionEdu_TiersSid').val(null);
  86. $("span[data-picker='tiers.id']").html('');
  87. $("span[data-picker='tiers.nom']").html('');
  88. default:
  89. return false;
  90. }
  91. });
  92. </script>
  93. @Scripts.Render("~/bundles/jqueryval")
  94. }