Edit.cshtml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @using CD67.FicheCollege.MVC.Models
  2. @model TypeCollegeViewModel
  3. @{
  4. ViewBag.Title = "Administration - Les Types de Collèges";
  5. Layout = "~/Views/Shared/_AdminLayout.cshtml";
  6. TypeCollege typeCollege = Model.Obj;
  7. }
  8. @if (Model.Acces == ModeAcces.Modification)
  9. {
  10. <h2>@typeCollege.Libelle</h2>
  11. }
  12. else
  13. {
  14. <h2>Nouveau Type de Collège</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 => typeCollege.Id)
  22. @Html.HiddenFor(model => typeCollege.Ordre)
  23. <div class="form-group">
  24. @Html.LabelFor(model => typeCollege.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
  25. <div class="col-md-10">
  26. @Html.EditorFor(model => typeCollege.Libelle, new { htmlAttributes = new { @class = "form-control" } })
  27. @Html.ValidationMessageFor(model => typeCollege.Libelle, "", new { @class = "text-danger" })
  28. </div>
  29. </div>
  30. <div class="form-group btn-bar">
  31. <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
  32. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  33. </div>
  34. </div>
  35. }