restructured filetree
This commit is contained in:
committed by
Chris
parent
dcbed24638
commit
b837e1aad2
36
Views/Authors/Add.cshtml
Normal file
36
Views/Authors/Add.cshtml
Normal file
@@ -0,0 +1,36 @@
|
||||
@model Author
|
||||
|
||||
@{
|
||||
ViewBag.Title = "title";
|
||||
Layout = "_Layout";
|
||||
}
|
||||
|
||||
<h2>Add / edit author</h2>
|
||||
|
||||
<form method="post">
|
||||
<div class="row mb-3">
|
||||
<label asp-for="FirstName" class="col-sm-2 col-form-label"></label>
|
||||
<div class="col-sm-3">
|
||||
<input asp-for="FirstName" class="form-control">
|
||||
<span asp-validation-for="FirstName" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label asp-for="LastName" class="col-sm-2 col-form-label"></label>
|
||||
<div class="col-sm-3">
|
||||
<input asp-for="LastName" class="form-control">
|
||||
<span asp-validation-for="LastName" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label asp-for="Birthdate" class="col-sm-2 col-form-label"></label>
|
||||
<div class="col-sm-3">
|
||||
<input asp-for="Birthdate" class="form-control">
|
||||
<span asp-validation-for="Birthdate" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Save">
|
||||
</form>
|
||||
23
Views/Authors/Index.cshtml
Normal file
23
Views/Authors/Index.cshtml
Normal file
@@ -0,0 +1,23 @@
|
||||
@model IEnumerable<Author>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "title";
|
||||
Layout = "_Layout";
|
||||
}
|
||||
|
||||
<h2>Authors</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
@foreach (var author in Model)
|
||||
{
|
||||
<li>
|
||||
@author.FirstName @author.LastName |
|
||||
<a asp-controller="Authors" asp-action="Edit" asp-route-id="@author.Id">Edit</a> |
|
||||
<a asp-controller="Authors" asp-action="Delete" asp-route-id="@author.Id">Delete</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
</ul>
|
||||
|
||||
<p><a asp-controller="Authors" asp-action="Add">Add new Author</a></p>
|
||||
Reference in New Issue
Block a user