|
1 | 1 | @model IEnumerable<MvcMovie.Models.Movie>
|
2 |
| - |
3 | 2 | @{
|
4 | 3 | ViewBag.Title = "Index";
|
5 | 4 | }
|
6 |
| - |
7 | 5 | <h2>Index</h2>
|
8 |
| - |
9 | 6 | <p>
|
10 | 7 | @Html.ActionLink("Create New", "Create")
|
11 |
| -</p> |
12 |
| -<table class="table"> |
13 |
| - <tr> |
14 |
| - <th> |
15 |
| - @Html.DisplayNameFor(model => model.Title) |
16 |
| - </th> |
17 |
| - <th> |
18 |
| - @Html.DisplayNameFor(model => model.ReleaseDate) |
19 |
| - </th> |
20 |
| - <th> |
21 |
| - @Html.DisplayNameFor(model => model.Genre) |
22 |
| - </th> |
23 |
| - <th> |
24 |
| - @Html.DisplayNameFor(model => model.Price) |
25 |
| - </th> |
26 |
| - <th></th> |
27 |
| - </tr> |
| 8 | + @using (Html.BeginForm("Index", "Movies", FormMethod.Get)) |
| 9 | + { |
| 10 | + <p> |
| 11 | + Genre: @Html.DropDownList("movieGenre", "All") |
| 12 | + Title: @Html.TextBox("SearchString") |
| 13 | + <input type="submit" value="Filter" /> |
| 14 | + </p> |
| 15 | + } |
| 16 | + </p> |
| 17 | + <table class="table"> |
| 18 | + <tr> |
| 19 | + <th> |
| 20 | + @Html.DisplayNameFor(model => model.Title) |
| 21 | + </th> |
| 22 | + <th> |
| 23 | + @Html.DisplayNameFor(model => model.ReleaseDate) |
| 24 | + </th> |
| 25 | + <th> |
| 26 | + @Html.DisplayNameFor(model => model.Genre) |
| 27 | + </th> |
| 28 | + <th> |
| 29 | + @Html.DisplayNameFor(model => model.Price) |
| 30 | + </th> |
| 31 | + <th></th> |
| 32 | + </tr> |
28 | 33 |
|
29 |
| -@foreach (var item in Model) { |
30 |
| - <tr> |
31 |
| - <td> |
32 |
| - @Html.DisplayFor(modelItem => item.Title) |
33 |
| - </td> |
34 |
| - <td> |
35 |
| - @Html.DisplayFor(modelItem => item.ReleaseDate) |
36 |
| - </td> |
37 |
| - <td> |
38 |
| - @Html.DisplayFor(modelItem => item.Genre) |
39 |
| - </td> |
40 |
| - <td> |
41 |
| - @Html.DisplayFor(modelItem => item.Price) |
42 |
| - </td> |
43 |
| - <td> |
44 |
| - @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | |
45 |
| - @Html.ActionLink("Details", "Details", new { id=item.ID }) | |
46 |
| - @Html.ActionLink("Delete", "Delete", new { id=item.ID }) |
47 |
| - </td> |
48 |
| - </tr> |
49 |
| -} |
| 34 | + @foreach (var item in Model) |
| 35 | + { |
| 36 | + <tr> |
| 37 | + <td> |
| 38 | + @Html.DisplayFor(modelItem => item.Title) |
| 39 | + </td> |
| 40 | + <td> |
| 41 | + @Html.DisplayFor(modelItem => item.ReleaseDate) |
| 42 | + </td> |
| 43 | + <td> |
| 44 | + @Html.DisplayFor(modelItem => item.Genre) |
| 45 | + </td> |
| 46 | + <td> |
| 47 | + @Html.DisplayFor(modelItem => item.Price) |
| 48 | + </td> |
| 49 | + <td> |
| 50 | + @Html.ActionLink("Edit", "Edit", new { id = item.ID }) | |
| 51 | + @Html.ActionLink("Details", "Details", new { id = item.ID }) | |
| 52 | + @Html.ActionLink("Delete", "Delete", new { id = item.ID }) |
| 53 | + </td> |
| 54 | + </tr> |
| 55 | + } |
50 | 56 |
|
51 |
| -</table> |
| 57 | + </table> |
0 commit comments