Edit.cshtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. @using CD67.FicheCollege.MVC.Models
  2. @model IdentiteViewModel
  3. @{
  4. ViewBag.Title = "Edit";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. Identite identite = Model.Obj;
  7. }
  8. <h1>@identite.College.Libelle</h1>
  9. @using (Html.BeginForm())
  10. {
  11. @Html.AntiForgeryToken()
  12. <fieldset>
  13. <legend>
  14. Identité du collège - @Model.Acces.ToString()
  15. </legend>
  16. <div class="form-horizontal">
  17. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  18. @Html.HiddenFor(model => identite.College_Id)
  19. <div class="form-group">
  20. @Html.Label("Principal et ajoint", htmlAttributes: new { @class = "control-label col-md-2" })
  21. <div class="col-md-4" data-picker-type="principal">
  22. @Html.HiddenFor(model => identite.Principal_SID, new { data_picker = "agent.id" })
  23. @Html.HiddenFor(model => identite.Principal_Login, new { data_picker = "agent.login" })
  24. @Html.HiddenFor(model => identite.Principal_Nom, new { data_picker = "agent.nom" })
  25. @Html.HiddenFor(model => identite.Principal_Prenom, new { data_picker = "agent.prenom" })
  26. @Html.HiddenFor(model => identite.Principal_Email, new { data_picker = "agent.mail" })
  27. @Html.HiddenFor(model => identite.Principal_Structure, new { data_picker = "agent.chemin" })
  28. @Html.HiddenFor(model => identite.Principal_Tel, new { data_picker = "agent.telephone" })
  29. <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=principal" title="Selection du principal (nouvelle fenetre)">Sélectionner un principal</a>
  30. <br />
  31. <div class="panel panel-default" id="Principal_Panel" name="Principal_Panel" style="@if (identite.Principal_SID == null) { <text>display: none;</text> }">
  32. <div class="panel-heading clearfix">
  33. <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
  34. <i class="fa fa-user color1" aria-hidden="true"></i>
  35. Principal
  36. </h4>
  37. <div class="pull-right">
  38. <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="principal"></span>
  39. </div>
  40. </div>
  41. <div class="panel-body" style="text-align: center;">
  42. <b><span data-picker="agent.prenom">@identite.Principal_Prenom</span> <span data-picker="agent.nom">@identite.Principal_Nom</span></b>
  43. <br /><span data-picker="agent.chemin">@identite.Principal_Structure</span>
  44. <br /><span data-picker="agent.mail">@identite.Principal_Email</span>
  45. <br />Tel : <span data-picker="agent.telephone">@identite.Principal_Tel</span>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="col-md-4" data-picker-type="adjoint">
  50. @Html.HiddenFor(model => identite.Adjoint_SID, new { data_picker = "agent.id" })
  51. @Html.HiddenFor(model => identite.Adjoint_Login, new { data_picker = "agent.login" })
  52. @Html.HiddenFor(model => identite.Adjoint_Nom, new { data_picker = "agent.nom" })
  53. @Html.HiddenFor(model => identite.Adjoint_Prenom, new { data_picker = "agent.prenom" })
  54. @Html.HiddenFor(model => identite.Adjoint_Email, new { data_picker = "agent.mail" })
  55. @Html.HiddenFor(model => identite.Adjoint_Structure, new { data_picker = "agent.chemin" })
  56. @Html.HiddenFor(model => identite.Adjoint_Tel, new { data_picker = "agent.telephone" })
  57. <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=adjoint" title="Selection du principal adjoint (nouvelle fenetre)">Sélectionner un principal adjoint</a>
  58. <br />
  59. <div class="panel panel-default" id="Adjoint_Panel" name="Adjoint_Panel" style="@if (identite.Adjoint_SID == null) { <text>display: none;</text> }">
  60. <div class="panel-heading clearfix">
  61. <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
  62. <i class="fa fa-user color1" aria-hidden="true"></i>
  63. Principal adjoint
  64. </h4>
  65. <div class="pull-right">
  66. <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="adjoint"></span>
  67. </div>
  68. </div>
  69. <div class="panel-body" style="text-align: center;">
  70. <b><span data-picker="agent.prenom">@identite.Adjoint_Prenom</span> <span data-picker="agent.nom">@identite.Adjoint_Nom</span></b>
  71. <br /><span data-picker="agent.chemin">@identite.Adjoint_Structure</span>
  72. <br /><span data-picker="agent.mail">@identite.Adjoint_Email</span>
  73. <br />Tel : <span data-picker="agent.telephone">@identite.Adjoint_Tel</span>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. @Html.Label("Gestionnaire et ajoint", htmlAttributes: new { @class = "control-label col-md-2" })
  80. <div class="col-md-4" data-picker-type="gestionnaire">
  81. @Html.HiddenFor(model => identite.Gestionnaire_SID, new { data_picker = "agent.id" })
  82. @Html.HiddenFor(model => identite.Gestionnaire_Login, new { data_picker = "agent.login" })
  83. @Html.HiddenFor(model => identite.Gestionnaire_Nom, new { data_picker = "agent.nom" })
  84. @Html.HiddenFor(model => identite.Gestionnaire_Prenom, new { data_picker = "agent.prenom" })
  85. @Html.HiddenFor(model => identite.Gestionnaire_Email, new { data_picker = "agent.mail" })
  86. @Html.HiddenFor(model => identite.Gestionnaire_Structure, new { data_picker = "agent.chemin" })
  87. @Html.HiddenFor(model => identite.Gestionnaire_Tel, new { data_picker = "agent.telephone" })
  88. <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=gestionnaire" title="Selection du gestionnaire (nouvelle fenetre)">Sélectionner un gestionnaire</a>
  89. <br />
  90. <div class="panel panel-default" id="Gestionnaire_Panel" name="Gestionnaire_Panel" style="@if (identite.Gestionnaire_SID == null) { <text>display: none;</text> }">
  91. <div class="panel-heading clearfix">
  92. <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
  93. <i class="fa fa-user color1" aria-hidden="true"></i>
  94. Gestionnaire
  95. </h4>
  96. <div class="pull-right">
  97. <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="gestionnaire"></span>
  98. </div>
  99. </div>
  100. <div class="panel-body" style="text-align: center;">
  101. <b><span data-picker="agent.prenom">@identite.Gestionnaire_Prenom</span> <span data-picker="agent.nom">@identite.Gestionnaire_Nom</span></b>
  102. <br /><span data-picker="agent.chemin">@identite.Gestionnaire_Structure</span>
  103. <br /><span data-picker="agent.mail">@identite.Gestionnaire_Email</span>
  104. <br />Tel : <span data-picker="agent.telephone">@identite.Gestionnaire_Tel</span>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="col-md-4" data-picker-type="gestionnaire2">
  109. @Html.HiddenFor(model => identite.Gestionnaire2_SID, new { data_picker = "agent.id" })
  110. @Html.HiddenFor(model => identite.Gestionnaire2_Login, new { data_picker = "agent.login" })
  111. @Html.HiddenFor(model => identite.Gestionnaire2_Nom, new { data_picker = "agent.nom" })
  112. @Html.HiddenFor(model => identite.Gestionnaire2_Prenom, new { data_picker = "agent.prenom" })
  113. @Html.HiddenFor(model => identite.Gestionnaire2_Email, new { data_picker = "agent.mail" })
  114. @Html.HiddenFor(model => identite.Gestionnaire2_Structure, new { data_picker = "agent.chemin" })
  115. @Html.HiddenFor(model => identite.Gestionnaire2_Tel, new { data_picker = "agent.telephone" })
  116. <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=gestionnaire2" title="Selection du gestionnaire n°2 (nouvelle fenetre)">Sélectionner un gestionnaire n°2</a>
  117. <br />
  118. <div class="panel panel-default" id="Gestionnaire2_Panel" name="Gestionnaire2_Panel" style="@if (identite.Gestionnaire2_SID == null) { <text>display: none;</text> }">
  119. <div class="panel-heading clearfix">
  120. <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
  121. <i class="fa fa-user color1" aria-hidden="true"></i>
  122. Gestionnaire n°2
  123. </h4>
  124. <div class="pull-right">
  125. <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="gestionnaire2"></span>
  126. </div>
  127. </div>
  128. <div class="panel-body" style="text-align: center;">
  129. <b><span data-picker="agent.prenom">@identite.Gestionnaire2_Prenom</span> <span data-picker="agent.nom">@identite.Gestionnaire2_Nom</span></b>
  130. <br /><span data-picker="agent.chemin">@identite.Gestionnaire2_Structure</span>
  131. <br /><span data-picker="agent.mail">@identite.Gestionnaire2_Email</span>
  132. <br />Tel : <span data-picker="agent.telephone">@identite.Gestionnaire2_Tel</span>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="form-group">
  138. <div class="col-md-offset-2 col-md-10">
  139. <input type="submit" value="@Model.Acces.EnumDisplayNameFor(MvcHtmlHelpers.DisplayValue.Prompt)" class="btn btn-default" /> |
  140. @Html.ActionLink("Annuler", "Details", new { Id = identite.College.Id })
  141. </div>
  142. </div>
  143. </div>
  144. </fieldset>
  145. }
  146. @section Scripts {
  147. <script type="text/javascript">
  148. $(".removeItem").click(function () {
  149. switch ($(this).data("type")) {
  150. case 'principal':
  151. $('#contenu_Principal_SID').val(null);
  152. $('#contenu_Principal_Login').val(null);
  153. $('#contenu_Principal_Nom').val(null);
  154. $('#contenu_Principal_Prenom').val(null);
  155. $('#contenu_Principal_Email').val(null);
  156. $('#contenu_Principal_Structure').val(null);
  157. $('#contenu_Principal_Tel').val(null);
  158. $('#Principal_Panel').hide();
  159. break;
  160. case 'adjoint':
  161. $('#contenu_Adjoint_SID').val(null);
  162. $('#contenu_Adjoint_Login').val(null);
  163. $('#contenu_Adjoint_Nom').val(null);
  164. $('#contenu_Adjoint_Prenom').val(null);
  165. $('#contenu_Adjoint_Email').val(null);
  166. $('#contenu_Adjoint_Structure').val(null);
  167. $('#contenu_Adjoint_Tel').val(null);
  168. $('#Adjoint_Panel').hide();
  169. break;
  170. case 'gestionnaire':
  171. $('#contenu_Gestionnaire_SID').val(null);
  172. $('#contenu_Gestionnaire_Login').val(null);
  173. $('#contenu_Gestionnaire_Nom').val(null);
  174. $('#contenu_Gestionnaire_Prenom').val(null);
  175. $('#contenu_Gestionnaire_Email').val(null);
  176. $('#contenu_Gestionnaire_Structure').val(null);
  177. $('#contenu_Gestionnaire_Tel').val(null);
  178. $('#Gestionnaire_Panel').hide();
  179. break;
  180. case 'gestionnaire2':
  181. $('#contenu_Gestionnaire2_SID').val(null);
  182. $('#contenu_Gestionnaire2_Login').val(null);
  183. $('#contenu_Gestionnaire2_Nom').val(null);
  184. $('#contenu_Gestionnaire2_Prenom').val(null);
  185. $('#contenu_Gestionnaire2_Email').val(null);
  186. $('#contenu_Gestionnaire2_Structure').val(null);
  187. $('#contenu_Gestionnaire2_Tel').val(null);
  188. $('#Gestionnaire2_Panel').hide();
  189. break;
  190. default:
  191. return false;
  192. }
  193. });
  194. </script>
  195. }