Update x fix timbrature giorni prec + refresh
This commit is contained in:
@@ -92,7 +92,10 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
public List<AnagFasiModel> ListFasi { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<List<TimbratureModel>?> PeriodSelected { get; set; }
|
||||
public EventCallback<DailyDataDTO> PeriodSelected { get; set; }
|
||||
#if false
|
||||
//public EventCallback<List<TimbratureModel>?> PeriodSelected { get; set; }
|
||||
#endif
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<DailyDataDTO> ReqDayAgenda { get; set; }
|
||||
@@ -123,7 +126,10 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
{
|
||||
if (DayDTO != null)
|
||||
{
|
||||
await PeriodSelected.InvokeAsync(DayDTO.ListTimbr);
|
||||
await PeriodSelected.InvokeAsync(DayDTO);
|
||||
#if false
|
||||
//await PeriodSelected.InvokeAsync(DayDTO.ListTimbr);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +177,10 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
{
|
||||
if (DayDTO != null)
|
||||
{
|
||||
await PeriodSelected.InvokeAsync(DayDTO.ListTimbr);
|
||||
await PeriodSelected.InvokeAsync(DayDTO);
|
||||
#if false
|
||||
//await PeriodSelected.InvokeAsync(DayDTO.ListTimbr);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,50 +7,6 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
{
|
||||
public partial class TimbrEditor
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
protected bool vetoUpd = false;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private MessageService AppMServ { get; set; } = null!;
|
||||
|
||||
private string cssModule
|
||||
{
|
||||
get => IsPortrait ? "col-12" : "col-4";
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IHttpContextAccessor httpContextAccessor { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<TimbratureModel> _listTimb { get; set; } = new List<TimbratureModel>();
|
||||
|
||||
[Inject]
|
||||
private GpwDataService GDataServ { get; set; } = null!;
|
||||
|
||||
protected bool IsUscita { get; set; } = false;
|
||||
|
||||
private List<TimbratureModel>? ListTimbAppr { get; set; }
|
||||
|
||||
private List<TimbratureModel>? ListTimbRich { get; set; }
|
||||
|
||||
protected string txtMsgInOut
|
||||
{
|
||||
get => IsUscita ? "Uscita" : "Entrata";
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
@@ -88,43 +44,24 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
#region Protected Fields
|
||||
|
||||
private async Task ReloadData()
|
||||
protected bool vetoUpd = false;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<TimbratureModel> _listTimb { get; set; } = new List<TimbratureModel>();
|
||||
|
||||
protected bool IsUscita { get; set; } = false;
|
||||
|
||||
protected string txtMsgInOut
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
ListTimb = (ListTimb == null) ? new List<TimbratureModel>() : ListTimb;
|
||||
|
||||
// prendo primo record timbrature o oggi...
|
||||
if (ListTimb.Count > 0)
|
||||
{
|
||||
var firstRec = ListTimb.FirstOrDefault();
|
||||
if (firstRec != null)
|
||||
{
|
||||
DataRif = firstRec.DataOra.Date.AddHours(adesso.Hour).AddMinutes(Math.Ceiling((double)adesso.Minute / 5) * 5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DataRif = DateTime.Today.AddHours(adesso.Hour).AddMinutes(Math.Ceiling((double)adesso.Minute / 5) * 5);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
if (ListTimb != null)
|
||||
{
|
||||
ListTimbAppr = ListTimb.Where(x => x.Approv == true).OrderByDescending(x => x.DataOra).ToList();
|
||||
ListTimbRich = ListTimb.Where(x => x.Approv == false).OrderByDescending(x => x.DataOra).ToList();
|
||||
}
|
||||
get => IsUscita ? "Uscita" : "Entrata";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data-Ora di riferimento del blocco giornaliero corrente
|
||||
/// </summary>
|
||||
private string dataRifTimb
|
||||
{
|
||||
get => (ListTimb.FirstOrDefault()).DataOra.ToString("dddd, dd.MM.yyyy");
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
@@ -193,7 +130,6 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
currRecord = new TimbratureModel()
|
||||
{
|
||||
Entrata = !IsUscita,
|
||||
@@ -205,7 +141,7 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
};
|
||||
|
||||
// aggiungo alla lista...
|
||||
ListTimb.Add(currRecord);
|
||||
ListTimb.Add(currRecord);
|
||||
ListTimbRich.Add(currRecord);
|
||||
// aggiorno
|
||||
await GDataServ.TimbratureUpdate(currRecord);
|
||||
@@ -285,5 +221,74 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private MessageService AppMServ { get; set; } = null!;
|
||||
|
||||
private string cssModule
|
||||
{
|
||||
get => IsPortrait ? "col-12" : "col-4";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data-Ora di riferimento del blocco giornaliero corrente
|
||||
/// </summary>
|
||||
private string dataRifTimb
|
||||
{
|
||||
get => (ListTimb.FirstOrDefault()).DataOra.ToString("dddd, dd.MM.yyyy");
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private GpwDataService GDataServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IHttpContextAccessor httpContextAccessor { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
private List<TimbratureModel>? ListTimbAppr { get; set; }
|
||||
|
||||
private List<TimbratureModel>? ListTimbRich { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
ListTimb = (ListTimb == null) ? new List<TimbratureModel>() : ListTimb;
|
||||
|
||||
// prendo primo record timbrature o oggi...
|
||||
if (ListTimb.Count > 0)
|
||||
{
|
||||
var firstRec = ListTimb.FirstOrDefault();
|
||||
if (firstRec != null)
|
||||
{
|
||||
#if false
|
||||
//DataRif = firstRec.DataOra.Date.AddHours(adesso.Hour).AddMinutes(Math.Ceiling((double)adesso.Minute / 5) * 5);
|
||||
#endif
|
||||
DataRif = CORE.Data.Utils.DateRounded(firstRec.DataOra.Date.AddHours(adesso.Hour).AddMinutes(adesso.Minute), 5, false);
|
||||
}
|
||||
}
|
||||
else if (DataRif > adesso.Date.AddDays(1).AddMinutes(-1))
|
||||
{
|
||||
#if false
|
||||
//DataRif = DateTime.Today.AddHours(adesso.Hour).AddMinutes(Math.Ceiling((double)adesso.Minute / 5) * 5);
|
||||
#endif
|
||||
DataRif = CORE.Data.Utils.DateRounded(DateTime.Today.AddHours(adesso.Hour).AddMinutes(adesso.Minute), 5, false);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
if (ListTimb != null)
|
||||
{
|
||||
ListTimbAppr = ListTimb.Where(x => x.Approv == true).OrderByDescending(x => x.DataOra).ToList();
|
||||
ListTimbRich = ListTimb.Where(x => x.Approv == false).OrderByDescending(x => x.DataOra).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ else if (ListTimbr != null)
|
||||
<dialog class="modal fade show" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" aria-modal="true" role="dialog">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content">
|
||||
<TimbrEditor ListTimb="@ListTimbr" CloseReq="ResetTimbData" ItemUpdated="UpdTimbData"></TimbrEditor>
|
||||
<TimbrEditor ListTimb="@ListTimbr" CloseReq="ResetTimbData" ItemUpdated="UpdTimbData" DataRif="SelDayDTO.DtRif"></TimbrEditor>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
@@ -362,13 +362,17 @@ namespace GPW.CORE.WRKLOG.Pages
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
#if false
|
||||
//protected void PeriodoSelect(List<TimbratureModel> newList)
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Indico item selezionato
|
||||
/// </summary>
|
||||
protected void PeriodoSelect(List<TimbratureModel> newList)
|
||||
protected void PeriodoSelect(DailyDataDTO dayData)
|
||||
{
|
||||
// salvo periodo selezionato
|
||||
ListTimbr = newList;
|
||||
ListTimbr = dayData.ListTimbr;
|
||||
SelDayDTO = dayData;
|
||||
}
|
||||
|
||||
protected async Task ReloadPeriodo()
|
||||
|
||||
Reference in New Issue
Block a user