Files
2024-01-15 17:58:48 +01:00

93 lines
4.0 KiB
Plaintext

<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="px-2">
<h3>Chiavi</h3>
</div>
<div class="px-2">
@if (CustomerId > 0)
{
@if (CurrItem == null)
{
<button class="btn btn-success" @onclick="()=>CreateNew()"><i class="fa-solid fa-square-plus"></i> Add New</button>
}
else
{
<button class="btn btn-warning" @onclick="()=> DoEdit(null)"><i class="fa-solid fa-ban"></i> Cancel</button>
}
}
</div>
</div>
@if (CurrItem != null)
{
<hr />
<AuthKeyEdit CurrRecord="CurrItem" EC_update="ForceReload"></AuthKeyEdit>
}
</div>
<div class="card-body p-1">
@if (ListRecords == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-info">Nessun record trovato</div>
}
else
{
<table class="table table-striped table-sm text-start">
<thead>
<tr class="">
<th>
<button class="btn btn-primary btn-sm" @onclick="() => DoEdit(null)"><i class="fa-solid fa-rotate"></i></button>
</th>
<th>ID <Sorter ParamName="CustomerID" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Numero <Sorter ParamName="KeyName" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Seriale <Sorter ParamName="KeyValue" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Note <Sorter ParamName="Note" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Since <Sorter ParamName="DtActivation" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th class="text-end"></th>
</tr>
</thead>
<tbody>
@foreach (var item in ListRecords)
{
<tr class="align-middle @CheckSel(item)">
<td>
<button class="btn btn-primary btn-sm" @onclick="() => DoEdit(item)"><i class="fa-solid fa-edit"></i></button>
</td>
<td class="@textCss(item.IsActive)">
@($"{item.CustomerID}.{item.AuthKeyID}")
</td>
<td class="@textCss(item.IsActive)">
@item.KeyNum
</td>
<td class="@textCss(item.IsActive)">
@item.KeyValue
</td>
<td class="@textCss(item.IsActive)">
@item.Note
</td>
<td class="@textCss(item.IsActive)">
@($"{item.DtActivation:yyyy.MM.dd}")
</td>
<td class="text-end">
<button class="btn btn-sm btn-danger" @onclick="() => DeleteRecord(item)"><i class="fa-solid fa-trash-can"></i></button>
</td>
</tr>
}
</tbody>
</table>
}
</div>
<div class="card-footer">
<EgwCoreLib.Razor.DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading"></EgwCoreLib.Razor.DataPager>
</div>
</div>