Edit.cshtml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. @model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
  2. @{
  3. ViewBag.Title = "Edit";
  4. Layout = "~/Views/Shared/_Layout.cshtml";
  5. }
  6. <title>Vikings</title>
  7. <h2>Edition</h2>
  8. @using (Html.BeginForm())
  9. {
  10. @Html.AntiForgeryToken()
  11. <div class="form-horizontal">
  12. <h4>Viking</h4>
  13. <hr />
  14. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  15. @Html.HiddenFor(model => model.ID)
  16. <div class="form-group">
  17. @Html.LabelFor(model => model.NOM, htmlAttributes: new { @class = "control-label col-md-2" })
  18. <div class="col-md-10">
  19. @Html.EditorFor(model => model.NOM, new { htmlAttributes = new { @class = "form-control autofocus" } })
  20. @Html.ValidationMessageFor(model => model.NOM, "", new { @class = "text-danger" })
  21. </div>
  22. </div>
  23. @*Liste de choix pour le type, rempli gràce au ViewBag dans le contrôleur*@
  24. @*Liste principale pour la liste imbriquée sous-type*@
  25. <div class="form-group">
  26. @Html.LabelFor(model => model.ID_TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
  27. <div class="col-md-10">
  28. @Html.DropDownList("ID_TYPE", null, htmlAttributes: new { @class = "form-control liste-principale", @data = "/VIKINGS/listeSousType" })
  29. @Html.ValidationMessageFor(model => model.ID_TYPE, "", new { @class = "text-danger" })
  30. </div>
  31. </div>
  32. @*Liste de choix d'un sous-type fictif*@
  33. <div class="form-group">
  34. @Html.LabelFor(model => model.ID_SOUS_TYPE, "Sous type", htmlAttributes: new { @class = "control-label col-md-2" })
  35. <div class="col-md-10">
  36. @Html.DropDownList("ID_SOUS_TYPE", null, htmlAttributes: new { @class = "form-control liste-secondaire" })
  37. @Html.ValidationMessageFor(model => model.ID_SOUS_TYPE, "", new { @class = "text-danger" })
  38. @Html.DescriptionFor(model => model.ID_SOUS_TYPE)
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. @Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "control-label col-md-2" })
  43. <div class="col-md-10">
  44. @Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "form-control" } })
  45. @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })
  46. </div>
  47. </div>
  48. <div class="form-group">
  49. @Html.LabelFor(model => model.alwaysYes, htmlAttributes: new { @class = "control-label col-md-2" })
  50. <div class="col-md-10">
  51. @Html.EditorFor(model => model.alwaysYes, new { htmlAttributes = new { @class = "form-control" } })
  52. @Html.ValidationMessageFor(model => model.alwaysYes, "", new { @class = "text-danger" })
  53. @Html.DescriptionFor(model => model.alwaysYes)
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. @Html.LabelFor(model => model.alwaysNo, htmlAttributes: new { @class = "control-label col-md-2" })
  58. <div class="col-md-10">
  59. @Html.EditorFor(model => model.alwaysNo, new { htmlAttributes = new { @class = "form-control" } })
  60. @Html.ValidationMessageFor(model => model.alwaysNo, "", new { @class = "text-danger" })
  61. @Html.DescriptionFor(model => model.alwaysNo)
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. @Html.LabelFor(model => model.DATE_INUTILE, htmlAttributes: new { @class = "control-label col-md-2" })
  66. <div class="col-md-10">
  67. @Html.EditorFor(model => model.DATE_INUTILE, new { htmlAttributes = new { @class = "form-control" } })
  68. @Html.ValidationMessageFor(model => model.DATE_INUTILE, "", new { @class = "text-danger" })
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <div class="col-md-offset-2 col-md-10">
  73. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  74. <input type="reset" value="Annuler" class="btn btn-default" />
  75. </div>
  76. </div>
  77. </div>
  78. }
  79. <div>
  80. @*Message d'alerte au retour sur la page précédente*@
  81. <a href="#" onclick="Annulation('@Url.Action("Index")')">Retour</a>
  82. </div>