Edit.cshtml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @using CD67.FicheCollege.MVC.Models
  2. @model RestaurationParametreViewModel
  3. @{
  4. ViewBag.Title = "Modification " + Model.Annee_Lib;
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. RestaurationParametre param = Model.Obj;
  7. List<CheckBoxListItem> repasCBList = ViewBag.repasCBList;
  8. }
  9. <header>
  10. @if (Model.Acces == ModeAcces.Modification)
  11. {
  12. <h2>Modification</h2>
  13. }
  14. else
  15. {
  16. <h2>Création</h2>
  17. }
  18. </header>
  19. @using (Html.BeginForm())
  20. {
  21. @Html.AntiForgeryToken()
  22. <div class="form-horizontal">
  23. <h4>Paramètres</h4>
  24. <hr />
  25. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  26. @if (Model.Acces == ModeAcces.Modification)
  27. {
  28. @Html.HiddenFor(model => param.Id)
  29. }
  30. @Html.HiddenFor(model => param.Annee_Id)
  31. @Html.HiddenFor(model => param.Campagne)
  32. <div class="form-group">
  33. @Html.LabelFor(model => param.Prix_Mini, htmlAttributes: new { @class = "control-label col-md-2" })
  34. <div class="col-md-10">
  35. @Html.EditorFor(model => param.Prix_Mini, new { htmlAttributes = new { @class = "form-control" } })
  36. @Html.ValidationMessageFor(model => param.Prix_Mini, "", new { @class = "text-danger" })
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. @Html.LabelFor(model => param.Prix_ATC, htmlAttributes: new { @class = "control-label col-md-2" })
  41. <div class="col-md-10">
  42. @Html.EditorFor(model => param.Prix_ATC, new { htmlAttributes = new { @class = "form-control" } })
  43. @Html.ValidationMessageFor(model => param.Prix_ATC, "", new { @class = "text-danger" })
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. @Html.LabelFor(model => param.Prix_AgentC, htmlAttributes: new { @class = "control-label col-md-2" })
  48. <div class="col-md-10">
  49. @Html.EditorFor(model => param.Prix_AgentC, new { htmlAttributes = new { @class = "form-control" } })
  50. @Html.ValidationMessageFor(model => param.Prix_AgentC, "", new { @class = "text-danger" })
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. @Html.LabelFor(model => param.Prix_MiniAutres, htmlAttributes: new { @class = "control-label col-md-2" })
  55. <div class="col-md-10">
  56. @Html.EditorFor(model => param.Prix_MiniAutres, new { htmlAttributes = new { @class = "form-control" } })
  57. @Html.ValidationMessageFor(model => param.Prix_MiniAutres, "", new { @class = "text-danger" })
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. @Html.Label("Types de repas", htmlAttributes: new { @class = "control-label col-md-2" })
  62. <div class="col-md-10">
  63. @for (int i = 0; i < repasCBList.Count; i++)
  64. {
  65. @Html.HiddenFor(x => repasCBList[i].ID)
  66. @Html.CheckBoxFor(x => repasCBList[i].IsChecked)
  67. <text> </text>
  68. @repasCBList[i].Display
  69. @Html.HiddenFor(x => repasCBList[i].Display)
  70. <br />
  71. }
  72. </div>
  73. </div>
  74. <div class="form-group">
  75. <div class="col-md-offset-2 col-md-10">
  76. <input type="submit" value="Enregistrer" class="btn btn-default" /> &nbsp;&nbsp;
  77. <a href="@Url.Action("Index", "Restauration", new { annee_id = param.Annee_Id })">
  78. <span title="Annuler" style="vertical-align: middle" aria-hidden="true">Annuler</span>
  79. </a>
  80. </div>
  81. </div>
  82. </div>
  83. }
  84. @section Scripts {
  85. }