Edit.cshtml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. @Html.ActionLink("Retour", "Index")
  81. </div>