Advertisement
Guest User

ThanosChris

a guest
Mar 31st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. @model PagedList.IPagedList<Champion.Entities.Director>
  2. @using PagedList;
  3. @using PagedList.Mvc;
  4.  
  5. <link href="~/Content/PagedList.css" rel="stylesheet" />
  6.  
  7. @{
  8. ViewBag.Title = "DirectorTable";
  9. }
  10.  
  11. <h1>Directors</h1>
  12.  
  13.  
  14. @Model.PageCount
  15. @Model.PageNumber
  16. @Model.PageSize
  17.  
  18.  
  19. Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
  20. @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 }))
  21.  
  22.  
  23. @using (Html.BeginForm("DirectorTable", "Director", FormMethod.Get))
  24. {
  25. @Html.TextBox("searchfirstname", null, new { placeholder = "Search FirstName" })
  26. @Html.TextBox("searchlastname", null, new { placeholder = "Search LastName" })
  27.  
  28.  
  29.  
  30. @Html.TextBox("searchminage", null, new { type = "number", placeholder = "Search Min Age" })
  31. @Html.TextBox("searchmaxage", null, new { type = "number", placeholder = "Search Max Age" })
  32. string str = ViewBag.CurrentSortOrder;
  33. @Html.TextBox("sortOrder", str, new { type = "hidden" })
  34.  
  35.  
  36.  
  37. <input type="submit" value="Search" />
  38. }
  39.  
  40. <table class="table">
  41. <thead>
  42. <tr>
  43. <th>Image</th>
  44. <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>
  45. <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>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. @foreach (var director in Model)
  50. {
  51. <tr>
  52. <td><a href="/Actor/SimpleDetails/@director.DirectorId"><img width="100" class="img-fluid" src="@director.PhotoUrl" alt="Leipei i eikona" /></a></td>
  53. <td>@Html.ActionLink(director.FirstName, "SimpleDetails", "Director", new { id = director.DirectorId }, null)</td>
  54. <td>@Html.DisplayFor(x => director.LastName)</td>
  55. <td>@director.Age</td>
  56. <td>
  57. <ul>
  58. @foreach (var movie in director.Movies)
  59. {
  60. <li>@movie.Title</li>
  61. }
  62. </ul>
  63. </td>
  64. <td>@Html.ActionLink("Details", "SimpleDetails", "Director", new { id = director.DirectorId }, new { @class = "btn btn-primary" })</td>
  65. </tr>
  66. }
  67. </tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement