@model Data.Entities.Rents

@{
    ViewData["Title"] = "Create";
}

<h1>Create rent</h1>
<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="Create">
            <div class="form-group">
                <label asp-for="CarId" class="control-label"></label>
                <input asp-for="CarId" class="form-control" />
                <span asp-validation-for="CarId" class="text-danger"></span>
            </div>
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="StartDate" class="control-label"></label>
                <input asp-for="StartDate" class="form-control" />
                <span asp-validation-for="StartDate" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="EndDate" class="control-label"></label>
                <input asp-for="EndDate" class="form-control" />
                <span asp-validation-for="EndDate" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-primary" />
                @if (this.User.IsInRole("Admin"))
                {
                    <a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
                }
                </div>
        </form>
    </div>
</div>


@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
