diff --git a/GPW.CORE.SMART/Components/BottoniEntrEsc.razor b/GPW.CORE.SMART/Components/BottoniEntrEsc.razor index e5f23bc..504cdeb 100644 --- a/GPW.CORE.SMART/Components/BottoniEntrEsc.razor +++ b/GPW.CORE.SMART/Components/BottoniEntrEsc.razor @@ -22,7 +22,7 @@ -@if (isRecording) +@if (isRecording && false) { -} \ No newline at end of file +} + + +
+ +
\ No newline at end of file diff --git a/GPW.CORE.SMART/Components/BottoniEntrEsc.razor.cs b/GPW.CORE.SMART/Components/BottoniEntrEsc.razor.cs index c9cdfeb..a5b824d 100644 --- a/GPW.CORE.SMART/Components/BottoniEntrEsc.razor.cs +++ b/GPW.CORE.SMART/Components/BottoniEntrEsc.razor.cs @@ -4,6 +4,7 @@ using GPW.CORE.Data.DTO; using GPW.CORE.Smart.Data; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using Org.BouncyCastle.Security; using System.Data; using System.Runtime.Serialization; @@ -183,18 +184,26 @@ namespace GPW.CORE.Smart.Components private async Task registraTimbratura(bool isEntrata) { DateTime adesso = DateTime.Now; - string lastAct = isEntrata ? "Entrata" : "Uscita"; - lastAction = $"Registrato {lastAct} alle ore {adesso:HH:mm}"; + textDtAct=$"{adesso:dddd dd.MM.yyyy}"; + string lastAct = isEntrata ? "INGRESSO" : "USCITA"; + lastAction = $"Registrato evento {lastAct} alle {adesso:HH:mm}"; // inidico inizio update isRecording = true; DoAdd(!isEntrata); nextIsEntrata = !isEntrata; MService.ReportTimbratura(); // chiudo visualizzazione stato update - await Task.Delay(1500); + await Task.Delay(3000); isRecording = false; } + private string textDtAct = ""; + + private string toastCss + { + get => isRecording ? "show" : ""; + } + private async Task doRichiesta(bool isEntrata) { TimbratureModel currRecord = new TimbratureModel(); diff --git a/GPW.CORE.SMART/Pages/TestCal.razor b/GPW.CORE.SMART/Pages/TestCal.razor index c23385f..4c46fd2 100644 --- a/GPW.CORE.SMART/Pages/TestCal.razor +++ b/GPW.CORE.SMART/Pages/TestCal.razor @@ -1,43 +1,50 @@ @page "/TestCal" -

TestCal

- +
+
+

Test Page

+
+
+
+ +
+
+
-
- - - -@* -
- +
- -
-
- @($"{dtCurr:ddd dd.MM.yyyy}") -
-
- -
-
- single: @singleWeek +
+
+
-*@ +
+ +
diff --git a/GPW.CORE.SMART/Pages/TestCal.razor.cs b/GPW.CORE.SMART/Pages/TestCal.razor.cs index 38f5d28..13d252c 100644 --- a/GPW.CORE.SMART/Pages/TestCal.razor.cs +++ b/GPW.CORE.SMART/Pages/TestCal.razor.cs @@ -7,29 +7,13 @@ namespace GPW.CORE.Smart.Pages protected override async Task OnInitializedAsync() { dtCurr = DateTime.Today; - await Task.Delay(1); - DateCheck = new Dictionary(); - Random rnd = new Random(); - // random colorate... - for (int i = 0; i < 10; i++) - { - DateTime newDate = dtCurr.AddDays(rnd.Next(-5, 10)).Date; - if (!DateCheck.ContainsKey(newDate)) - { - DateCheck.Add(newDate, "bg-success text-light rounded-circle p-2"); - } - else - { - DateCheck[newDate] = "bg-warning text-light rounded-circle p-2"; - } - } } #endregion Protected Methods #region Private Fields - private Dictionary DateCheck = new Dictionary(); + private bool showToast = false; #endregion Private Fields @@ -37,22 +21,25 @@ namespace GPW.CORE.Smart.Pages private DateTime dtCurr { get; set; } = DateTime.Today; - private bool singleWeek = false; + private string toastCss + { + get => showToast ? "show" : ""; + } + + protected string dtAction = ""; + protected string messaggio = ""; #endregion Private Properties #region Private Methods - private void DisplayDate(DateTime dtSel) + private void toggleShow() { - dtCurr = dtSel; - singleWeek = true; - } - - private async Task resetCal() - { - singleWeek = false; - await Task.Delay(1); + DateTime adesso = DateTime.Now; + dtAction = $"{adesso:dddd dd.MM.yyyy}"; + string tipo = adesso.Second % 2 == 0 ? "INGRESSO" : "USCITA"; + messaggio = $"Registrato evento {tipo} alle {adesso:HH:mm}"; + showToast = !showToast; } #endregion Private Methods