Movies are editable as well

This commit is contained in:
2019-01-23 20:22:25 +01:00
parent 11b51493fe
commit ecadd21228
16 changed files with 678 additions and 19 deletions

View File

@ -5,6 +5,7 @@
}
<h2>Movies</h2>
@Html.ActionLink("New Movie", "New", "Movies", null, new { @class = "btn btn-primary" })
@if (Model.Movies.Count == 0)
{
@ -12,21 +13,21 @@
}
else
{
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Movie</th>
<th>Genre</th>
</tr>
</thead>
<tbody>
@foreach (var movie in Model.Movies)
{
<tr>
<td>@Html.ActionLink(@movie.Name,"Movies","Movies",new { id = movie.Id },null) </td>
<td>@movie.MovieGenre.Name</td>
</tr>
}
</tbody>
</table>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Movie</th>
<th>Genre</th>
</tr>
</thead>
<tbody>
@foreach (var movie in Model.Movies)
{
<tr>
<td>@Html.ActionLink(@movie.Name, "Edit", "Movies", new { id = movie.Id }, null) </td>
<td>@movie.MovieGenre.Name</td>
</tr>
}
</tbody>
</table>
}