-
Notifications
You must be signed in to change notification settings - Fork 46
/
Products.cshtml
40 lines (40 loc) · 1011 Bytes
/
Products.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@using Google.Protobuf.Collections
@using Northwind.Grpc.Client.Mvc
@model RepeatedField<ProductReply>
@{
ViewData["Title"] = "Products";
decimal price = 0;
}
<h1>@ViewData["Title"]</h1>
<form asp-action="Products" method="post">
<input name="minimumPrice" placeholder="Enter a minimum unit price" />
<input type="submit" value="Filter Products" />
</form>
<table class="table table-bordered">
<thead>
<tr>
<th>Product ID</th>
<th>Product Name</th>
<th>Unit Price</th>
<th>Units In Stock</th>
<th>Units On Order</th>
<th>Reorder Level</th>
<th>Discontinued</th>
</tr>
</thead>
<tbody>
@foreach (ProductReply p in Model)
{
<tr>
<td>@p.ProductId</td>
<td>@p.ProductName</td>
@{ price = p.UnitPrice; }
<td>@price.ToString("C")</td>
<td>@p.UnitsInStock</td>
<td>@p.UnitsOnOrder</td>
<td>@p.ReorderLevel</td>
<td>@p.Discontinued</td>
</tr>
}
</tbody>
</table>