From f72725f9ddc8aab068d50521bc4d8ffcfd97e32b Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 4 Aug 2016 18:04:59 +0200 Subject: [PATCH] estendo generalizzazione decodifica barcode tra finiti e finiti supercubati --- GMW/WebUserControls/mod_finiti.ascx.cs | 74 ++----------------- .../mod_finitiSuperCub.ascx.cs | 74 ++----------------- 2 files changed, 12 insertions(+), 136 deletions(-) diff --git a/GMW/WebUserControls/mod_finiti.ascx.cs b/GMW/WebUserControls/mod_finiti.ascx.cs index f6becb43..15d98918 100644 --- a/GMW/WebUserControls/mod_finiti.ascx.cs +++ b/GMW/WebUserControls/mod_finiti.ascx.cs @@ -31,6 +31,10 @@ namespace GMW.WebUserControls /// dati x verifica CodSoggetto / matricola /// protected string preCodSogg = memLayer.ML.confReadString("prefCodSogg"); + /// + /// Codice linea non utilizzabile ("00" finale = Select...) + /// + protected string codLineaKo = "W2100"; public event EventHandler eh_reqUpdate; /// /// stringa UID univoca @@ -321,72 +325,6 @@ namespace GMW.WebUserControls } } /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - int matricola = -1; - // provo a convertire in intero barcode x verifica eventuale matricola... - try - { - matricola = Convert.ToInt32(barcodeIn); - } - catch - { } - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.confReadString("prefComandi"); - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare)) // è un particolare... - { - answ = tipoCodiceBarcode.Particolare; - } - // controllo se sia un codice IMBALLO - else if (utils.obj.taSelImballi.getByImballo(barcodeIn).Rows.Count > 0) - { - // è imballo! - answ = tipoCodiceBarcode.Imballo; - } - else if (barcodeIn.StartsWith(preCodSogg)) - { - // cerco cod soggetto... - if (DataProxy.obj.taTrascSogg.getByKey(barcodeIn, 0).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Operatore; - } - } - else if (matricola >= 0) - { - if (DataProxy.obj.taTrascSogg.getByKey("", matricola).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Operatore; - } - } - else - { - try - { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// /// valore barcode /// public string barcodeIn @@ -443,7 +381,7 @@ namespace GMW.WebUserControls if (barcodeIn != "") { Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - switch (tipoBCode) + switch (MagClass.tipoBCode_L3(barcodeIn)) { case tipoCodiceBarcode.Comando: if (barcodeIn == memLayer.ML.confReadString("cmdReset")) @@ -472,7 +410,7 @@ namespace GMW.WebUserControls break; case tipoCodiceBarcode.UDC: // se linea non selezionata ERRORE!!! - if (Postazione.currCodLinea == "W2100") + if (Postazione.currCodLinea == codLineaKo) { Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; Postazione.CssClass = "stileComandoKo"; diff --git a/GMW/WebUserControls/mod_finitiSuperCub.ascx.cs b/GMW/WebUserControls/mod_finitiSuperCub.ascx.cs index 57bff20d..21d14e02 100644 --- a/GMW/WebUserControls/mod_finitiSuperCub.ascx.cs +++ b/GMW/WebUserControls/mod_finitiSuperCub.ascx.cs @@ -31,6 +31,10 @@ namespace GMW.WebUserControls /// dati x verifica CodSoggetto / matricola /// protected string preCodSogg = memLayer.ML.confReadString("prefCodSogg"); + /// + /// Codice linea non utilizzabile ("00" finale = Select...) + /// + protected string codLineaKo = "W2300"; public event EventHandler eh_reqUpdate; /// /// stringa UID univoca @@ -318,72 +322,6 @@ namespace GMW.WebUserControls } } /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - int matricola = -1; - // provo a convertire in intero barcode x verifica eventuale matricola... - try - { - matricola = Convert.ToInt32(barcodeIn); - } - catch - { } - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.confReadString("prefComandi"); - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare)) // è un particolare... - { - answ = tipoCodiceBarcode.Particolare; - } - // controllo se sia un codice IMBALLO - else if (utils.obj.taSelImballi.getByImballo(barcodeIn).Rows.Count > 0) - { - // è imballo! - answ = tipoCodiceBarcode.Imballo; - } - else if (barcodeIn.StartsWith(preCodSogg)) - { - // cerco cod soggetto... - if (DataProxy.obj.taTrascSogg.getByKey(barcodeIn, 0).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Operatore; - } - } - else if (matricola >= 0) - { - if (DataProxy.obj.taTrascSogg.getByKey("", matricola).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Operatore; - } - } - else - { - try - { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// /// valore barcode /// public string barcodeIn @@ -440,7 +378,7 @@ namespace GMW.WebUserControls if (barcodeIn != "") { Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - switch (tipoBCode) + switch (MagClass.tipoBCode_L3(barcodeIn)) { case tipoCodiceBarcode.Comando: if (barcodeIn == memLayer.ML.confReadString("cmdReset")) @@ -469,7 +407,7 @@ namespace GMW.WebUserControls break; case tipoCodiceBarcode.UDC: // se linea non selezionata ERRORE!!! - if (Postazione.currCodLinea == "W2100") + if (Postazione.currCodLinea == codLineaKo) { Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; Postazione.CssClass = "stileComandoKo";