diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 097e881..e2f7bc7 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -37,7 +37,8 @@ - + + diff --git a/NKC_WF/WebUserControls/cmp_barcode.ascx b/NKC_WF/WebUserControls/cmp_barcode.ascx index 0241b5a..3858786 100644 --- a/NKC_WF/WebUserControls/cmp_barcode.ascx +++ b/NKC_WF/WebUserControls/cmp_barcode.ascx @@ -1,7 +1,7 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_barcode.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_barcode" %>
<%--AutoPostBack="True"--%> - - + +
diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx b/NKC_WF/WebUserControls/cmp_stackLoading.ascx index 5a74417..9ae9b8a 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx @@ -9,7 +9,7 @@

<%: traduci("ProdSimul") %>

- <%: traduci("Advance") %> #<%: traduci("Prod") %> + <%: traduci("Advance") %> #<%: traduci("Prod") %>
@@ -53,11 +53,6 @@
- - - - - - +
diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs index 6b8f088..da261dd 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs @@ -31,7 +31,6 @@ namespace NKC_WF.WebUserControls private void fixDisplay() { cmp_barcode.Visible = enableBCode; - //frmView.Visible = !enableBCode; } public bool enableBCode @@ -102,9 +101,24 @@ namespace NKC_WF.WebUserControls } 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(); + // se richiesto faccio raiseEvent + if (doRaiseEv) + { + cmp_stackNextloading.doUpdate(); + } + } + + private bool processLastCmd(bool doRaiseEv) + { if (string.IsNullOrEmpty(lastCmd)) { doRaiseEv = true; @@ -113,27 +127,16 @@ namespace NKC_WF.WebUserControls 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: - case codeType.ItemGeneric: - cmp_barcode.showOutput("text-warning", $"Item - 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: // verifico SE lo stack esista... - DS_App.StackListDataTable tabStack = DataLayer.man.taSTL.getByKey(decoData.codeInt); - if (tabStack.Count == 0) + DS_App.StackListDataTable tabStack = null; + try + { + tabStack = DataLayer.man.taSTL.getByKey(decoData.codeInt); + } + catch + { } + if (tabStack != null && tabStack.Count == 0) { cmp_barcode.showOutput("badge badge-danger", $"BUNK NOT FOUND: {decoData.description}"); doRaiseEv = true; @@ -203,25 +206,15 @@ namespace NKC_WF.WebUserControls } } break; - case codeType.Batch: - cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}"); - doRaiseEv = true; - break; default: + cmp_barcode.showOutput("text-danger", $"Data Ignored: {decoData.rawData} --> no action"); doRaiseEv = true; break; } - // reset comando - cmp_barcode.resetInput(); - // aggiorno... - doUpdate(); - // se richiesto faccio raiseEvent - if (doRaiseEv) - { - cmp_stackNextloading.doUpdate(); - raiseEvent(); - } + + return doRaiseEv; } + protected bool currentBunkAlreadyWorking(int StackIdRequested) { bool answ = false; @@ -281,7 +274,7 @@ namespace NKC_WF.WebUserControls protected void checkVisibility() { lblLoaded.Visible = StackId != 0; - frmView.Visible = !lblLoaded.Visible;// && !enableBCode; + frmView.Visible = !lblLoaded.Visible; // fix div di simulazione divSim.Visible = (memLayer.ML.CRS("environment") == "DEV" && !enableBCode); } diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.designer.cs index c5403ca..2e024b9 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.designer.cs @@ -95,24 +95,6 @@ namespace NKC_WF.WebUserControls /// protected global::NKC_WF.WebUserControls.cmp_barcode cmp_barcode; - /// - /// Controllo upnlLoading. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.UpdatePanel upnlLoading; - - /// - /// Controllo timerLoad. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.Timer timerLoad; - /// /// Controllo cmp_stackNextloading. /// diff --git a/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs index f03b1ad..13cf0af 100644 --- a/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs @@ -49,7 +49,10 @@ namespace NKC_WF.WebUserControls get { int answ = 0; - int.TryParse(frmViewNext.SelectedValue.ToString(), out answ); + if (frmViewNext.SelectedValue != null) + { + int.TryParse(frmViewNext.SelectedValue.ToString(), out answ); + } return answ; } }