Create.cshtml 5.4 KB

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