Advertisement
Guest User

Untitled

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