Edit.cshtml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @using CD67.FicheCollege.MVC.Models
  2. @model RestaurationParametreViewModel
  3. @{
  4. ViewBag.Title = "Restauration " + 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 btn-bar">
  75. <a href=@Url.Action("Index", "Restauration", new { annee_id = param.Annee_Id }) class="btn btn-default">Annuler</a>
  76. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  77. </div>
  78. </div>
  79. }