Seasonal.cshtml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. @model economy.Models.View<economy.Models.Days.Seasonal.Request, economy.Models.Days.Seasonal.Response>
  2. @{
  3. ViewData["Title"] = "24절기";
  4. }
  5. <div class="container">
  6. <h3>24절기</h3>
  7. @await Html.PartialAsync("NavTab")
  8. <div class="row mt-3">
  9. <div class="col align-self-center">
  10. @((Model?.Response?.Body?.TotalCount ?? 0).ToString("N0")) 개
  11. </div>
  12. <div class="col-auto">
  13. @{
  14. var years = ViewData["years"] as IEnumerable<int> ?? Enumerable.Empty<int>();
  15. }
  16. <select name="year" id="year" class="form-select" form="fSearch">
  17. @foreach (var year in years)
  18. {
  19. if (year == Model.Request?.Year)
  20. {
  21. <option value="@year" selected="selected">@year</option>
  22. }
  23. else
  24. {
  25. <option value="@year">@year</option>
  26. }
  27. }
  28. </select>
  29. </div>
  30. </div>
  31. <div class="table-responsive">
  32. <table id="daySeasonal" class="table table-bordered table-hover">
  33. <caption class="caption-top">
  34. </caption>
  35. <thead>
  36. <tr>
  37. <th>번호</th>
  38. <th>날짜</th>
  39. <th>종류</th>
  40. <th>명칭</th>
  41. <th>공공기간 휴일 여부</th>
  42. <th>한국표준시간</th>
  43. <th>태양황경(도)</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. @if (Model.Response.Body != null && Model.Response.Body?.TotalCount > 0)
  48. {
  49. @foreach (var row in Model.Response.Body.Items.ItemList)
  50. {
  51. <tr>
  52. <td>@row.Num</td>
  53. <td>@row.LocDate</td>
  54. <td>@row.DateKind</td>
  55. <td>@row.DateName</td>
  56. <td>@row.IsHoliday</td>
  57. <td>@row.Kst</td>
  58. <td>@row.SunLongitude</td>
  59. </tr>
  60. }
  61. }
  62. else
  63. {
  64. <tr>
  65. <td colspan="7">
  66. No data.
  67. </td>
  68. </tr>
  69. }
  70. </tbody>
  71. </table>
  72. </div>
  73. <form id="fSearch" method="get" accept-charset="UTF-8" rel="search" autocomplete="off" asp-controller="Day" asp-action="Seasonal"></form>
  74. </div>
  75. @section Scripts {
  76. <script src="~/js/day.js" asp-append-version="true"></script>
  77. }
  78. @section Styles {
  79. <link href="~/css/style.css" rel="stylesheet" asp-append-version="true" />
  80. }