Edit.cshtml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
  2. @{
  3. ViewBag.Title = "Edit";
  4. Layout = "~/Views/Shared/_AppLayout.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" } })
  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. <div class="form-group">
  25. @Html.LabelFor(model => model.ID_TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
  26. <div class="col-md-10">
  27. @Html.DropDownList("ID_TYPE", null, htmlAttributes: new { @class = "form-control" })
  28. @Html.ValidationMessageFor(model => model.ID_TYPE, "", new { @class = "text-danger" })
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. @Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "control-label col-md-2" })
  33. <div class="col-md-10">
  34. @Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "form-control" } })
  35. @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. @Html.LabelFor(model => model.alwaysYes, htmlAttributes: new { @class = "control-label col-md-2" })
  40. <div class="col-md-10">
  41. @Html.EditorFor(model => model.alwaysYes, new { htmlAttributes = new { @class = "form-control" } })
  42. @Html.ValidationMessageFor(model => model.alwaysYes, "", new { @class = "text-danger" })
  43. @Html.DescriptionFor(model => model.alwaysYes)
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. @Html.LabelFor(model => model.alwaysNo, htmlAttributes: new { @class = "control-label col-md-2" })
  48. <div class="col-md-10">
  49. @Html.EditorFor(model => model.alwaysNo, new { htmlAttributes = new { @class = "form-control" } })
  50. @Html.ValidationMessageFor(model => model.alwaysNo, "", new { @class = "text-danger" })
  51. @Html.DescriptionFor(model => model.alwaysNo)
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <div class="col-md-offset-2 col-md-10">
  56. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  57. <input type="reset" value="Annuler" class="btn btn-default" />
  58. </div>
  59. </div>
  60. </div>
  61. }
  62. <div>
  63. @Html.ActionLink("Retour", "Index")
  64. </div>