Advertisement
Guest User

DirectorTable

a guest
Mar 31st, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 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. ViewBag.Title = "Directors Table";
  8. }
  9.  
  10. <h1>Directors</h1>
  11.  
  12. <p></p>
  13. Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
  14. @Html.PagedListPager(Model, x => @Url.Action("DirectorTable", "Director", new { page = x, sortOrder = ViewBag.CurrentSortOrder, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName}))
  15. @using (Html.BeginForm("DirectorTable", "Director", FormMethod.Get))
  16. {
  17. <!--Same exact way of creating form-->
  18. <!--<input type="text" name="searchfirstname" value="" placeholder="Search FirstName" />-->
  19. @Html.TextBox("searchfirstname", null, new { placeholder = "Search FirstName" })
  20. @Html.TextBox("searchlastname", null, new { placeholder = "Search LastName" })
  21.  
  22. string str = ViewBag.CurrentSortOrder;
  23.  
  24. @Html.TextBox("sortOrder", str, new { type = "hidden" })
  25. <input type="submit" value="Anazitisi" />
  26. }
  27.  
  28. <table class="table">
  29. <thead>
  30. <tr>
  31. <th>Image</th>
  32. <th>@Html.ActionLink("First Name", "DirectorTable", "Director", new { sortOrder = ViewBag.FirstNameSortParam, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName}, new { @class = ViewBag.FNView })</th>
  33. <th>@Html.ActionLink("Last Name", "DirectorTable", "Director", new { sortOrder = ViewBag.LastNameSortParam, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName }, new { @class = ViewBag.LNView })</th>
  34. <th>@Html.ActionLink("Age", "DirectorTable", "Director", new { sortOrder = ViewBag.AgeSortParam, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName }, new { @class = ViewBag.AGView })</th>
  35. <th>@Html.ActionLink("Details", "DirectorTable", "Director", new { sortOrder = ViewBag.DetailsSortParam, searchfirstname = ViewBag.CurrentFirstName, searchlastname = ViewBag.CurrentLastName}, new { @class = ViewBag.DTView })</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. @foreach (var Director in Model)
  40. {
  41. <tr>
  42. <td><a href="/Director/SimpleDetails/@Director.DirectorId"><img width="100" class="img-fluid" src="@Director.PhotoUrl" alt="Leipei i eikona" /></a></td>
  43. <td>@Html.ActionLink(Director.FirstName, "SimpleDetails", "Director", new { id = Director.DirectorId }, null)</td>
  44. <td>@Html.DisplayFor(x => Director.LastName)</td>
  45. <td>@Director.Age</td>
  46. <td>
  47. <ul>
  48. @foreach (var movie in Director.Movies)
  49. {
  50. <li>@movie.Title</li>
  51. }
  52. </ul>
  53. </td>
  54. <td>@Html.ActionLink("Details", "SimpleDetails", "Director", new { id = Director.DirectorId }, new { @class = "btn btn-primary" })</td>
  55. </tr>
  56. }
  57.  
  58.  
  59.  
  60. </tbody>
  61.  
  62. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement