Design changes
This commit is contained in:
@@ -60,7 +60,7 @@ namespace WebApp.Controllers
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
|
||||
public async Task<IActionResult> Create([Bind("Id,CarId,StartDate,EndDate,UserId")] Rents rents)
|
||||
public async Task<IActionResult> Create([Bind("Id,Car.Id,StartDate,EndDate,UserId")] Rents rents)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
|
||||
@@ -43,15 +43,12 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
<input type="submit" value="Delete" class="btn btn-danger" />
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -49,6 +49,6 @@
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
<a type="button" class="btn btn-primary" asp-action="Edit" asp-route-id="@Model.Id">Edit</a>
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@@ -45,15 +45,12 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<a type="button" class="btn btn-primary" asp-action="Create">Add new car</a>
|
||||
}
|
||||
</p>
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@@ -35,9 +35,12 @@
|
||||
<th>
|
||||
Daily price
|
||||
</th>
|
||||
<th>
|
||||
Actions
|
||||
</th>
|
||||
@if (this.User.IsInRole("Admin"))
|
||||
{
|
||||
<th>
|
||||
Actions
|
||||
</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -3,11 +3,24 @@
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome, @User.Identity.Name</h1>
|
||||
<br />
|
||||
<a type="button" class="btn btn-primary" asp-area="" asp-controller="Cars" asp-action="Index">Manage cars</a>
|
||||
@if (this.User.IsInRole("Admin"))
|
||||
@if (this.User.Identity.Name != null)
|
||||
{
|
||||
<a type="button" class="btn btn-primary" asp-area="" asp-controller="Rents" asp-action="Index">Manage rents</a>
|
||||
<h1 class="display-4">Welcome, @User.Identity.Name</h1>
|
||||
<br />
|
||||
@if (this.User.IsInRole("Admin"))
|
||||
{
|
||||
<a type="button" class="btn btn-primary" asp-area="" asp-controller="Cars" asp-action="Index">Manage cars</a>
|
||||
<a type="button" class="btn btn-primary" asp-area="" asp-controller="Rents" asp-action="Index">Manage rents</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a type="button" class="btn btn-primary" asp-area="" asp-controller="Cars" asp-action="Index">See all cars</a>
|
||||
<a type="button" class="btn btn-primary" asp-area="" asp-controller="Rents" asp-action="Index">Rent a car</a>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<h1>Welcome to LuminousCars</h1>
|
||||
<h2>Please register or login to access the system.</h2>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -27,16 +27,12 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
@model Data.Entities.Rents
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "DateSelect";
|
||||
}
|
||||
|
||||
|
||||
<h1>Rent a car</h1>
|
||||
<h2>Select dates</h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<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="Findiew" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
@@ -51,6 +51,6 @@
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" />
|
||||
<a class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="submit" value="Save" />
|
||||
<a class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</p>
|
||||
@if (this.User.IsInRole("Admin"))
|
||||
{
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
|
||||
Reference in New Issue
Block a user