Cambio logica controllo ODL e pz prodotti...

This commit is contained in:
Samuele E. Locatelli
2019-01-07 16:58:36 +01:00
parent 280dd8fe5a
commit dc6bc4e599
+23 -20
View File
@@ -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)");
}
}
}