66 lines
2.4 KiB
Plaintext
66 lines
2.4 KiB
Plaintext
![]() |
@using Shared.DTOs;
|
||
|
@using Front.Services
|
||
|
@inject HttpClientController hc;
|
||
|
<div class="mb-3 row">
|
||
|
<div class="col-md-10">
|
||
|
<InputText @bind-Value="@Value" onclick="" style="text-align:center;" class="form-control" placeholder="دنبال چی ؟" id="html5-password-input3" />
|
||
|
</div> <div class="col-md-2">
|
||
|
<button onclick="" type="submit" class="btn btn-primary">ارسال</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="col-md-12">
|
||
|
<Grid TItem="stuffDto" class="table table-hover table-bordered table-striped" DataProvider="DataProvider" AllowFiltering="true" Responsive="true" AllowPaging="true" PageSize="5">
|
||
|
<GridColumn TItem="stuffDto" HeaderText="شناسه" PropertyName="Id">
|
||
|
@context.ID
|
||
|
</GridColumn>
|
||
|
<GridColumn TItem="stuffDto" HeaderText="نوع شناسه کالا" PropertyName="Type" StringComparison="StringComparison.Ordinal">
|
||
|
@context.Type
|
||
|
</GridColumn>
|
||
|
<GridColumn TItem="stuffDto" HeaderText="مشمول یا معاف" PropertyName="TaxableOrFree">
|
||
|
@context.TaxableOrFree
|
||
|
</GridColumn>
|
||
|
<GridColumn TItem="stuffDto" HeaderText="نرخ ارزش افزوده" PropertyName="Vat">
|
||
|
@context.Vat
|
||
|
</GridColumn>
|
||
|
@* <GridColumn TItem="stuffDto" HeaderText="نرخ ارزش افزوده مبادی گمرکی" PropertyName="VatCustomPurposes">
|
||
|
@context.VatCustomPurposes
|
||
|
</GridColumn> *@
|
||
|
<GridColumn TItem="stuffDto" HeaderText="شرح شناسه کالا" PropertyName="DescriptionOfID">
|
||
|
@context.DescriptionOfID
|
||
|
</GridColumn>
|
||
|
</Grid>
|
||
|
</div>
|
||
|
</div>
|
||
|
@code {
|
||
|
private IEnumerable<stuffDto> stuffDtos;
|
||
|
public string Value { get; set; }
|
||
|
protected override void OnInitialized()
|
||
|
{
|
||
|
stuffDtos = new List<stuffDto>();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
@functions {
|
||
|
public async Task Search()
|
||
|
{
|
||
|
if (!string.IsNullOrEmpty(Value))
|
||
|
{
|
||
|
var rsp = await hc.Get($"stuff/Getstuff/{Value}");
|
||
|
if (rsp.IsSuccessStatusCode)
|
||
|
{
|
||
|
stuffDtos = await rsp.Content.ReadFromJsonAsync<List<stuffDto>>();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
private async Task<GridDataProviderResult<stuffDto>> DataProvider(GridDataProviderRequest<stuffDto> request)
|
||
|
{
|
||
|
return await Task.FromResult(request.ApplyTo(stuffDtos));
|
||
|
}
|
||
|
}
|