From 9e0cfefce9953eea316e55de11dafe14027ea04f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 18 Apr 2026 10:48:08 +0200 Subject: [PATCH] fix save carico pezzi (sperabilmente...) --- MP.IOC/Data/MpDataService.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/MP.IOC/Data/MpDataService.cs b/MP.IOC/Data/MpDataService.cs index 43e47c03..756ce5f8 100644 --- a/MP.IOC/Data/MpDataService.cs +++ b/MP.IOC/Data/MpDataService.cs @@ -3777,7 +3777,13 @@ namespace MP.IOC.Data // default: 0, non registrato x cautela... string answ = "0"; // controllo per proseguire - if (!string.IsNullOrEmpty(idxMacchina) && !string.IsNullOrEmpty(qty)) + if (string.IsNullOrEmpty(idxMacchina) || string.IsNullOrEmpty(qty)) + { + string errore = $"Errore: mancano parametri macchina/incremento: idxMacchina {idxMacchina} | qty {qty}"; + Log.Error(errore); + answ = errore; + } + else { int numPzIncr = -1; int.TryParse(qty, out numPzIncr); @@ -3785,8 +3791,7 @@ namespace MP.IOC.Data if (numPzIncr >= 0) { // recupero info tra cui ODL corrente - Dictionary datiMacc = mDatiMacchine(idxMacchina); - //var currData = await GetCurrOdlAsync(idxMacchina); + Dictionary datiMacc = await mDatiMacchineAsync(idxMacchina); // registro evento 120 --> contapezzi in blocco !!!HARD CODED!!! !!!FIXME!!! int idxEvento = 120; DateTime adesso = DateTime.Now; @@ -3808,17 +3813,11 @@ namespace MP.IOC.Data Value = qty }; // salva e processa - var resp = scriviRigaEvento(newRecEv); + var resp = await scriviRigaEventoAsync(newRecEv); // registro in risposta che รจ andato tutto bene... ovvero la qty richiesta... answ = qty; } } - else - { - string errore = $"Errore: mancano parametri macchina/incremento: idxMacchina {idxMacchina} | qty {qty}"; - Log.Error(errore); - answ = errore; - } return answ; }