From 32b3789efc4f604eb523e7229c0349490b444d7a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 2 Apr 2025 15:46:41 +0200 Subject: [PATCH] Aggiunta metodi gestione fill e addNew condizionali --- MP-TAB3/Components/InsManual.razor | 91 ++++++++++++++------------- MP-TAB3/Components/InsManual.razor.cs | 32 +++++++++- 2 files changed, 78 insertions(+), 45 deletions(-) diff --git a/MP-TAB3/Components/InsManual.razor b/MP-TAB3/Components/InsManual.razor index 54aaad6b..afdaa9c4 100644 --- a/MP-TAB3/Components/InsManual.razor +++ b/MP-TAB3/Components/InsManual.razor @@ -1,35 +1,56 @@ -
+
@if (showDetail) { - if (EditRecord == null) - { - if (SeqStatus != null && SeqStatus.Count() > 0) +
+
+
+ @if (DayMinTot < 1440) + { + + } +
+
+ @if (DayMinTot < 1440) + { + + } +
+
+ +
+
+ @if (EditRecord == null) { -
-
-
Prod: @($"{DayMinLav:N1}") min (@($"{DayOee:P0}"))
-
Caricati: @($"{DayMinTot:N0}")
-
-
-
-
- @foreach (var item in SeqStatus) - { -
-
@item.Title
- @($"{item.Value:N0}min") + if (SeqStatus != null && SeqStatus.Count() > 0) + { +
+
+
+
Prod: @($"{DayMinLav:N1}") min (@($"{DayOee:P0}"))
+
Caricati: @($"{DayMinTot:N0}")
- } +
+
+
+ @foreach (var item in SeqStatus) + { +
+
@item.Title
+ @($"{item.Value:N0}min") +
+ } +
+
-
+ @*
+
*@ + } } - } - else - { -
+ else + {
@@ -69,8 +90,8 @@
-
- } + } +
@@ -106,31 +127,13 @@
- @*
- -
*@ -
- @if (DayMinTot < 1440) - { - - } -
-
-
-
- +
}
    -
  • elenco dichiarazioni giornata su click giorno
  • -
  • gestione dichiarazioni: editabili SE NON inviate
  • -
  • btn rapidi x inserire "chiusura spenta" o "apertura spenta"
  • btn x calcolo e congelamento giornata
  • nel calcolo chiama le stored x generare ODL/PODL/eventi/stati/tempi rilevati/dichiarazioni approvate
  • -
  • resoconto ore da dichairare/dichiarate (su 24...)
  • -
  • ...
  • -
  • varie ed eventuali...
diff --git a/MP-TAB3/Components/InsManual.razor.cs b/MP-TAB3/Components/InsManual.razor.cs index 457e25e2..03dda509 100644 --- a/MP-TAB3/Components/InsManual.razor.cs +++ b/MP-TAB3/Components/InsManual.razor.cs @@ -77,6 +77,36 @@ namespace MP_TAB3.Components } } + + protected async Task AddNew() + { + if (RecMSE != null) + { + string idxMacc = RecMSE.IdxMacchina; + DateTime startPeriod = dtCurr.Date; + if (ListDay != null) + { + var lastRec = ListDay.LastOrDefault(); + if (lastRec != null && lastRec.FineStato.HasValue) + { + startPeriod = lastRec.FineStato.Value; + } + else + { + startPeriod = dtCurr.Date.AddHours(6); + } + } + // creazione nuovo record ed aggiunta in coda agli esistenti... + EditRecord = new InsManualiModel() + { + IdxMacchina = idxMacc, + InizioStato = startPeriod, + IdxTipoEv = 1, + MatrOpr = 0 + }; + } + } + protected async Task FixMissing() { @@ -230,7 +260,7 @@ namespace MP_TAB3.Components private bool IsTimeInfoOk(DateTime reqDate, bool reloadDay) { bool allOk = false; - List myListDay = new List(); + List myListDay = new List(); if (ListDTO != null) { var dayDto = ListDTO.FirstOrDefault(x => x.DataRif == reqDate.Date);