From aef71558a3ebc28b685e065161b8355287997c44 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 13 Jul 2020 16:36:46 +0200 Subject: [PATCH] Costruita condizione da verificare x carico BUNK --- AppData/DS_App.Designer.cs | 90 ++++++++++++++++- AppData/DS_App.xsd | 98 ++++++++++--------- AppData/DS_App.xss | 4 +- NKC_WF/Web.config | 1 - .../WebUserControls/cmp_stackLoading.ascx.cs | 87 ++++++++-------- .../cmp_stackNextloading.ascx.cs | 72 +++++++------- 6 files changed, 227 insertions(+), 125 deletions(-) diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 9a2feaf..f09792d 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -1856,8 +1856,12 @@ namespace AppData { private global::System.Data.DataColumn columnNumSheetsPrinted; + private global::System.Data.DataColumn columnNumSheetsWorking; + private global::System.Data.DataColumn columnNumSheetsWorked; + private global::System.Data.DataColumn columnNumSheetsUnloaded; + private global::System.Data.DataColumn columnNumItems; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -1957,6 +1961,14 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn NumSheetsWorkingColumn { + get { + return this.columnNumSheetsWorking; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public global::System.Data.DataColumn NumSheetsWorkedColumn { @@ -1965,6 +1977,14 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn NumSheetsUnloadedColumn { + get { + return this.columnNumSheetsUnloaded; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public global::System.Data.DataColumn NumItemsColumn { @@ -2010,7 +2030,7 @@ namespace AppData { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public StackListRow AddStackListRow(int StackID, int StackIndex, int BatchID, int Position, string StackDtmx, int NumSheets, int NumSheetsPrepared, int NumSheetsPrinted, int NumSheetsWorked, int NumItems) { + public StackListRow AddStackListRow(int StackID, int StackIndex, int BatchID, int Position, string StackDtmx, int NumSheets, int NumSheetsPrepared, int NumSheetsPrinted, int NumSheetsWorking, int NumSheetsWorked, int NumSheetsUnloaded, int NumItems) { StackListRow rowStackListRow = ((StackListRow)(this.NewRow())); object[] columnValuesArray = new object[] { StackID, @@ -2021,7 +2041,9 @@ namespace AppData { NumSheets, NumSheetsPrepared, NumSheetsPrinted, + NumSheetsWorking, NumSheetsWorked, + NumSheetsUnloaded, NumItems}; rowStackListRow.ItemArray = columnValuesArray; this.Rows.Add(rowStackListRow); @@ -2060,7 +2082,9 @@ namespace AppData { this.columnNumSheets = base.Columns["NumSheets"]; this.columnNumSheetsPrepared = base.Columns["NumSheetsPrepared"]; this.columnNumSheetsPrinted = base.Columns["NumSheetsPrinted"]; + this.columnNumSheetsWorking = base.Columns["NumSheetsWorking"]; this.columnNumSheetsWorked = base.Columns["NumSheetsWorked"]; + this.columnNumSheetsUnloaded = base.Columns["NumSheetsUnloaded"]; this.columnNumItems = base.Columns["NumItems"]; } @@ -2083,8 +2107,12 @@ namespace AppData { base.Columns.Add(this.columnNumSheetsPrepared); this.columnNumSheetsPrinted = new global::System.Data.DataColumn("NumSheetsPrinted", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnNumSheetsPrinted); + this.columnNumSheetsWorking = new global::System.Data.DataColumn("NumSheetsWorking", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnNumSheetsWorking); this.columnNumSheetsWorked = new global::System.Data.DataColumn("NumSheetsWorked", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnNumSheetsWorked); + this.columnNumSheetsUnloaded = new global::System.Data.DataColumn("NumSheetsUnloaded", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnNumSheetsUnloaded); this.columnNumItems = new global::System.Data.DataColumn("NumItems", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnNumItems); this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { @@ -2099,7 +2127,9 @@ namespace AppData { this.columnNumSheets.ReadOnly = true; this.columnNumSheetsPrepared.ReadOnly = true; this.columnNumSheetsPrinted.ReadOnly = true; + this.columnNumSheetsWorking.ReadOnly = true; this.columnNumSheetsWorked.ReadOnly = true; + this.columnNumSheetsUnloaded.ReadOnly = true; this.columnNumItems.ReadOnly = true; } @@ -12132,6 +12162,22 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public int NumSheetsWorking { + get { + try { + return ((int)(this[this.tableStackList.NumSheetsWorkingColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("Il valore della colonna \'NumSheetsWorking\' nella tabella \'StackList\' è DBNull.", e); + } + } + set { + this[this.tableStackList.NumSheetsWorkingColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public int NumSheetsWorked { @@ -12148,6 +12194,22 @@ namespace AppData { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public int NumSheetsUnloaded { + get { + try { + return ((int)(this[this.tableStackList.NumSheetsUnloadedColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("Il valore della colonna \'NumSheetsUnloaded\' nella tabella \'StackList\' è DBNull.", e); + } + } + set { + this[this.tableStackList.NumSheetsUnloadedColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public int NumItems { @@ -12212,6 +12274,18 @@ namespace AppData { this[this.tableStackList.NumSheetsPrintedColumn] = global::System.Convert.DBNull; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool IsNumSheetsWorkingNull() { + return this.IsNull(this.tableStackList.NumSheetsWorkingColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void SetNumSheetsWorkingNull() { + this[this.tableStackList.NumSheetsWorkingColumn] = global::System.Convert.DBNull; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool IsNumSheetsWorkedNull() { @@ -12224,6 +12298,18 @@ namespace AppData { this[this.tableStackList.NumSheetsWorkedColumn] = global::System.Convert.DBNull; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool IsNumSheetsUnloadedNull() { + return this.IsNull(this.tableStackList.NumSheetsUnloadedColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public void SetNumSheetsUnloadedNull() { + this[this.tableStackList.NumSheetsUnloadedColumn] = global::System.Convert.DBNull; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public bool IsNumItemsNull() { @@ -18181,7 +18267,9 @@ namespace AppData.DS_AppTableAdapters { tableMapping.ColumnMappings.Add("NumSheets", "NumSheets"); tableMapping.ColumnMappings.Add("NumSheetsPrepared", "NumSheetsPrepared"); tableMapping.ColumnMappings.Add("NumSheetsPrinted", "NumSheetsPrinted"); + tableMapping.ColumnMappings.Add("NumSheetsWorking", "NumSheetsWorking"); tableMapping.ColumnMappings.Add("NumSheetsWorked", "NumSheetsWorked"); + tableMapping.ColumnMappings.Add("NumSheetsUnloaded", "NumSheetsUnloaded"); tableMapping.ColumnMappings.Add("NumItems", "NumItems"); this._adapter.TableMappings.Add(tableMapping); } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index 122a7da..df81fa1 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -88,7 +88,7 @@ FROM v_BatchList - + dbo.stp_Batch_fixSched @@ -185,7 +185,7 @@ FROM v_BatchList - + dbo.stp_Batch_redoPartValid @@ -196,7 +196,7 @@ FROM v_BatchList - + dbo.stp_Batch_resetAllNesting @@ -207,7 +207,7 @@ FROM v_BatchList - + dbo.stp_Batch_resetPartUnValid @@ -217,7 +217,7 @@ FROM v_BatchList - + dbo.stp_zzz_resetProdCall @@ -227,7 +227,7 @@ FROM v_BatchList - + dbo.stp_Batch_resetTree @@ -238,7 +238,7 @@ FROM v_BatchList - + dbo.stp_Batch_updateSchedPrior @@ -250,7 +250,7 @@ FROM v_BatchList - + dbo.stp_Batch_updateStatus @@ -287,7 +287,9 @@ FROM v_StackList + + @@ -2425,7 +2427,7 @@ FROM v_CartKitDetail - + @@ -2475,7 +2477,7 @@ FROM v_CartKitDetail - + @@ -2492,12 +2494,14 @@ FROM v_CartKitDetail + + - + @@ -2552,7 +2556,7 @@ FROM v_CartKitDetail - + @@ -2625,7 +2629,7 @@ FROM v_CartKitDetail - + @@ -2633,7 +2637,7 @@ FROM v_CartKitDetail - + @@ -2702,7 +2706,7 @@ FROM v_CartKitDetail - + @@ -2735,7 +2739,7 @@ FROM v_CartKitDetail - + @@ -2776,7 +2780,7 @@ FROM v_CartKitDetail - + @@ -2795,7 +2799,7 @@ FROM v_CartKitDetail - + @@ -2819,7 +2823,7 @@ FROM v_CartKitDetail - + @@ -2827,7 +2831,7 @@ FROM v_CartKitDetail - + @@ -2844,7 +2848,7 @@ FROM v_CartKitDetail - + @@ -2853,7 +2857,7 @@ FROM v_CartKitDetail - + @@ -2884,7 +2888,7 @@ FROM v_CartKitDetail - + @@ -2892,7 +2896,7 @@ FROM v_CartKitDetail - + @@ -2908,7 +2912,7 @@ FROM v_CartKitDetail - + @@ -2916,7 +2920,7 @@ FROM v_CartKitDetail - + @@ -2944,7 +2948,7 @@ FROM v_CartKitDetail - + @@ -2980,7 +2984,7 @@ FROM v_CartKitDetail - + @@ -2996,7 +3000,7 @@ FROM v_CartKitDetail - + @@ -3006,7 +3010,7 @@ FROM v_CartKitDetail - + @@ -3023,7 +3027,7 @@ FROM v_CartKitDetail - + @@ -3036,7 +3040,7 @@ FROM v_CartKitDetail - + @@ -3086,7 +3090,7 @@ FROM v_CartKitDetail - + @@ -3112,7 +3116,7 @@ FROM v_CartKitDetail - + @@ -3154,7 +3158,7 @@ FROM v_CartKitDetail - + @@ -3371,18 +3375,18 @@ FROM v_CartKitDetail - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index d55b6f2..6ad2aa1 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -4,10 +4,10 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 6f5358c..edd882e 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -43,7 +43,6 @@ - diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs index 8d6076a..8f46516 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs @@ -110,27 +110,36 @@ namespace NKC_WF.WebUserControls // controllo sia quello RICHIESTO, eventualmente permetteremo TUTTI quelli del giorno in ogni ordine... if (decoData.codeInt == cmp_stackNextloading.StackIdReq) { - cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}"); - ComLib.taktMLCurrStack = decoData.code; - // processo DB e salvo che lo stack è stato caricato in MACHINE LOAD - int stackId = 0; - try + // verifico SE i BUNKS correnti siano tutti stati completati (NumSheet == NumWorking) + if (currentBunkPrinted) { - var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData); - if (tabStack.Count == 1) + cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}"); + ComLib.taktMLCurrStack = decoData.code; + // processo DB e salvo che lo stack è stato caricato in MACHINE LOAD + int stackId = 0; + try { - stackId = tabStack[0].StackID; + var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData); + if (tabStack.Count == 1) + { + stackId = tabStack[0].StackID; + } + } + catch + { } + // SE HO uno stackId valido (>0)... + if (stackId > 0) + { + DataLayer.man.taSTL.updatePos(stackId, 5); + // controllo status del bunk nel suo insieme... + ComLib.updateBatchPositionByBunk(stackId); + doRaiseEv = true; } } - catch - { } - // SE HO uno stackId valido (>0)... - if (stackId > 0) + // altrimenti segnalo NON pronto x caricare prossimo + else { - DataLayer.man.taSTL.updatePos(stackId, 5); - // controllo status del bunk nel suo insieme... - ComLib.updateBatchPositionByBunk(stackId); - doRaiseEv = true; + cmp_barcode.showOutput("badge badge-danger", $"PREV BUNK NOT COMPLETED, {decoData.rawData}"); } } else @@ -138,29 +147,6 @@ namespace NKC_WF.WebUserControls cmp_barcode.showOutput("badge badge-danger", $"WRONG BUNK, {decoData.rawData}"); } } - //DS_App.SheetListDataTable nextTbl = DataLayer.man.taSHL.getNextByStack(StackId); - //// se tab vuota --> HO FINITO!!!! - //if (nextTbl.Count == 0) - //{ - // cmp_barcode.showOutput("badge badge-warning", $"STACK IS COMPLETED, {decoData.description}"); - //} - //// se ho valori --> controllo se corretto... - //else - //{ - // string codReq = nextTbl[0].MatExtCode.ToString(); - // if (codReq == decoData.codeInt.ToString()) - // { - // cmp_barcode.showOutput("badge badge-success", $"SHEET RECORDED: {decoData.description}"); - // // chiamo stored x indicare preparato - // DataLayer.man.taSHL.setPrepared(nextTbl[0].SheetID); - // } - // else - // { - // cmp_barcode.showOutput("badge badge-danger", $"WRONG SHEET: {decoData.description}"); - // } - //} - - //cmp_barcode.showOutput("badge badge-warning", "Stack - ignored"); break; case codeType.Batch: cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}"); @@ -182,6 +168,29 @@ namespace NKC_WF.WebUserControls } } + protected bool currentBunkPrinted + { + get + { + bool answ = true; + // leggo i dati del bunk... + var currBunks = DataLayer.man.taSTL.getCurrByBatch(BatchIdCurr); + if (currBunks.Count > 0) + { + // verifico x ogni bunk corrente + foreach (var item in currBunks) + { + // verifico se numSheet = NumWorging + bool checkNum = item.NumSheets == item.NumSheetsWorking; + + // update answ + answ = answ && checkNum; + } + } + return answ; + } + } + protected void checkVisibility() { lblLoaded.Visible = StackId != 0; diff --git a/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs index 0b52b86..1c1dc96 100644 --- a/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackNextloading.ascx.cs @@ -1,43 +1,45 @@ using System; +using System.Collections.Generic; namespace NKC_WF.WebUserControls { - public partial class cmp_stackNextloading : BaseUserControl - { - protected void Page_Load(object sender, EventArgs e) + public partial class cmp_stackNextloading : BaseUserControl { + protected void Page_Load(object sender, EventArgs e) + { + + } + + public int BatchId + { + set + { + hfBatchID.Value = value.ToString(); + doUpdate(); + } + get + { + int answ = 0; + int.TryParse(hfBatchID.Value, out answ); + return answ; + } + } + + public void doUpdate() + { + grViewCurrent.DataBind(); + frmViewNext.DataBind(); + } + + public int StackIdReq + { + get + { + int answ = 0; + int.TryParse(frmViewNext.SelectedValue.ToString(), out answ); + return answ; + } + } } - - public int BatchId - { - set - { - hfBatchID.Value = value.ToString(); - doUpdate(); - } - get - { - int answ = 0; - int.TryParse(hfBatchID.Value, out answ); - return answ; - } - } - - public void doUpdate() - { - grViewCurrent.DataBind(); - frmViewNext.DataBind(); - } - - public int StackIdReq - { - get - { - int answ = 0; - int.TryParse(frmViewNext.SelectedValue.ToString(), out answ); - return answ; - } - } - } } \ No newline at end of file