diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 8ad52fc..eae69e9 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -860,7 +860,7 @@ namespace AppData public static DS_App.SheetListRow getCurrSheet(int BatchID, string machine) { DS_App.SheetListRow answ = null; - if (BatchID > 0) + if (BatchID > 0 && !string.IsNullOrEmpty(machine)) { try { @@ -3262,17 +3262,20 @@ namespace AppData protected int getSheetIdByBatch(int BatchID, int minVal, int maxVal, string machine) { int answ = 0; - try + if (BatchID > 0 && !string.IsNullOrEmpty(machine)) { - DataLayer DLMan = new DataLayer(); - var tabSheet = DLMan.taSHL.getByMLStatus(BatchID, minVal, maxVal, machine); - if (tabSheet.Count > 0) + try { - answ = tabSheet[0].SheetID; + DataLayer DLMan = new DataLayer(); + var tabSheet = DLMan.taSHL.getByMLStatus(BatchID, minVal, maxVal, machine); + if (tabSheet.Count > 0) + { + answ = tabSheet[0].SheetID; + } } + catch + { } } - catch - { } return answ; } diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs index e203bf3..46239af 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs @@ -92,6 +92,7 @@ namespace NKC_WF.WebUserControls } } +#if false /// /// Sheet selezionato... /// @@ -107,7 +108,8 @@ namespace NKC_WF.WebUserControls int.TryParse(hfSheetID.Value, out answ); return answ; } - } + } +#endif #endregion Protected Properties @@ -848,8 +850,10 @@ namespace NKC_WF.WebUserControls // elimino item sel... itemIdSelected = 0; resetShowData(); +#if false bool fatto = ComLib.resetItemPickup(SheetID, DeviceId); - lgInfo($"cmp_kittingSmart | ComLib.resetItemPickup | SheetID: {SheetID} | DeviceId: {DeviceId} | done: {fatto}"); + lgInfo($"cmp_kittingSmart | ComLib.resetItemPickup | SheetID: {SheetID} | DeviceId: {DeviceId} | done: {fatto}"); +#endif } /// @@ -857,13 +861,15 @@ namespace NKC_WF.WebUserControls /// protected void updateCurrData() { +#if false // FORSE 5/5?!? DataLayer DLMan = new DataLayer(); var sheetList = DLMan.taSHL.getByMLStatus(PackListID, 3, 5, PlaceCod); if (sheetList.Count > 0) { SheetID = sheetList[0].SheetID; - } + } +#endif DeviceId = ComLib.GetIPAddress().Replace(".", "0").Replace(":", "0"); } diff --git a/NKC_WF/WebUserControls/cmp_labelsPrint.ascx.cs b/NKC_WF/WebUserControls/cmp_labelsPrint.ascx.cs index 57c7adb..67af80c 100644 --- a/NKC_WF/WebUserControls/cmp_labelsPrint.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_labelsPrint.ascx.cs @@ -64,19 +64,22 @@ namespace NKC_WF.WebUserControls /// protected void updateCurrData() { - // FORSE 5/5?!? - DataLayer DLMan = new DataLayer(); - var sheetList = DLMan.taSHL.getByMLStatus(PackListID, 3, 5, MachineSel); - if (sheetList.Count > 0) + if (BatchID > 0) { - SheetID = sheetList[0].SheetID; + // FORSE 5/5?!? + DataLayer DLMan = new DataLayer(); + var sheetList = DLMan.taSHL.getByMLStatus(BatchID, 3, 5, MachineSel); + if (sheetList.Count > 0) + { + SheetID = sheetList[0].SheetID; + } } DeviceId = ComLib.GetIPAddress().Replace(".", "0").Replace(":", "0"); } /// - /// PackList corrente... + /// Batch corrente... /// - public int PackListID + public int BatchID { set { diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs index 38ac6e6..ce39ba6 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs @@ -854,12 +854,15 @@ namespace NKC_WF.WebUserControls /// protected void updateCurrData() { - // FORSE 5/5?!? - DataLayer DLMan = new DataLayer(); - var sheetList = DLMan.taSHL.getByMLStatus(BatchId, 3, 5, PlaceCodFix); - if (sheetList.Count > 0) + if (BatchId > 0) { - SheetID = sheetList[0].SheetID; + // FORSE 5/5?!? + DataLayer DLMan = new DataLayer(); + var sheetList = DLMan.taSHL.getByMLStatus(BatchId, 3, 5, PlaceCodFix); + if (sheetList.Count > 0) + { + SheetID = sheetList[0].SheetID; + } } DeviceId = ComLib.GetIPAddress().Replace(".", "0").Replace(":", "0"); }