39 lines
914 B
Plaintext
39 lines
914 B
Plaintext
@using CORE.Data.DbModels
|
|
@using UI.Data
|
|
@inject GpwDataService GDataServ
|
|
|
|
<button @onclick="() => AddNew()" class="px-1 text-center btn btn-lg btn-outline-success" >
|
|
<i class="fas fa-plus-circle"></i>
|
|
</button>
|
|
|
|
@code {
|
|
|
|
|
|
[Parameter]
|
|
public DateTime InizioPer { get; set; } = DateTime.Today.AddHours(8);
|
|
|
|
[Parameter]
|
|
public int IdxDip { get; set; } = 0;
|
|
|
|
[Parameter]
|
|
public EventCallback<RegAttivitaModel> NewItemCreated { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indico item selezionato
|
|
/// </summary>
|
|
protected async void AddNew()
|
|
{
|
|
// creo NUOVO record da dateStart...
|
|
|
|
RegAttivitaModel newItem = new RegAttivitaModel()
|
|
{
|
|
Inizio = InizioPer,
|
|
IdxDipendente = IdxDip,
|
|
Fine = InizioPer.AddMinutes(30)
|
|
};
|
|
// riporto!
|
|
await NewItemCreated.InvokeAsync(newItem);
|
|
}
|
|
|
|
}
|