From 91f5754a796f7ef067d35ae6ae604fe6e5fa06f6 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 13 Oct 2023 18:34:47 +0200 Subject: [PATCH] Update MP-IO x metodo conteggio pz ODL --- MP-IO/Controllers/IOBController.cs | 31 +++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/MP-IO/Controllers/IOBController.cs b/MP-IO/Controllers/IOBController.cs index 6c956fbe..d7bb788a 100644 --- a/MP-IO/Controllers/IOBController.cs +++ b/MP-IO/Controllers/IOBController.cs @@ -759,7 +759,36 @@ namespace MP_IO.Controllers } catch (Exception exc) { - logger.lg.scriviLog($"Eccezione in recupero getCurrOdlRow{Environment.NewLine}{exc}", tipoLog.EXCEPTION); + logger.lg.scriviLog($"Eccezione in getCurrOdlRow{Environment.NewLine}{exc}", tipoLog.EXCEPTION); + } + return answ; + } + /// + /// Restituisce la quantità pezzi dell'odl correntemente in lavorazione sulla macchina... + /// GET: IOB/getCurrOdlQtaReq/SIMUL_01 + /// + /// + /// + public int getCurrOdlQtaReq(string id) + { + // attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il + // carattere "|" che poi trasformiamo ora in "#" + id = id.Replace("|", "#"); + int answ = 0; + DS_ProdTempi.ODLDataTable currData = null; + // chiamo metodo redis/db... + try + { + DataLayer DataLayerObj = new DataLayer(); + currData = DataLayerObj.currODLRowTab(id); + if (currData != null && currData.Count > 0) + { + answ = currData[0].NumPezzi; + } + } + catch (Exception exc) + { + logger.lg.scriviLog($"Eccezione in getCurrOdlQtaReq{Environment.NewLine}{exc}", tipoLog.EXCEPTION); } return answ; }