@using CD67.FicheCollege.MVC.Models
@model ActionEduCollegeViewModel

@{
    ViewBag.Title = Model.Acces.ToString();
    Layout = "~/Views/Shared/_Layout.cshtml";
    ActionEduCollege actionEduCollege = Model.Obj;
}

<header>
    <h2>@actionEduCollege.ActionEdu.Nom: Ajouter un collège</h2>
</header>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Actions</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => actionEduCollege.Id)
        @Html.HiddenFor(model => actionEduCollege.ActionEduId)
        
        <div class="form-group">
            @Html.LabelFor(model => actionEduCollege.CollegeId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => actionEduCollege.CollegeId, Model.Sel_College, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => actionEduCollege.CollegeId, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => actionEduCollege.NbEleves, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => actionEduCollege.NbEleves, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => actionEduCollege.NbEleves, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => actionEduCollege.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => actionEduCollege.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => actionEduCollege.Commentaire, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group btn-bar">
            @if (Model.Acces == ModeAcces.Modification)
            {
                <a href=@Url.Action("Details", new { id = actionEduCollege.Id }) class="btn btn-default">Annuler</a>
            }
            else
            {
                <a href=@Url.Action("Details", "ActionsEdu", new { id = actionEduCollege.ActionEduId }) class="btn btn-default">Annuler</a>
            }
            <input type="submit" value="Enregistrer" class="btn btn-primary" />
        </div>
    </div>
}
