b1afa82a91
- GpwDataSrvice - MessageService - ogni dipendenza (aggiunti using, in _import non basta...)
76 lines
1.8 KiB
C#
76 lines
1.8 KiB
C#
using GPW.CORE.Data.DTO;
|
|
using GPW.CORE.Data.Services;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.JSInterop;
|
|
|
|
namespace GPW.CORE.WRKLOG.Components.Compo
|
|
{
|
|
public partial class PeriodoLav
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public PeriodoDTO CurrPeriodo { get; set; } = null!;
|
|
|
|
[Parameter]
|
|
public string FontSize { get; set; } = "0.7em";
|
|
|
|
[Parameter]
|
|
public EventCallback<PeriodoDTO> ItemSelected { get; set; }
|
|
|
|
[Parameter]
|
|
public double Periodo { get; set; } = 1;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected MessageService AppMServ { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected GpwDataService GDataServ { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected IJSRuntime JSRuntime { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Private Properties
|
|
|
|
private string blockCss
|
|
{
|
|
get
|
|
{
|
|
string answ = CurrPeriodo.Tipo == CORE.Data.TipoPeriodo.ND ? "" : " border border-success bg-dark text-light rounded ";
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
private string widthPerc
|
|
{
|
|
get
|
|
{
|
|
string answ = "1%";
|
|
if (CurrPeriodo != null)
|
|
{
|
|
double num = CurrPeriodo.OreTot != null ? (double)CurrPeriodo.OreTot : 0;
|
|
answ = $"{num / Periodo:P2}".Replace(",", ".");
|
|
}
|
|
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private async void Edit()
|
|
{
|
|
await ItemSelected.InvokeAsync(CurrPeriodo);
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |