@model StoreModel
@* Generated from Custom Template. *@
@* Model namespace using directive should be added to _ViewImports.cshtml. *@
@{
var containerDivClass = "container";
var dateTimePickerClass = "datetimepicker";
}
@{
ViewData["Title"] = "Store Edit";
}
<div class="@containerDivClass">
<h3>@ViewData["Title"]</h3>
<hr />
</div>
@if (Model is not null)
{
<div class="@containerDivClass">
@if (TempData["Message"] is not null)
{
<p class="text-danger">
@TempData["Message"]
</p>
}
<form asp-action="Edit" autocomplete="off">
@Html.AntiForgeryToken()
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Record.Id" />
<div class="row mb-3">
<label asp-for="Name" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<input asp-for="Record.Name" class="form-control" />
<span asp-validation-for="Record.Name" class="text-danger"></span>
</div>
</div>
<div class="row mb-3">
<label asp-for="IsVirtual" class="col-2 col-form-label fw-bold"></label>
<div class="col-10 pt-2">
<input class="form-check-input" asp-for="Record.IsVirtual" />
</div>
</div>
<div class="row mb-3">
<label asp-for="Country" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<select asp-for="Record.CountryId" class="form-select" asp-items="ViewBag.CountryId" onchange="ajaxLoadSelect('#cities', '@Url.Action("Get", "Cities")', { countryId: this.value });">
<option value="">-- Select --</option>
</select>
<span asp-validation-for="Record.CountryId" class="text-danger"></span>
</div>
</div>
<div class="row mb-3">
<label asp-for="City" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<select asp-for="Record.CityId" class="form-select" asp-items="ViewBag.CityId" id="cities">
<option value="">-- Select --</option>
</select>
<span asp-validation-for="Record.CityId" class="text-danger"></span>
</div>
</div>
@* Can be uncommented and used for many to many relationships. {Entity} may be replaced with the related entiy name in the controller and views. *@
@*
<div class="row mb-3">
<label asp-for="{Entity}Ids" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<select multiple asp-for="{Entity}Ids" class="form-select" asp-items="ViewBag.{Entity}Ids"></select>
<span asp-validation-for="{Entity}Ids" class="text-danger"></span>
</div>
</div>
*@
<hr />
<div class="row mb-3">
<div class="offset-2 col-10">
<button type="submit" class="btn btn-primary">Save</button>
<button type="reset" class="btn btn-outline-primary">Reset</button>
<a asp-action="Delete" asp-route-id="@Model.Record.Id">Delete</a>
<a asp-action="Index">Back to List</a>
</div>
</div>
</form>
</div>
}
@section Scripts {
<partial name="_ValidationScriptsPartial" />
<partial name="_Ajax" />
}