@model CD67.ModeleMVC.Entity.EXEMPLE_VIKINGS

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<title>Vikings</title>

<h2>Edition</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Viking</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.ID)

        <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="Enregistrer" class="btn btn-primary" />
                <input type="reset" value="Annuler" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @*Message d'alerte au retour sur la page précédente*@
    @Html.ActionLink("Retour", "Index", new { controller = "VIKINGS" }, new { @class = "confirm", @data_texte = "Vous risquez de perdre les données non sauvegardées. Etes vous sûr de vouloir continuer ?" })
</div>