84 lines
2.3 KiB
Plaintext
84 lines
2.3 KiB
Plaintext
@using CORE.Data.DbModels
|
|
@using UI.Data
|
|
|
|
@inject IJSRuntime JSRuntime
|
|
@inject GpwDataService GDataServ
|
|
@inject MessageService AppMServ
|
|
|
|
<table class="table table-sm table-striped table-responsive-md">
|
|
<thead>
|
|
<tr>
|
|
<th><i class="far fa-clock"></i></th>
|
|
<th title="Entrata"><i class="fas fa-sign-in-alt"></i></th>
|
|
<th>Scambio</th>
|
|
<th title="Uscita"><i class="fas fa-sign-out-alt"></i></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListTimb)
|
|
{
|
|
<tr>
|
|
<td class="small">@item.DataOra.ToString("dd/MM - HH:mm")</td>
|
|
<td title="Entrata">
|
|
@if (@item.Entrata == true)
|
|
{
|
|
<i class="fas fa-times"></i>
|
|
}
|
|
</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-primary" title="Scambio IN/OUT" @onclick="() => ScambioInOut(item)"><i class="fas fa-exchange-alt"></i></button>
|
|
</td>
|
|
<td title="Uscita">
|
|
@if (@item.Entrata == false)
|
|
{
|
|
<i class="fas fa-times"></i>
|
|
}
|
|
</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-danger" @onclick="() => Delete(item)"><i class="fas fa-trash-alt"></i></button>
|
|
</td>
|
|
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
|
|
@code {
|
|
|
|
private List<TimbratureModel> _ListTimb { get; set; } = new List<TimbratureModel>();
|
|
|
|
[Parameter]
|
|
public List<TimbratureModel> ListTimb
|
|
{
|
|
get
|
|
{
|
|
return _ListTimb.OrderByDescending(x => x.DataOra).ToList();
|
|
}
|
|
set
|
|
{
|
|
_ListTimb = value;
|
|
InvokeAsync(() =>
|
|
{
|
|
StateHasChanged();
|
|
});
|
|
}
|
|
}
|
|
|
|
[Parameter]
|
|
public EventCallback<TimbratureModel> ReqDelete { get; set; }
|
|
|
|
[Parameter]
|
|
public EventCallback<TimbratureModel> ReqUpdate { get; set; }
|
|
|
|
protected async void Delete(TimbratureModel currRecord)
|
|
{
|
|
await ReqDelete.InvokeAsync(currRecord);
|
|
}
|
|
|
|
protected async void ScambioInOut(TimbratureModel currRecord)
|
|
{
|
|
await ReqUpdate.InvokeAsync(currRecord);
|
|
}
|
|
}
|