100 lines
4.7 KiB
Plaintext
100 lines
4.7 KiB
Plaintext
<div class="card">
|
|
<div class="card-header">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-2">
|
|
<h3>Macchine</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 />
|
|
<MachineEdit CurrRecord="CurrItem" EC_update="ForceReload"></MachineEdit>
|
|
}
|
|
</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>Macchina <Sorter ParamName="Name" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
|
|
<th>MainKey <Sorter ParamName="MainKey" 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.MachineID}")
|
|
</td>
|
|
<td class="@textCss(item.IsActive)">
|
|
@item.Name
|
|
</td>
|
|
<td class="@textCss(item.IsActive)">
|
|
@item.MainKey
|
|
</td>
|
|
@* <td class="@textCss(item.IsActive)">
|
|
@if(!item.HasDb)
|
|
{
|
|
<button class="btn btn-outline-danger" @onclick="() => CreateDb(item)" title="Create DB"><i class="fa-solid fa-database"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-outline-success" @onclick="() => CreateDb(item)" title="Check/Refresh DB"><i class="fa-solid fa-database"></i></button>
|
|
}
|
|
</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>
|
|
|
|
|