Files
moadiran/TaxPayerFull/Layout/LQuestion.razor

71 lines
2.2 KiB
Plaintext
Raw Normal View History

2024-04-03 17:07:18 +03:30
@using Shared.DTOs
@inject HttpClient _hc
@inject NavigationManager Navigation
2024-04-04 18:14:01 +03:30
2024-04-05 21:03:40 +03:30
<div class="tp-faq-area pt-50" id="Question">
2024-04-03 17:07:18 +03:30
<div class="container p-0">
<div class="row g-0">
<div class="col-xl-12">
2024-04-04 18:14:01 +03:30
<div class="popular-blog-title mb-40">
<h4>سوالات پر تکرار</h4>
</div>
2024-04-03 17:07:18 +03:30
<div class="tp-custom-accordion">
2024-09-11 16:39:44 +03:30
<div class="accordion" id="accordionExample">
2024-04-04 18:14:01 +03:30
@for (int i = 0; i < request?.list.Count; i++)
2024-04-03 17:07:18 +03:30
{
2024-09-11 16:39:44 +03:30
2024-04-04 18:14:01 +03:30
<ItemQuestion qitem="request?.list[i]" />
2024-04-03 17:07:18 +03:30
}
2024-04-04 18:14:01 +03:30
@*
@foreach (var item in request?.list)
{
<ItemQuestion Item="item" />
} *@
2024-04-03 17:07:18 +03:30
</div>
</div>
</div>
</div>
2024-04-04 18:14:01 +03:30
</div>
<br />
2024-09-12 23:17:21 +03:30
@if (request!=null)
{
<div class="container">
2024-04-03 17:07:18 +03:30
2024-09-12 23:17:21 +03:30
<Pagination TotalPages=@request.PageCount
ActivePageNumber="@PageIndex"
PageChanged="OnPageChangedAsync"
Alignment="Alignment.Center"
FirstLinkIcon="IconName.ChevronDoubleRight"
PreviousLinkIcon="IconName.ChevronRight"
NextLinkIcon="IconName.ChevronLeft"
LastLinkIcon="IconName. ChevronDoubleLeft" />
</div>
}
2024-04-03 17:07:18 +03:30
</div>
@code {
2024-04-04 18:14:01 +03:30
[Parameter]
public int PageIndex { get; set; }
2024-04-03 17:07:18 +03:30
2024-04-04 18:14:01 +03:30
public Shared.DTOs.PagingDto<QuestionDto>? request { get; set; }
2024-09-12 23:17:21 +03:30
private async Task OnPageChangedAsync(int newPageNumber)
{
request = await _hc.GetFromJsonAsync<PagingDto<QuestionDto>>($"Base/LastQuestion?PageIndex={newPageNumber}&PageSize=5");
2024-04-04 18:14:01 +03:30
2024-09-12 23:17:21 +03:30
await Task.Run(() => { PageIndex = newPageNumber; });
}
2024-04-04 18:14:01 +03:30
protected override async Task OnParametersSetAsync()
{
2024-09-12 23:17:21 +03:30
request = await _hc.GetFromJsonAsync<PagingDto<QuestionDto>>($"Base/LastQuestion?PageIndex={PageIndex}&PageSize=5");
2024-04-04 18:14:01 +03:30
await base.OnParametersSetAsync();
}
2024-04-03 17:07:18 +03:30
}