From c7152d2af993fe2bab8a35f9716a9ebd4ae86da4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 14 Jul 2021 19:41:50 +0200 Subject: [PATCH] Completamento gestione display BatchID corrente --- .../WebUserControls/cmp_unloadSmart.ascx.cs | 59 +++++++++++++++---- NKC_WF/site/MachineLoadSmart.aspx | 3 +- NKC_WF/site/MachineLoadSmart.aspx.cs | 28 +++++++++ NKC_WF/site/MachineLoadSmart.aspx.designer.cs | 9 +++ NKC_WF/site/MachineUnloadSmart.aspx | 4 +- NKC_WF/site/MachineUnloadSmart.aspx.cs | 33 ++++++++--- 6 files changed, 112 insertions(+), 24 deletions(-) diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs index 1304659..920f4a5 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs @@ -468,15 +468,29 @@ namespace NKC_WF.WebUserControls break; case codeType.Item: - tryPickup(decoData.rawData); - cmp_barcode.showOutput(cssClass.success, $"Valid IT Code: {decoData.rawData}"); - processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + if (string.IsNullOrEmpty(MachineSel)) + { + cmp_barcode.showOutput(cssClass.danger, $"{traduci("MissingMachineSel")}: {decoData.rawData} --> {traduci("NoValiAction")}"); + } + else + { + tryPickup(decoData.rawData); + cmp_barcode.showOutput(cssClass.success, $"Valid IT Code: {decoData.rawData}"); + processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + } break; case codeType.ItemGeneric: - tryPickup(decoData.rawData); - cmp_barcode.showOutput(cssClass.success, $"Valid IG Code: {decoData.rawData}"); - processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + if (string.IsNullOrEmpty(MachineSel)) + { + cmp_barcode.showOutput(cssClass.danger, $"{traduci("MissingMachineSel")}: {decoData.rawData} --> {traduci("NoValiAction")}"); + } + else + { + tryPickup(decoData.rawData); + cmp_barcode.showOutput(cssClass.success, $"Valid IG Code: {decoData.rawData}"); + processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + } break; case codeType.Material: @@ -505,18 +519,39 @@ namespace NKC_WF.WebUserControls break; case codeType.Cart: - cmp_barcode.showOutput(cssClass.success, $"Valid CR Code: {decoData.description}"); - processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + if (string.IsNullOrEmpty(MachineSel)) + { + cmp_barcode.showOutput(cssClass.danger, $"{traduci("MissingMachineSel")}: {decoData.rawData} --> {traduci("NoValiAction")}"); + } + else + { + cmp_barcode.showOutput(cssClass.success, $"Valid CR Code: {decoData.description}"); + processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + } break; case codeType.Bin: - cmp_barcode.showOutput(cssClass.success, $"Valid BN Code: {decoData.description}"); - processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + if (string.IsNullOrEmpty(MachineSel)) + { + cmp_barcode.showOutput(cssClass.danger, $"{traduci("MissingMachineSel")}: {decoData.rawData} --> {traduci("NoValiAction")}"); + } + else + { + cmp_barcode.showOutput(cssClass.success, $"Valid BN Code: {decoData.description}"); + processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + } break; case codeType.SecScreen: - cmp_barcode.showOutput(cssClass.success, $"Valid Screen Code: {decoData.description}"); - processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + if (string.IsNullOrEmpty(MachineSel)) + { + cmp_barcode.showOutput(cssClass.danger, $"{traduci("MissingMachineSel")}: {decoData.rawData} --> {traduci("NoValiAction")}"); + } + else + { + cmp_barcode.showOutput(cssClass.success, $"Valid Screen Code: {decoData.description}"); + processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + } break; case codeType.MachSelection: diff --git a/NKC_WF/site/MachineLoadSmart.aspx b/NKC_WF/site/MachineLoadSmart.aspx index 51d9f7e..64b95b8 100644 --- a/NKC_WF/site/MachineLoadSmart.aspx +++ b/NKC_WF/site/MachineLoadSmart.aspx @@ -6,7 +6,8 @@
-

