Movies included in database as well and handled in site

This commit is contained in:
2019-01-21 20:52:22 +01:00
parent 19fc2475fa
commit f5a597fcdb
33 changed files with 1418 additions and 59 deletions

View File

@ -8,3 +8,11 @@
<h1>@Model.Name - @Model.Id</h1>
<ul >
<li>Membership Type: @Model.MembershipType.Name</li>
@if (Model.BirthDate != null)
{
<li>Birthdate : @Model.BirthDate.Value.ToShortDateString()</li>
}
</ul>

View File

@ -16,7 +16,7 @@ else
<thead>
<tr>
<th>Customer</th>
<th >Discount Rate</th>
<th >Membership Type</th>
</tr>
</thead>
<tbody>
@ -24,7 +24,7 @@ else
{
<tr>
<td>@Html.ActionLink(@customer.Name, "Details", "Customers", new { id = @customer.Id }, null)</td>
<td>@customer.MembershipType.DiscountRate%</td>
<td>@customer.MembershipType.Name</td>
</tr>
}
</tbody>

View File

@ -0,0 +1,17 @@
@model Vidly.Models.Movie
@{
ViewBag.Title = "Movie";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Movie</h2>
<h1>@Model.Name - @Model.Id</h1>
<ul>
<li>Genre: @Model.MovieGenre.Name</li>
<li>Release Date: @Model.ReleaseDate.DayOfWeek,@Model.ReleaseDate.ToLongDateString()</li>
<li>Date Added: @Model.DateAdded.DayOfWeek,@Model.DateAdded.ToLongDateString()</li>
<li>Number in Stock: @Model.NumberInStock</li>
</ul>

View File

@ -12,12 +12,21 @@
}
else
{
<ul>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Movie</th>
<th>Genre</th>
</tr>
</thead>
<tbody>
@foreach (var movie in Model.Movies)
{
<li>@movie.Name</li>
@*<li>@Html.ActionLink(@customer.Name, "Details", "Customers", new { id = @customer.Id }, null)</li>*@
<tr>
<td>@Html.ActionLink(@movie.Name,"Movies","Movies",new { id = movie.Id },null) </td>
<td>@movie.MovieGenre.Name</td>
</tr>
}
</ul>
</tbody>
</table>
}