Create.cshtml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. <div class="form-group">
  21. @Html.LabelFor(model => actionEdu.ActionEduThematiqueId, htmlAttributes: new { @class = "control-label col-md-2" })
  22. <div class="col-md-10">
  23. @Html.DropDownListFor(model => actionEdu.ActionEduThematiqueId, Model.Sel_Thematique, htmlAttributes: new { @class = "form-control" })
  24. @Html.ValidationMessageFor(model => actionEdu.ActionEduThematiqueId, "", new { @class = "text-danger" })
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. @Html.LabelFor(model => actionEdu.Numero, htmlAttributes: new { @class = "control-label col-md-2" })
  29. <div class="col-md-10">
  30. @Html.EditorFor(model => actionEdu.Numero, new { htmlAttributes = new { @class = "form-control" } })
  31. @Html.ValidationMessageFor(model => actionEdu.Numero, "", new { @class = "text-danger" })
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. @Html.LabelFor(model => actionEdu.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
  36. <div class="col-md-10">
  37. @Html.EditorFor(model => actionEdu.Nom, new { htmlAttributes = new { @class = "form-control" } })
  38. @Html.ValidationMessageFor(model => actionEdu.Nom, "", new { @class = "text-danger" })
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. @Html.LabelFor(model => actionEdu.Montant, htmlAttributes: new { @class = "control-label col-md-2" })
  43. <div class="col-md-10">
  44. @Html.EditorFor(model => actionEdu.Montant, new { htmlAttributes = new { @class = "form-control" } })
  45. @Html.ValidationMessageFor(model => actionEdu.Montant, "", new { @class = "text-danger" })
  46. </div>
  47. </div>
  48. <div class="form-group">
  49. @Html.LabelFor(model => actionEdu.TiersSid, htmlAttributes: new { @class = "control-label col-md-2" })
  50. @Html.HiddenFor(model => actionEdu.TiersSid, new { data_picker = "tiers.id" })
  51. <div class="col-md-10">
  52. <span data-picker="tiers.id">@Html.DisplayFor(model => actionEdu.tiers.Id)</span> - <span data-picker="tiers.nom">@Html.DisplayFor(model => actionEdu.tiers.Nom)</span>
  53. </div>
  54. <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="tiers"></span>
  55. <a class="modal-window cboxElement" href="http://referentiel.bas-rhin.fr/picker/cd67/tier67/" title="Selection tiers (nouvelle fenetre)">Sélectionner un tiers</a>
  56. </div>
  57. <div class="form-group">
  58. @Html.LabelFor(model => actionEdu.Description, htmlAttributes: new { @class = "control-label col-md-2" })
  59. <div class="col-md-10">
  60. @Html.EditorFor(model => actionEdu.Description, new { htmlAttributes = new { @class = "form-control" } })
  61. @Html.ValidationMessageFor(model => actionEdu.Description, "", new { @class = "text-danger" })
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <div class="col-md-offset-2 col-md-10">
  66. <input type="submit" value="Enregistrer" class="btn btn-default" />
  67. </div>
  68. </div>
  69. </div>
  70. }
  71. <div>
  72. @Html.ActionLink("Annuler", "Index", new { annee_id = actionEdu.AnneeId })
  73. </div>
  74. @section Scripts {
  75. <script type="text/javascript">
  76. $(".removeItem").click(function () {
  77. switch ($(this).data("type")) {
  78. case 'tiers':
  79. $('#actionEdu_TiersSid').val(null);
  80. $("span[data-picker='tiers.id']").html('');
  81. $("span[data-picker='tiers.nom']").html('');
  82. default:
  83. return false;
  84. }
  85. });
  86. </script>
  87. @Scripts.Render("~/bundles/jqueryval")
  88. }