Edit.cshtml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ActionEduCollegeViewModel
  3. @{
  4. ViewBag.Title = "Les Actions Educatives " + Model.Annee_Lib;
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. ActionEduCollege actionEduCollege = Model.Obj;
  7. }
  8. <header>
  9. <h2>@actionEduCollege.ActionEdu.Nom: Ajouter un collège</h2>
  10. </header>
  11. @using (Html.BeginForm())
  12. {
  13. @Html.AntiForgeryToken()
  14. <div class="form-horizontal">
  15. <h4>Actions</h4>
  16. <hr />
  17. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  18. @Html.HiddenFor(model => actionEduCollege.Id)
  19. @Html.HiddenFor(model => actionEduCollege.ActionEduId)
  20. <div class="form-group">
  21. @Html.LabelFor(model => actionEduCollege.CollegeId, htmlAttributes: new { @class = "control-label col-md-2" })
  22. <div class="col-md-10">
  23. @Html.DropDownListFor(model => actionEduCollege.CollegeId, Model.Sel_College, htmlAttributes: new { @class = "form-control" })
  24. @Html.ValidationMessageFor(model => actionEduCollege.CollegeId, "", new { @class = "text-danger" })
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. @Html.LabelFor(model => actionEduCollege.NbEleves, htmlAttributes: new { @class = "control-label col-md-2" })
  29. <div class="col-md-10">
  30. @Html.EditorFor(model => actionEduCollege.NbEleves, new { htmlAttributes = new { @class = "form-control" } })
  31. @Html.ValidationMessageFor(model => actionEduCollege.NbEleves, "", new { @class = "text-danger" })
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. @Html.LabelFor(model => actionEduCollege.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
  36. <div class="col-md-10">
  37. @Html.EditorFor(model => actionEduCollege.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
  38. @Html.ValidationMessageFor(model => actionEduCollege.Commentaire, "", new { @class = "text-danger" })
  39. </div>
  40. </div>
  41. <div class="form-group btn-bar">
  42. @if (Model.Acces == ModeAcces.Modification)
  43. {
  44. <a href=@Url.Action("Details", new { id = actionEduCollege.Id }) class="btn btn-default">Annuler</a>
  45. }
  46. else
  47. {
  48. <a href=@Url.Action("Details", "ActionsEdu", new { id = actionEduCollege.ActionEduId }) class="btn btn-default">Annuler</a>
  49. }
  50. <input type="submit" value="Enregistrer" class="btn btn-primary" />
  51. </div>
  52. </div>
  53. }