Min lösning på övningen
This commit is contained in:
10
Vidly/Views/Customers/Customer.cshtml
Normal file
10
Vidly/Views/Customers/Customer.cshtml
Normal file
@ -0,0 +1,10 @@
|
||||
@model Vidly.Models.Customer
|
||||
@{
|
||||
ViewBag.Title = "Customer";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
<h2>Customer</h2>
|
||||
|
||||
<h1>@Model.Name - @Model.Id</h1>
|
||||
|
||||
23
Vidly/Views/Customers/Customers.cshtml
Normal file
23
Vidly/Views/Customers/Customers.cshtml
Normal file
@ -0,0 +1,23 @@
|
||||
@model Vidly.ViewModels.CustomersViewModel
|
||||
@{
|
||||
ViewBag.Title = "Customers";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
<h2>Customers</h2>
|
||||
|
||||
@if (Model.Customers.Count == 0)
|
||||
{
|
||||
<text>No one has rented this movie before.</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ul>
|
||||
@foreach (var customer in Model.Customers)
|
||||
{
|
||||
@*<li>@customer.Name</li>*@
|
||||
<li>@Html.ActionLink(@customer.Name, "Details", "Customers", new { id = @customer.Id },null)</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
}
|
||||
11
Vidly/Views/Customers/Index.cshtml
Normal file
11
Vidly/Views/Customers/Index.cshtml
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Vidly";
|
||||
}
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>V i d l y</h1>
|
||||
<p class="lead">Vidly is a great video rental system built in MVC5 with entity framework, Razorviews and Javascript.</p>
|
||||
@*<p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>*@
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user