From dc6bc4e5997ca50feb61610d0256fb0b7c636a8c Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Jan 2019 16:58:36 +0100 Subject: [PATCH] Cambio logica controllo ODL e pz prodotti... --- IOB-WIN/IobGeneric.cs | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index 62d72bfe..cb10bd9a 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -488,34 +488,36 @@ namespace IOB_WIN // altrimenti uso dati da TCiclo registrati... else { - currServerCount = utils.callUrl(urlGetPzCountRec); - lgInfo("Lettura contapezzi da TCiclo dall'url {0} --> num pz: {1}", urlGetPzCountRec, currServerCount); + // leggo PRIMA ODL .... lastIdxODL = utils.callUrl(urlGetCurrODL); lgInfo("Lettura ODL dall'url {0} --> {1}", urlGetPzCountRec, lastIdxODL); + // POI leggo i pezzi + currServerCount = utils.callUrl(urlGetPzCountRec); + lgInfo("Lettura contapezzi da TCiclo dall'url {0} --> num pz: {1}", urlGetPzCountRec, currServerCount); } - if (currServerCount != "") + // controllo: SE NON HO ODL... + if (lastIdxODL == "" || lastIdxODL == "0") { - // se "-1" resto a ultimo... - if (currServerCount != "-1") - { - int.TryParse(currServerCount, out contapezzi); - lgInfo("Ricevuta conferma da server di {0} pezzi registrati per ODL", currServerCount); - } - else - { - // NON AGGIORNO - contapezzi = lastCountCNC; - lgInfo("Errore lettura contapezzi (-1) - uso lastCountCNC --> " + contapezzi); - } + // NON AGGIORNO + contapezzi = lastCountCNC; + lgInfo(string.Format("Errore lettura ODL: {0} - uso lastCountCNC --> {1}", lastIdxODL, contapezzi)); } else { - // controllo SE HO ODL... - if (lastIdxODL == "" || lastIdxODL == "0") + if (currServerCount != "") { - // NON AGGIORNO - contapezzi = lastCountCNC; - lgInfo(string.Format("Errore lettura ODL: {0} - uso lastCountCNC --> {1}", lastIdxODL, contapezzi)); + // se "-1" resto a ultimo... + if (currServerCount != "-1") + { + int.TryParse(currServerCount, out contapezzi); + lgInfo("Ricevuta conferma da server di {0} pezzi registrati per ODL", currServerCount); + } + else + { + // NON AGGIORNO + contapezzi = lastCountCNC; + lgInfo("Errore lettura contapezzi (-1) - uso lastCountCNC --> " + contapezzi); + } } else { @@ -526,6 +528,7 @@ namespace IOB_WIN // segno contapezzi a zero... contapezzi = 0; lgInfo("RESET contapezzi (ZERO)"); + } } }