| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- @model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS
- @{
- ViewBag.Title = "Create";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- <title>Vikings</title>
- <h2>Creation</h2>
- @using (Html.BeginForm())
- {
- @Html.AntiForgeryToken()
- <div class="form-horizontal">
- <h4>Viking</h4>
- <hr />
- @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-
- @*Contenu généré mais masqué car inutile, la clé est générée automatiquement dans mon exemple par un trigger/sequence*@
- @*<div class="form-group">
- @Html.LabelFor(model => model.ID, "ID", htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.DropDownList("ID", null, htmlAttributes: new { @class = "form-control" })
- @Html.ValidationMessageFor(model => model.ID, "", new { @class = "text-danger" })
- </div>
- </div>*@
- <div class="form-group">
- @Html.LabelFor(model => model.NOM, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.EditorFor(model => model.NOM, new { htmlAttributes = new { @class = "form-control autofocus" } })
- @Html.ValidationMessageFor(model => model.NOM, "", new { @class = "text-danger" })
- </div>
- </div>
- @*Liste de choix pour le type, rempli gràce au ViewBag dans le contrôleur*@
- @*Liste principale pour la liste imbriquée sous-type*@
- <div class="form-group">
- @Html.LabelFor(model => model.ID_TYPE, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.DropDownList("ID_TYPE", null, htmlAttributes: new { @class = "form-control liste-principale", @data = "/VIKINGS/listeSousType" })
- @Html.ValidationMessageFor(model => model.ID_TYPE, "", new { @class = "text-danger" })
- </div>
- </div>
- @*Liste de choix d'un sous-type fictif*@
- <div class="form-group">
- @Html.LabelFor(model => model.ID_SOUS_TYPE, "Sous type", htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.DropDownList("ID_SOUS_TYPE", null, htmlAttributes: new { @class = "form-control liste-secondaire" })
- @Html.ValidationMessageFor(model => model.ID_SOUS_TYPE, "", new { @class = "text-danger" })
- @Html.DescriptionFor(model => model.ID_SOUS_TYPE)
- </div>
- </div>
- <div class="form-group">
- @Html.LabelFor(model => model.DESCRIPTION, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.EditorFor(model => model.DESCRIPTION, new { htmlAttributes = new { @class = "form-control" } })
- @Html.ValidationMessageFor(model => model.DESCRIPTION, "", new { @class = "text-danger" })
- </div>
- </div>
- <div class="form-group">
- @Html.LabelFor(model => model.alwaysYes, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.EditorFor(model => model.alwaysYes, new { htmlAttributes = new { @class = "form-control" } })
- @Html.ValidationMessageFor(model => model.alwaysYes, "", new { @class = "text-danger" })
- @Html.DescriptionFor(model=>model.alwaysYes)
- </div>
- </div>
- <div class="form-group">
- @Html.LabelFor(model => model.alwaysNo, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.EditorFor(model => model.alwaysNo, new { htmlAttributes = new { @class = "form-control" } })
- @Html.ValidationMessageFor(model => model.alwaysNo, "", new { @class = "text-danger" })
- @Html.DescriptionFor(model => model.alwaysNo)
- </div>
- </div>
- <div class="form-group">
- @Html.LabelFor(model => model.DATE_INUTILE, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.EditorFor(model => model.DATE_INUTILE, new { htmlAttributes = new { @class = "form-control" } })
- @Html.ValidationMessageFor(model => model.DATE_INUTILE, "", new { @class = "text-danger" })
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-offset-2 col-md-10">
- <input type="submit" value="Ajouter" class="btn btn-success" />
- <input type="reset" value="Annuler" class="btn btn-default" />
- </div>
- </div>
- </div>
- }
- <div>
- @*Message d'alerte au retour sur la page précédente*@
- <a href="#" onclick="Annulation('@Url.Action("Index")')">Retour</a>
- </div>
|