Import.cshtml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @using CD67.FicheCollege.MVC.Models
  2. @model ImportCollegeViewModel
  3. @{
  4. ViewBag.Title = "Les Collèges " + Model.Annee_Lib;
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. }
  7. @*Selection de colleges à importer*@
  8. <div>
  9. @if(Model.colleges_ids.Count == 0)
  10. {
  11. <span> Aucun collège à 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.colleges_ids[i])
  33. </td>
  34. <td>
  35. @Html.DisplayFor(model => Model.colleges_rnes[i])
  36. </td>
  37. <td>
  38. @Html.DisplayFor(model => Model.colleges_libs[i])
  39. </td>
  40. </tr>
  41. }
  42. </tbody>
  43. </table>
  44. <div class="form-group btn-bar">
  45. <a href=@Url.Action("Index", new { annee_id = Model.Annee_Id }) class="btn btn-default">Annuler</a>
  46. <input type="submit" value="Importer" class="btn btn-primary" />
  47. </div>
  48. }
  49. }
  50. </div>