From 8ceb0bf421e21517342b691e802debcf7775d5a4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 14 Jan 2022 19:39:50 +0100 Subject: [PATCH] Ancora udpate x pagina RilTemp --- GPW.CORE.UI/Components/DayCheckEditor.razor | 84 ++++++++++++++++++--- 1 file changed, 72 insertions(+), 12 deletions(-) diff --git a/GPW.CORE.UI/Components/DayCheckEditor.razor b/GPW.CORE.UI/Components/DayCheckEditor.razor index 9359625..a42c367 100644 --- a/GPW.CORE.UI/Components/DayCheckEditor.razor +++ b/GPW.CORE.UI/Components/DayCheckEditor.razor @@ -19,18 +19,49 @@
- gestione temperature rilevate + insert quotidiano @TargetDate.ToShortDateString() - @if (currRecord != null) - { -
- Temp odierna - @currRecord.TempRil +
+
+ @TargetDate.ToString("ddd dd/MM/yyyy")
- } - else - { - - } +
+ @if (currRecord != null) + { +
+
+ + + +
+ +
+ +
+
+ } + else + { + + } +
+ +
+
@if (listRilTemp != null) @@ -58,7 +89,19 @@
@code { - private int numDays = 60; + private int numDays + { + get + { + return _numDays; + } + set + { + _numDays = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } + } [Parameter] public EventCallback CloseReq { get; set; } @@ -77,6 +120,7 @@ } } + protected int _numDays = 30; protected DateTime _targetDate { get; set; } = DateTime.Today; protected List? listRilTemp { get; set; } = null; @@ -114,5 +158,21 @@ histLabel = histDict.Keys.ToArray(); // cerco se c'รจ dato odierno della temperatura... currRecord = rawData.Where(x => x.DtRilievo == TargetDate).FirstOrDefault(); + if (currRecord == null) + { + currRecord = new RilievoTempModel() + { + DtRilievo = DateTime.Now, + TempRil = 0 + }; + } + } + // effettua salvataggio misurazione temperatura + protected async void DoSave() + { + // chiamo classe gestione che salva e resetta cache dati... + + // chiamo chiusura! + await CloseReq.InvokeAsync(true); } }