From 73f81018d03fdf472dc79cc760d28aaf975ee1bd Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 17 Feb 2020 17:12:51 +0100 Subject: [PATCH] Inizio fix dati da lettura QR painting --- AppData/DS_Report.xss | 2 +- NKC_WF/WebUserControls/cmp_painting.ascx | 8 +- NKC_WF/WebUserControls/cmp_painting.ascx.cs | 118 +++++++++++++++++- .../cmp_painting.ascx.designer.cs | 18 +++ 4 files changed, 140 insertions(+), 6 deletions(-) diff --git a/AppData/DS_Report.xss b/AppData/DS_Report.xss index cff9f3a..fd3aa15 100644 --- a/AppData/DS_Report.xss +++ b/AppData/DS_Report.xss @@ -7,7 +7,7 @@ - + diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx b/NKC_WF/WebUserControls/cmp_painting.ascx index a8d2f89..0c89d3d 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx +++ b/NKC_WF/WebUserControls/cmp_painting.ascx @@ -6,13 +6,15 @@
- +
READER
+ +
- +
-
\ No newline at end of file + diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx.cs b/NKC_WF/WebUserControls/cmp_painting.ascx.cs index 93eadf2..6a33045 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_painting.ascx.cs @@ -1,4 +1,6 @@ -using System; +using AppData; +using NKC_SDK; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -7,11 +9,123 @@ using System.Web.UI.WebControls; namespace NKC_WF.WebUserControls { - public partial class cmp_painting : System.Web.UI.UserControl + public partial class cmp_painting : BaseUserControl { + /// + /// Comando barcode letto + /// + protected string lastCmd + { + get + { + return hfLastBCode.Value; + } + set + { + hfLastBCode.Value = value; + lastValidCmd = value; + } + } + /// + /// ULTIMO Comando barcode VALIDO (!="") letto + /// + protected string lastValidCmd + { + get + { + return hfLastValidBCode.Value; + } + set + { + // solo se è !="" + if (value != "") + { + hfLastValidBCode.Value = value; + } + } + } + /// + /// caricamento pagina + /// + /// + /// protected void Page_Load(object sender, EventArgs e) { + cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh; + } + private void doUpdate() + { + cmp_paint_binsIN.doUpdate(); + cmp_paint_binsOUT.doUpdate(); + } + private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e) + { + bool doRaiseEv = false; + // processo evento.. + lastCmd = cmp_barcode.inputAcquired.ToUpper(); + doRaiseEv = processLastCmd(doRaiseEv); + + // reset comando + cmp_barcode.inputAcquired = ""; + // aggiorno... + doUpdate(); + } + + private bool processLastCmd(bool doRaiseEv) + { + // verifico il datamatrix dei BIN da pitturare + if (lastCmd == "") doRaiseEv = true; + // processiamo barcode letto + decodedData decoData = DataLayer.man.decodeBcode(lastCmd); + switch (decoData.codeType) + { + case codeType.UNK: + cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); + doRaiseEv = true; + break; + case codeType.Item: + cmp_barcode.showOutput("badge badge-warning", $"Item - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.ItemGeneric: + cmp_barcode.showOutput("badge badge-warning", $"Item Generic - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.Material: + cmp_barcode.showOutput("badge badge-warning", $"Material - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.Sheet: + cmp_barcode.showOutput("badge badge-warning", $"Sheet - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.Stack: + cmp_barcode.showOutput("badge badge-warning", $"BUNK - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.Batch: + cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.Cart: + cmp_barcode.showOutput("badge badge-warning", $"Cart - ignored: {decoData.description}"); + doRaiseEv = true; + break; + case codeType.Bin: + break; + case codeType.BinProcessed: + break; + case codeType.SecScreen: + cmp_barcode.showOutput("badge badge-warning", $"SecScreen - ignored: {decoData.description}"); + doRaiseEv = true; + break; + default: + cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); + doRaiseEv = true; + break; + } + return doRaiseEv; } } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs index 87b430a..33838e9 100644 --- a/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_painting.ascx.designer.cs @@ -32,6 +32,24 @@ namespace NKC_WF.WebUserControls /// protected global::NKC_WF.WebUserControls.cmp_barcode cmp_barcode; + /// + /// Controllo hfLastBCode. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfLastBCode; + + /// + /// Controllo hfLastValidBCode. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfLastValidBCode; + /// /// Controllo cmp_paint_binsOUT. ///