<%: traduci("MachineLoad") %>

+ +

<%: traduci("MachineLoad") %>(<%: hfBatchID.Value %>)

diff --git a/NKC_WF/site/MachineLoadSmart.aspx.cs b/NKC_WF/site/MachineLoadSmart.aspx.cs index 94ec198..f57af15 100644 --- a/NKC_WF/site/MachineLoadSmart.aspx.cs +++ b/NKC_WF/site/MachineLoadSmart.aspx.cs @@ -9,11 +9,38 @@ namespace NKC_WF.site { public partial class MachineLoadSmart : BasePage { + #region Public Properties + + /// + /// Batch corrente... + /// + public int BatchId + { + set + { + hfBatchID.Value = value.ToString(); + } + get + { + int answ = 0; + int.TryParse(hfBatchID.Value, out answ); + return answ; + } + } + + #endregion Public Properties + #region Private Methods + private void Cmp_stackLoading_eh_doRefresh(object sender, EventArgs e) + { + BatchId = cmp_stackLoading.BatchIdCurr; + } + private void forceRefresh() { cmp_stackLoading.doUpdate(); + BatchId = cmp_stackLoading.BatchIdCurr; } #endregion Private Methods @@ -27,6 +54,7 @@ namespace NKC_WF.site ((SiteMaster)this.Master).showSearch = false; forceRefresh(); } + cmp_stackLoading.eh_doRefresh += Cmp_stackLoading_eh_doRefresh; } #endregion Protected Methods diff --git a/NKC_WF/site/MachineLoadSmart.aspx.designer.cs b/NKC_WF/site/MachineLoadSmart.aspx.designer.cs index b728314..7f8f63d 100644 --- a/NKC_WF/site/MachineLoadSmart.aspx.designer.cs +++ b/NKC_WF/site/MachineLoadSmart.aspx.designer.cs @@ -14,6 +14,15 @@ namespace NKC_WF.site public partial class MachineLoadSmart { + /// + /// hfBatchID control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfBatchID; + /// /// cmp_stackLoading control. /// diff --git a/NKC_WF/site/MachineUnloadSmart.aspx b/NKC_WF/site/MachineUnloadSmart.aspx index 46f09ce..cc95034 100644 --- a/NKC_WF/site/MachineUnloadSmart.aspx +++ b/NKC_WF/site/MachineUnloadSmart.aspx @@ -6,12 +6,12 @@
-

<%: traduci("MachineUnloadSmart") %>

+ +

<%: traduci("MachineUnloadSmart") %>(<%: hfBatchID.Value %>)

-
diff --git a/NKC_WF/site/MachineUnloadSmart.aspx.cs b/NKC_WF/site/MachineUnloadSmart.aspx.cs index 8774222..d21c5de 100644 --- a/NKC_WF/site/MachineUnloadSmart.aspx.cs +++ b/NKC_WF/site/MachineUnloadSmart.aspx.cs @@ -5,14 +5,8 @@ namespace NKC_WF { public partial class MachineUnloadSmart : BasePage { - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - ((SiteMaster)this.Master).showSearch = false; - doUpdate(); - } - } + #region Public Properties + /// /// Batch corrente... /// @@ -29,6 +23,11 @@ namespace NKC_WF return answ; } } + + #endregion Public Properties + + #region Private Methods + /// /// Aggiorna componente principale e child components /// @@ -38,17 +37,33 @@ namespace NKC_WF // aggiorno child cmp_unloadSmart.BatchId = BatchId; } + /// /// Imposta dati correnti (Bunk / Sheet) /// private void setCurrData() { // recupero bunk corrente... - DS_App.StackListRow currBunk = ComLib.getCurrBunk(); + DS_App.StackListRow currBunk = ComLib.getCurrBunk(cmp_unloadSmart.MachineSel); if (currBunk != null) { BatchId = currBunk.BatchID; } } + + #endregion Private Methods + + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + ((SiteMaster)this.Master).showSearch = false; + doUpdate(); + } + } + + #endregion Protected Methods } } \ No newline at end of file