Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 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 = "Directors Table";
  9. }
  10.  
  11. <h1>Directors</h1>
  12.  
  13.  
  14. <p></p>
  15. Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
  16. @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 }))
  17.  
  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. string str = ViewBag.CurrentSortOrder;
  26. @Html.TextBox("sortOrder", str, new { type = "hidden" })
  27.  
  28. <input type="submit" value="Anazitisi" />
  29.  
  30. }
  31.  
  32. <table class="table">
  33. <thead>
  34. <tr>
  35. <th>Image</th>
  36. <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>
  37. <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>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. @foreach (var director in Model)
  42. {
  43. <tr>
  44. <td><a href="/Director/SimpleDetails/@director.DirectorId"><img width="100" class="img-fluid" src="@director.PhotoUrl" alt="Leipei i eikona" /></a></td>
  45. <td>@Html.ActionLink(director.FirstName, "SimpleDetails", "Director", new { id = director.DirectorId }, null)</td>
  46. <td>@Html.DisplayFor(x => director.LastName)</td>
  47. <td>@Html.ActionLink("Details", "SimpleDetails", "Director", new { id = director.DirectorId }, new { @class = "btn btn-primary" })</td>
  48. </tr>
  49. }
  50.  
  51.  
  52.  
  53. </tbody>
  54.  
  55. </table>
  56.  
  57.  
  58. @*@foreach (var director in Model)
  59. {
  60. @Html.ActionLink(director.FirstName, "SimpleDetails", "Director", new { id = director.DirectorId}, null)
  61.  
  62. <p></p>
  63. }*@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement