Edit.cshtml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. @model CD67.ModeleMVC.Entity.Viking
  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. @Html.HiddenFor(model => model.DateCreation)
  17. <div class="form-group">
  18. @Html.LabelFor(model => model.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
  19. <div class="col-md-10">
  20. @Html.EditorFor(model => model.Nom, new { htmlAttributes = new { @class = "form-control autofocus" } })
  21. @Html.ValidationMessageFor(model => model.Nom, "", new { @class = "text-danger" })
  22. </div>
  23. </div>
  24. @*Liste de choix pour le type, rempli gràce au ViewBag dans le contrôleur*@
  25. <div class="form-group">
  26. @Html.LabelFor(model => model.TypeViking, htmlAttributes: new { @class = "control-label col-md-2" })
  27. <div class="col-md-10">
  28. @Html.DropDownListFor(model => model.TypeVikingId, (IEnumerable<SelectListItem>)ViewBag.ListeTypesViking, htmlAttributes: new { @class = "form-control custom-dropdown col-md-12" })
  29. @Html.ValidationMessageFor(model => model.TypeViking, "", new { @class = "text-danger" })
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. @Html.LabelFor(model => model.Description, htmlAttributes: new { @class = "control-label col-md-2" })
  34. <div class="col-md-10">
  35. @Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })
  36. @Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. @Html.LabelFor(model => model.costaud, htmlAttributes: new { @class = "control-label col-md-2" })
  41. <div class="col-md-10">
  42. @Html.EditorFor(model => model.costaud, new { htmlAttributes = new { @class = "form-control" } })
  43. @Html.ValidationMessageFor(model => model.costaud, "", new { @class = "text-danger" })
  44. @Html.DescriptionFor(model => model.costaud)
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. @Html.LabelFor(model => model.NombreVictoires, htmlAttributes: new { @class = "control-label col-md-2" })
  49. <div class="col-md-10">
  50. @Html.EditorFor(model => model.NombreVictoires, new { htmlAttributes = new { @class = "form-control" } })
  51. @Html.ValidationMessageFor(model => model.NombreVictoires, "", new { @class = "text-danger" })
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. @Html.LabelFor(model => model.CasqueCornu, htmlAttributes: new { @class = "control-label col-md-2" })
  56. <div class="col-md-10">
  57. @Html.EditorFor(model => model.CasqueCornu, new { htmlAttributes = new { @class = "form-control" } })
  58. </div>
  59. </div>
  60. <div class="col-md-7">
  61. </div>
  62. <div class="form-group col-md-5">
  63. <div class="col-md-offset-2 col-md-10">
  64. <div class="col-md-offset-2 col-md-10">
  65. <input type="submit" value="Enregistrer" class="btn btn-info" />
  66. <input onclick="location.href='@Url.Action("Index", "Viking")';return false;" value="Retour" class="btn btn-default" />
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. }