145 lines
6.0 KiB
Plaintext
145 lines
6.0 KiB
Plaintext
@if (isLoading)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else
|
|
{ @if (isSendingData)
|
|
{
|
|
<ProgressDisplay Title="Salvataggio ed invio richiesta" CurrVal="@sendDataVal" NextVal="@sendDataNextVal" MaxVal="@sendDataMaxVal" ExpTimeMSec="1000"></ProgressDisplay>
|
|
}
|
|
@if (ListRecords == null)
|
|
{
|
|
<LoadingData DisplaySize="LoadingData.CtrlSize.Small"></LoadingData>
|
|
}
|
|
else
|
|
{
|
|
@if (showAdd)
|
|
{
|
|
<ul class="list-group">
|
|
<li class="list-group-item">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-0">
|
|
<b>Data</b>
|
|
</div>
|
|
<div class="px-2">
|
|
<input type="date" class="form-control text-end" @bind="@currRecord.data">
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<li class="list-group-item">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-0">
|
|
<b>Giust</b>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group input-group-sm">
|
|
<select @bind="@currRecord.codGiust" class="form-select">
|
|
<option value="">--- Selezionare Causale ---</option>
|
|
@if (ListGiust != null)
|
|
{
|
|
@foreach (var giust in ListGiust)
|
|
{
|
|
<option value="@giust.codGiust">@giust.descrizione</option>
|
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<li class="list-group-item">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-0">
|
|
<b>Descrizione</b>
|
|
</div>
|
|
<div class="px-2">
|
|
<input class="form-control form-control-sm small" @bind="@currRecord.descrizione"></input>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
@* <li class="list-group-item">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-0">
|
|
<b>Stato</b>
|
|
<span class="small">(confermato)</span>
|
|
</div>
|
|
<div class="px-0">
|
|
<div class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" role="switch" @bind="@currRecord.Conf">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li> *@
|
|
<li class="list-group-item">
|
|
<div class="row">
|
|
<div class="col">
|
|
<button class="btn btn-warning w-100" @onclick="ToggleEdit"><i class="fas fa-window-close"></i> Cancel</button>
|
|
</div>
|
|
<div class="col">
|
|
@if (!string.IsNullOrEmpty(currRecord.codGiust))
|
|
{
|
|
<button class="btn btn-success w-100" @onclick="() => DoSave()"><i class="far fa-save"></i> Update</button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-secondary w-100" disabled><i class="far fa-save"></i> Update</button>
|
|
}
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
}
|
|
@if (ListRecords.Count == 0)
|
|
{
|
|
<div class="alert alert-warning">
|
|
<h4>Nessu record registrato!</h4>
|
|
<button class="btn btn-success btn-sm" @onclick="() => ToggleEdit()"><i class="fas fa-plus"></i> Inserisci Malattia</button>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<table class="table table-sm table-striped table-responsive-md border border-dark">
|
|
<thead>
|
|
<tr class="bg-dark text-light">
|
|
<th>
|
|
<button class="btn btn-success btn-sm" @onclick="() => AddNew()"><i class="fas fa-plus"></i></button>
|
|
</th>
|
|
<th>Data</th>
|
|
<th class="text-center">Tipo</th>
|
|
<th class="text-end">Descrizione</th>
|
|
<th class="text-end"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListRecords)
|
|
{
|
|
<tr>
|
|
<td>
|
|
<button class="btn btn-primary btn-sm" @onclick="() => DoEdit(item)"><i class="fas fa-pen"></i></button>
|
|
</td>
|
|
<td class="text-nowrap">
|
|
@($"{item.data:yyyy-MM-dd dddd}")
|
|
</td>
|
|
<td>
|
|
@item.codGiust
|
|
</td>
|
|
<td class="text-center">
|
|
@item.descrizione
|
|
</td>
|
|
<td class="text-end">
|
|
<button class="btn btn-danger btn-sm" @onclick="() => DoDelete(item)"><i class="fas fa-trash-alt"></i></button>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
|
|
<div>
|
|
<EgwCoreLib.Razor.DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading" NumPages="10" PageSizeList="@PageSizeListSpec"></EgwCoreLib.Razor.DataPager>
|
|
</div>
|
|
}
|
|
}
|
|
}
|
|
|
|
|