Import.cshtml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ImportActionEduViewModel
  3. @{
  4. ViewBag.Title = "Les Actions Educatives " + Model.Annee_Lib;
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. }
  7. @*Selection des actions à importer*@
  8. <div>
  9. @if(Model.actionsEdu_ids.Count == 0)
  10. {
  11. <span> Aucune action éducative à importer </span>
  12. <div>
  13. @Html.ActionLink("Annuler", "Index", new { annee_id = Model.Annee_Id })
  14. </div>
  15. }
  16. else
  17. {
  18. using (Html.BeginForm())
  19. {
  20. @Html.AntiForgeryToken()
  21. @Html.HiddenFor(model => Model.Annee_Id)
  22. <table id="table-college-import" class="datatable table">
  23. <thead>
  24. </thead>
  25. <tbody>
  26. @*@foreach (ImportCollegeItem item in Model.liste)*@
  27. @for(int i=0; i < Model.selection.Count; i++)
  28. {
  29. <tr>
  30. <td>
  31. @Html.EditorFor(model => Model.selection[i])
  32. @Html.HiddenFor(model => Model.actionsEdu_ids[i])
  33. </td>
  34. <td>
  35. @Html.DisplayFor(model => Model.actionsEdu_nums[i])
  36. </td>
  37. <td>
  38. @Html.DisplayFor(model => Model.actionsEdu_noms[i])
  39. </td>
  40. <td>
  41. @Html.DisplayFor(model => Model.actionsEdu_statuts[i])
  42. </td>
  43. <td>
  44. @if (Model.actionsEdu_averts[i].Count > 0)
  45. {
  46. <span class="text-danger">Un ou plusieurs collèges affectés à cette action n'ont pas été créés pour l'année cible: @String.Join(", ", Model.actionsEdu_averts[i])</span>
  47. }
  48. </td>
  49. </tr>
  50. }
  51. </tbody>
  52. </table>
  53. <div class="form-group btn-bar">
  54. <a href=@Url.Action("Index", new { annee_id = Model.Annee_Id }) class="btn btn-default">Annuler</a>
  55. <input type="submit" value="Importer" class="btn btn-primary" />
  56. </div>
  57. }
  58. }
  59. </div>