@model SchoolUpdateDto
@{
    ViewData["Title"] = "Edit School";
    var zones = ViewBag.Zones as IEnumerable<ZoneDto>;
}

<h2>Edit School</h2>
<hr />

<div class="row">
    <div class="col-md-6">
        <form asp-action="Edit" method="post">
            <input type="hidden" asp-for="SchoolId" />
            <div asp-validation-summary="All" class="text-danger"></div>
            <div class="mb-3">
                <label asp-for="Name" class="form-label">Name</label>
                <input asp-for="Name" class="form-control" />
            </div>
            <div class="mb-3">
                <label asp-for="ShortName" class="form-label">Short Name</label>
                <input asp-for="ShortName" class="form-control" />
            </div>
            <div class="mb-3">
                <label asp-for="SchoolLevel" class="form-label">Level</label>
                <select asp-for="SchoolLevel" asp-items="Html.GetEnumSelectList<SchoolLevel>()" class="form-select"></select>
            </div>
            <div class="mb-3">
                <label asp-for="ZoneId" class="form-label">Zone</label>
                <select asp-for="ZoneId" class="form-select">
                    @if (zones != null) { @foreach (var z in zones) { <option value="@z.ZoneId">@z.Name</option> } }
                </select>
            </div>
            <div class="mb-3 form-check">
                <input asp-for="IsActive" class="form-check-input" />
                <label asp-for="IsActive" class="form-check-label">Active</label>
            </div>
            <button type="submit" class="btn btn-primary">Save</button>
            <a asp-action="Index" class="btn btn-secondary">Cancel</a>
        </form>
    </div>
</div>

@section Scripts { <partial name="_ValidationScriptsPartial" /> }
