Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model PagedList.IPagedList<Champion.Entities.Director>
- @using PagedList;
- @using PagedList.Mvc;
- <link href="~/Content/PagedList.css" rel="stylesheet" />
- @{
- ViewBag.Title = "DirectorTable";
- }
- <h1>Directors</h1>
- @Model.PageCount
- @Model.PageNumber
- @Model.PageSize
- Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
- @Html.PagedListPager(Model, x => @Url.Action("DirectorTable", "Director", new { page = x, sortOrder = ViewBag.CurrentSortOrder, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName, searchminage = ViewBag.CurrentMinAge, searchmaxage = ViewBag.CurrentMaxAge }))
- @using (Html.BeginForm("DirectorTable", "Director", FormMethod.Get))
- {
- @Html.TextBox("searchfirstname", null, new { placeholder = "Search FirstName" })
- @Html.TextBox("searchlastname", null, new { placeholder = "Search LastName" })
- @Html.TextBox("searchminage", null, new { type = "number", placeholder = "Search Min Age" })
- @Html.TextBox("searchmaxage", null, new { type = "number", placeholder = "Search Max Age" })
- string str = ViewBag.CurrentSortOrder;
- @Html.TextBox("sortOrder", str, new { type = "hidden" })
- <input type="submit" value="Search" />
- }
- <table class="table">
- <thead>
- <tr>
- <th>Image</th>
- <th>@Html.ActionLink("First Name", "DirectorTable", "Director", new { sortOrder = ViewBag.FirstNameSortParam, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName, searchminage = ViewBag.CurrentMinAge, searchmaxage = ViewBag.CurrentMaxAge }, new { @class = ViewBag.FNView })</th>
- <th>@Html.ActionLink("Last Name", "DirectorTable", "Director", new { sortOrder = ViewBag.LastNameSortParam, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName, searchminage = ViewBag.CurrentMinAge, searchmaxage = ViewBag.CurrentMaxAge }, new { @class = ViewBag.LNView })</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var director in Model)
- {
- <tr>
- <td><a href="/Actor/SimpleDetails/@director.DirectorId"><img width="100" class="img-fluid" src="@director.PhotoUrl" alt="Leipei i eikona" /></a></td>
- <td>@Html.ActionLink(director.FirstName, "SimpleDetails", "Director", new { id = director.DirectorId }, null)</td>
- <td>@Html.DisplayFor(x => director.LastName)</td>
- <td>@director.Age</td>
- <td>
- <ul>
- @foreach (var movie in director.Movies)
- {
- <li>@movie.Title</li>
- }
- </ul>
- </td>
- <td>@Html.ActionLink("Details", "SimpleDetails", "Director", new { id = director.DirectorId }, new { @class = "btn btn-primary" })</td>
- </tr>
- }
- </tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement