Edit.cshtml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @using CD67.FicheCollege.MVC.Models
  2. @model RestaurationTypesRepaViewModel
  3. @{
  4. ViewBag.Title = Model.Acces.ToString();
  5. Layout = "~/Views/Shared/_AdminLayout.cshtml";
  6. RestaurationTypesRepa repas = Model.Obj;
  7. }
  8. @if (Model.Acces == ModeAcces.Modification)
  9. {
  10. <h2>@repas.Libelle</h2>
  11. }
  12. else
  13. {
  14. <h2>Nouveau Type de Repas</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 => repas.Id)
  22. @Html.HiddenFor(model => repas.Ordre)
  23. <div class="form-group">
  24. @Html.LabelFor(model => repas.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
  25. <div class="col-md-10">
  26. @Html.EditorFor(model => repas.Libelle, new { htmlAttributes = new { @class = "form-control" } })
  27. @Html.ValidationMessageFor(model => repas.Libelle, "", new { @class = "text-danger" })
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. @Html.LabelFor(model => repas.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
  32. <div class="col-md-10">
  33. @Html.EditorFor(model => repas.Valid, new { htmlAttributes = new { @class = "form-control" } })
  34. @Html.ValidationMessageFor(model => repas.Valid, "", 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. }