@using CD67.FicheCollege.MVC.Models @model CollegeViewModel @{ ViewBag.Title = "Les Collèges " + @Model.Annee_Lib; Layout = "~/Views/Shared/_Layout.cshtml"; College college = Model.Obj; }
@if (Model.Acces == ModeAcces.Modification) {

@college.Libelle

} else {

Nouveau collège

}
@using (Html.BeginForm()) { @Html.AntiForgeryToken()
Informations générales
@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @if (Model.Acces == ModeAcces.Modification) { @Html.HiddenFor(model => college.Id) } @Html.HiddenFor(model => college.Annee_Id) @Html.HiddenFor(model => college.TokenId) @Html.HiddenFor(model => college.RestaurationType_Id)
@Html.LabelFor(model => college.CodeRne, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => college.CodeRne, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => college.Libelle, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => college.Libelle, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.TypeCollege_Id, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.DropDownListFor(model => college.TypeCollege_Id, Model.Sel_TypesCollege, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => college.TypeCollege_Id, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Adresse, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => college.Adresse, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => college.Adresse, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Territoire_Id, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.DropDownListFor(model => college.Territoire_Id, Model.Sel_Territoires, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => college.Territoire_Id, "", new { @class = "text-danger" })
@Html.HiddenFor(model => college.Commune_Insee, new { data_picker = "commune.insee" }) @Html.TextBoxFor(model => college.Commune, new { data_picker = "commune.nom", @class = "special_hidden" }) @*On est obligé d'utiliser cette méthode bizzare pour cacher le champ, sinon pas de validation coté user (pas de validation des données sur les champs cachés)*@ @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" })
@Html.LabelFor(model => college.Commune, htmlAttributes: new { @class = "control-label col-md-2 required" })
Sélectionner une commune

Localisation (commune)

@college.Commune
Canton : @college.Canton
TAD : @college.TAD
CDC : @college.CDC
@Html.ValidationMessageFor(model => college.Commune, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Code_Postal, htmlAttributes: new { @class = "control-label col-md-2" })
Code(s) postal(aux) associé(s) à la commune @if (Model.Sel_CodesPostaux.Count() > 1) { (attention, plusieurs choix possibles) } : i.Text))" class="disabled-input-as-label" />
@Html.DropDownListFor(model => college.Code_Postal, Model.Sel_CodesPostaux, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => college.Code_Postal, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Tel, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => college.Tel, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => college.Tel, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Fax, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => college.Fax, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => college.Fax, "", new { @class = "text-danger" })
@Html.LabelFor(model => college.Email, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => college.Email, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => college.Email, "", new { @class = "text-danger" })
@Html.HiddenFor(model => college.PrincipalSid, new { data_picker = "agent.id" }) Sélectionner un principal

@Html.LabelFor(model => college.PrincipalSid)

@Html.DisplayFor(model => college.principal.Prenom) @Html.DisplayFor(model => college.principal.Nom)
@Html.DisplayFor(model => college.principal.Organisation)
@Html.DisplayFor(model => college.principal.Mail)
@Html.DisplayFor(model => college.principal.Telephone)
@Html.HiddenFor(model => college.AdjointSid, new { data_picker = "agent.id" }) Sélectionner un principal adjoint

@Html.LabelFor(model => college.AdjointSid)

@Html.DisplayFor(model => college.adjoint.Prenom) @Html.DisplayFor(model => college.adjoint.Nom)
@Html.DisplayFor(model => college.adjoint.Organisation)
@Html.DisplayFor(model => college.adjoint.Mail)
@Html.DisplayFor(model => college.adjoint.Telephone)
@Html.HiddenFor(model => college.Gestionnaire1Sid, new { data_picker = "agent.id" }) Sélectionner un gestionnaire

@Html.LabelFor(model => college.Gestionnaire1Sid)

@Html.DisplayFor(model => college.gestionnaire1.Prenom) @Html.DisplayFor(model => college.gestionnaire1.Nom)
@Html.DisplayFor(model => college.gestionnaire1.Organisation)
@Html.DisplayFor(model => college.gestionnaire1.Mail)
@Html.DisplayFor(model => college.gestionnaire1.Telephone)
@Html.HiddenFor(model => college.Gestionnaire2Sid, new { data_picker = "agent.id" }) Sélectionner un gestionnaire

@Html.LabelFor(model => college.Gestionnaire2Sid)

@Html.DisplayFor(model => college.gestionnaire2.Prenom) @Html.DisplayFor(model => college.gestionnaire2.Nom)
@Html.DisplayFor(model => college.gestionnaire2.Organisation)
@Html.DisplayFor(model => college.gestionnaire2.Mail)
@Html.DisplayFor(model => college.gestionnaire2.Telephone)

@if (Model.Acces == ModeAcces.Creation) { Annuler } else { Annuler }
} @section Scripts { @Scripts.Render("~/bundles/jqueryval") }