|
|
@@ -0,0 +1,157 @@
|
|
|
+@using CD67.FicheCollege.MVC.Models
|
|
|
+@model CollegeViewModel
|
|
|
+
|
|
|
+@{
|
|
|
+ ViewBag.Title = "Ajout";
|
|
|
+ Layout = "~/Views/Shared/_Layout.cshtml";
|
|
|
+ College college = Model.Contenu as College;
|
|
|
+}
|
|
|
+
|
|
|
+<h2>@Model.Acces.ToString()</h2>
|
|
|
+
|
|
|
+
|
|
|
+@using (Html.BeginForm())
|
|
|
+{
|
|
|
+ @Html.AntiForgeryToken()
|
|
|
+
|
|
|
+ <div class="form-horizontal">
|
|
|
+ <h4>Collège</h4>
|
|
|
+ <hr />
|
|
|
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" })
|
|
|
+
|
|
|
+ @if (Model.Acces == ModeAcces.Modification)
|
|
|
+ {
|
|
|
+ @Html.HiddenFor(model => college.Id)
|
|
|
+ }
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Id, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @if (Model.Acces == ModeAcces.Modification)
|
|
|
+ {
|
|
|
+ @Html.EditorFor(model => college.Id, new { htmlAttributes = new { @class = "form-control", @disabled = true } })
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ @Html.EditorFor(model => college.Id, new { htmlAttributes = new { @class = "form-control" } })
|
|
|
+ }
|
|
|
+ @Html.ValidationMessageFor(model => college.Id, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @Html.EditorFor(model => college.Libelle, new { htmlAttributes = new { @class = "form-control" } })
|
|
|
+ @Html.ValidationMessageFor(model => college.Libelle, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.TypeCollege_Id, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @Html.DropDownListFor(model => college.TypeCollege_Id, Model.Listes["TypeCollege_Id"], htmlAttributes: new { @class = "form-control" })
|
|
|
+ @Html.ValidationMessageFor(model => college.TypeCollege_Id, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Adresse, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @Html.EditorFor(model => college.Adresse, new { htmlAttributes = new { @class = "form-control" } })
|
|
|
+ @Html.ValidationMessageFor(model => college.Adresse, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @Html.HiddenFor(model => college.Code_Postal, new { data_picker = "commune.code_postal" })
|
|
|
+ @Html.HiddenFor(model => college.Commune_Insee, new { data_picker = "commune.insee" })
|
|
|
+ @Html.HiddenFor(model => college.Commune, new { data_picker = "commune.nom" })
|
|
|
+ @Html.HiddenFor(model => college.Canton, new { data_picker = "commune.canton" })
|
|
|
+ @Html.HiddenFor(model => college.Territoire_Id, new { data_picker = "commune.code_tad" })
|
|
|
+ @Html.HiddenFor(model => college.TAD, new { data_picker = "commune.tad" })
|
|
|
+ @Html.HiddenFor(model => college.CDC, new { data_picker = "commune.cdc" })
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Commune, htmlAttributes: new { @class = "control-label col-md-2 required" })
|
|
|
+ <div class="col-md-4">
|
|
|
+ <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/com67/" title="Selection commune (nouvelle fenetre)">Sélectionner une commune</a>
|
|
|
+ <br />
|
|
|
+ <div class="panel panel-default" id="Commune_Panel" name="Commune_Panel" style="@if (college.Commune_Insee == null) { <text>display: none;</text> }">
|
|
|
+ <div class="panel-heading clearfix">
|
|
|
+ <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
|
|
|
+ <i class="fa fa-map-marker color1" aria-hidden="true"></i>
|
|
|
+ Localisation (commune)
|
|
|
+ </h4>
|
|
|
+ <div class="pull-right">
|
|
|
+ <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="commune"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="panel-body" style="text-align: center;">
|
|
|
+ <span>
|
|
|
+ <b><span data-picker="commune.nom">@college.Commune</span ></b >
|
|
|
+ <br />Canton : <span data-picker="commune.canton">@college.Canton</span >
|
|
|
+ <br />TAD : <span data-picker="commune.tad">@college.TAD</span >
|
|
|
+ <br />CDC : <span data-picker="commune.cdc">@college.CDC</span >
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ @Html.ValidationMessageFor(model => college.Commune, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Tel, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @Html.EditorFor(model => college.Tel, new { htmlAttributes = new { @class = "form-control" } })
|
|
|
+ @Html.ValidationMessageFor(model => college.Tel, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Fax, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @Html.EditorFor(model => college.Fax, new { htmlAttributes = new { @class = "form-control" } })
|
|
|
+ @Html.ValidationMessageFor(model => college.Fax, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ @Html.LabelFor(model => college.Email, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
|
+ <div class="col-md-10">
|
|
|
+ @Html.EditorFor(model => college.Email, new { htmlAttributes = new { @class = "form-control" } })
|
|
|
+ @Html.ValidationMessageFor(model => college.Email, "", new { @class = "text-danger" })
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ <div class="col-md-offset-2 col-md-10">
|
|
|
+ <input type="submit" value="@Model.Acces.EnumDisplayNameFor(MvcHtmlHelpers.DisplayValue.Prompt)" class="btn btn-default" /> |
|
|
|
+ @if (Model.Acces == ModeAcces.Creation)
|
|
|
+ { @Html.ActionLink("Annuler", "Index") }
|
|
|
+ else
|
|
|
+ { @Html.ActionLink("Annuler", "Details", new { Id = Model.College_Id }) }
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+}
|
|
|
+
|
|
|
+@section Scripts {
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(".removeItem").click(function () {
|
|
|
+ switch ($(this).data("type")) {
|
|
|
+ case 'commune':
|
|
|
+ $('#Code_Postal').val(null);
|
|
|
+ $('#Commune_Insee').val(null);
|
|
|
+ $('#Commune').val(null);
|
|
|
+ $('#Canton').val(null);
|
|
|
+ $('#Territoire_Id').val(null);
|
|
|
+ $('#TAD').val(null);
|
|
|
+ $('#CDC').val(null);
|
|
|
+ $('#Commune_Panel').hide();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+
|
|
|
+ @Scripts.Render("~/bundles/jqueryval")
|
|
|
+}
|