Edit.cshtml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ActionEduAxeViewModel
  3. @{
  4. ViewBag.Title = Model.Acces.ToString();
  5. Layout = "~/Views/Shared/_AdminLayout.cshtml";
  6. ActionEduAxe axe = Model.Obj;
  7. }
  8. @if (Model.Acces == ModeAcces.Modification)
  9. {
  10. <h2>@axe.Nom</h2>
  11. }
  12. else
  13. {
  14. <h2>Nouvel Axe</h2>
  15. }
  16. @using (Html.BeginForm())
  17. {
  18. @Html.AntiForgeryToken()
  19. <div class="form-horizontal">
  20. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  21. @Html.HiddenFor(model => axe.Id)
  22. @Html.HiddenFor(model => axe.Ordre)
  23. <div class="form-group">
  24. @Html.LabelFor(model => axe.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
  25. <div class="col-md-10">
  26. @Html.EditorFor(model => axe.Nom, new { htmlAttributes = new { @class = "form-control" } })
  27. @Html.ValidationMessageFor(model => axe.Nom, "", new { @class = "text-danger" })
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. @Html.LabelFor(model => axe.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })
  32. <div class="col-md-10">
  33. @Html.EditorFor(model => axe.Neutralise, new { htmlAttributes = new { @class = "form-control" } })
  34. @Html.ValidationMessageFor(model => axe.Neutralise, "", new { @class = "text-danger" })
  35. </div>
  36. </div>
  37. <div class="form-group btn-bar">
  38. <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
  39. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  40. </div>
  41. </div>
  42. }