Files

126 lines
6.0 KiB
Plaintext

@if (RecordEdit != null)
{
<div class="modal fade show" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" aria-modal="true" role="dialog" data-keyboard="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Modifica Orario <b>@RecordEdit.codOrario</b></h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="()=> ForceReload(true)"></button>
</div>
<div class="modal-body p-1">
<OrarioEdit CurrRecord=@RecordEdit EC_update=ForceReload></OrarioEdit>
</div>
</div>
</div>
</div>
}
<div class="card shadow">
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="px-0">
<h3>Gestione Orario</h3>
</div>
<div class="px-0">
<button class="btn btn-success" @onclick="AddNew"><i class="fas fa-plus"></i> Add New</button>
</div>
</div>
</div>
<div class="card-body p-1">
@if (ListRecords == null || isLoading)
{
<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="() => ForceReload(true)"><i class="fa-solid fa-rotate"></i></button>
</th>
<th>Cod <Sorter ParamName="Cod" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Descrizione <Sorter ParamName="Descrizione" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Lun</th>
<th>Mar</th>
<th>Mer</th>
<th>Gio</th>
<th>Ven</th>
<th>Sab</th>
<th>Dom</th>
<th>Ordin <Sorter ParamName="Ordin" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Straord <Sorter ParamName="Straord" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Comp <Sorter ParamName=">Comp" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Inizio 1</th>
<th>Fine 1</th>
<th>Inizio 2</th>
<th>Fine 2</th>
<th>Inizio 3</th>
<th>Fine 3</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in ListRecords)
{
<tr class="align-middle @CheckSel(item)">
<td>
@if (RecordEdit == null)
{
<button class="btn btn-primary btn-sm" @onclick="() => DoEdit(item)"><i class="fa-solid fa-edit"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-edit"></i></button>
}
</td>
<td>
<div class="fw-bold fs-5">
@item.codOrario
</div>
</td>
<td>
@item.descOrario
</td>
<td>@item.oreLun</td>
<td>@item.oreMar</td>
<td>@item.oreMer</td>
<td>@item.oreGio</td>
<td>@item.oreVen</td>
<td>@item.oreSab</td>
<td>@item.oreDom</td>
<td>@item.oreOrdSett</td>
<td>@item.oreStraordAss</td>
<td>
<input class="form-check-input" type="checkbox" disabled @bind="@item.autoCompOreOrd">
</td>
<td>@item.oraInizio1</td>
<td>@item.oraFine1</td>
<td>@item.oraInizio2</td>
<td>@item.oraFine2</td>
<td>@item.oraInizio3</td>
<td>@item.oraFine3</td>
<td>
@if (item.DipendentiNav == null || item.DipendentiNav.Count == 0)
{
<button class="btn btn-danger btn-sm" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm" disabled><i class="fa-solid fa-trash"></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>