Create.cshtml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @using CD67.FicheCollege.MVC.Models
  2. @model RestaurationTypeRepaViewModel
  3. @{
  4. ViewBag.Title = "Création";
  5. Layout = "~/Views/Shared/_AdminLayout.cshtml";
  6. RestaurationTypeRepa repas = Model.Obj;
  7. }
  8. @using (Html.BeginForm())
  9. {
  10. @Html.AntiForgeryToken()
  11. <div class="form-horizontal">
  12. <h4>Types de restauration</h4>
  13. <hr />
  14. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  15. @Html.HiddenFor(model => repas.Id)
  16. @Html.HiddenFor(model => repas.Ordre)
  17. <div class="form-group">
  18. @Html.LabelFor(model => repas.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
  19. <div class="col-md-10">
  20. @Html.EditorFor(model => repas.Libelle, new { htmlAttributes = new { @class = "form-control" } })
  21. @Html.ValidationMessageFor(model => repas.Libelle, "", new { @class = "text-danger" })
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. @Html.LabelFor(model => repas.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
  26. <div class="col-md-10">
  27. @Html.EditorFor(model => repas.Valid, new { htmlAttributes = new { @class = "form-control" } })
  28. @Html.ValidationMessageFor(model => repas.Valid, "", new { @class = "text-danger" })
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <div class="col-md-offset-2 col-md-10">
  33. <input type="submit" value="Créer" class="btn btn-default" />
  34. </div>
  35. </div>
  36. </div>
  37. }
  38. <div>
  39. @Html.ActionLink("Retour à la liste", "Index")
  40. </div>
  41. @section Scripts {
  42. }