diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 4dfb8c4..f4da12b 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -1231,11 +1231,14 @@ namespace AppData public static DS_App.SheetListRow getCurrSheet(int BatchID) { DS_App.SheetListRow answ = null; - // recupero sheet corrente da Bunk... - DS_App.SheetListDataTable tabSheets = DataLayer.man.taSHL.getByMLStatus(BatchID, 5, 5); - if (tabSheets.Count > 0) + if (BatchID > 0) { - answ = tabSheets[0]; + // recupero sheet corrente da Bunk... + DS_App.SheetListDataTable tabSheets = DataLayer.man.taSHL.getByMLStatus(BatchID, 5, 5); + if (tabSheets.Count > 0) + { + answ = tabSheets[0]; + } } return answ; } diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 6a67ed7..8243c41 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -35,7 +35,7 @@ - + diff --git a/NKC_WF/site/DBG_QRCode_Unload.aspx.cs b/NKC_WF/site/DBG_QRCode_Unload.aspx.cs index 37cc9be..a6b928f 100644 --- a/NKC_WF/site/DBG_QRCode_Unload.aspx.cs +++ b/NKC_WF/site/DBG_QRCode_Unload.aspx.cs @@ -19,7 +19,7 @@ namespace NKC_WF.site } } /// - /// Batch corrente... + /// BatchId corrente... /// public int BatchId { @@ -34,9 +34,9 @@ namespace NKC_WF.site return answ; } }/// - /// Sheet corrente... + /// SheetId corrente... /// - public int SheetID + public int SheetId { set { @@ -76,32 +76,31 @@ namespace NKC_WF.site { imgQrLogin.ImageUrl = getLoginUrl(); updateSize(); - // recupero bunk corrente... - var currBunk = ComLib.getCurrBunk(); - if (currBunk != null) - { - BatchId = currBunk.BatchID; - var currSheet = ComLib.getCurrSheet(BatchId); - if(currSheet!=null) - { - SheetID = currSheet.SheetID; - } - } -#if false - else - { - //!!!FIXME!!! fare calcolo del VERO batch corrente... - BatchId = 242; // fixed x test! - SheetID = 770; - } -#endif + setCurrData(); // aggiorno child cmp_MU_bins.ShowQr = true; cmp_MU_bins.BatchId = BatchId; cmp_MU_carts.ShowQr = true; cmp_MU_carts.BatchId = BatchId; cmp_MU_Items.ShowQr = true; - cmp_MU_Items.SheetID = SheetID; + cmp_MU_Items.SheetID = SheetId; + } + /// + /// Imposta dati correnti (Bunk / Sheet) + /// + private void setCurrData() + { + // recupero bunk corrente... + DS_App.StackListRow currBunk = ComLib.getCurrBunk(); + if (currBunk != null) + { + BatchId = currBunk.BatchID; + DS_App.SheetListRow currSheet = ComLib.getCurrSheet(BatchId); + if (currSheet != null) + { + SheetId = currSheet.SheetID; + } + } } protected void ddlQrSize_SelectedIndexChanged(object sender, EventArgs e) diff --git a/NKC_WF/site/MachineUnload.aspx b/NKC_WF/site/MachineUnload.aspx index e95aec6..0800379 100644 --- a/NKC_WF/site/MachineUnload.aspx +++ b/NKC_WF/site/MachineUnload.aspx @@ -9,6 +9,7 @@ +
diff --git a/NKC_WF/site/MachineUnload.aspx.cs b/NKC_WF/site/MachineUnload.aspx.cs index 1a21799..90699bf 100644 --- a/NKC_WF/site/MachineUnload.aspx.cs +++ b/NKC_WF/site/MachineUnload.aspx.cs @@ -14,7 +14,7 @@ namespace NKC_WF } } /// - /// Batch corrente... + /// BatchId corrente... /// public int BatchId { @@ -30,29 +30,51 @@ namespace NKC_WF } } /// + /// SheetId corrente... + /// + public int SheetId + { + set + { + hfSheetID.Value = value.ToString(); + } + get + { + int answ = 0; + int.TryParse(hfSheetID.Value, out answ); + return answ; + } + } + /// /// Aggiorna componente principale e child components /// private void doUpdate() { - //!!!FIXME!!! fare calcolo del VERO batch corrente... - BatchId = 242; // fixed x test! + // imposto dati correnti + setCurrData(); // aggiorno child cmp_MU_stats.BatchId = BatchId; cmp_MU_bins.BatchId = BatchId; cmp_MU_carts.BatchId = BatchId; - // calcolo sheet x SVG viewer... - int SheetId = 0; - //SOLO SE ho batch != 0... - if (BatchId > 0) + cmp_MU_svgViewer.SheetId = SheetId; + } + + /// + /// Imposta dati correnti (Bunk / Sheet) + /// + private void setCurrData() + { + // recupero bunk corrente... + DS_App.StackListRow currBunk = ComLib.getCurrBunk(); + if (currBunk != null) { - // FORSE 5/5?!? - var sheetList = DataLayer.man.taSHL.getByMLStatus(BatchId, 3, 5); - if (sheetList.Count > 0) + BatchId = currBunk.BatchID; + DS_App.SheetListRow currSheet = ComLib.getCurrSheet(BatchId); + if (currSheet != null) { - SheetId = sheetList[0].SheetID; + SheetId = currSheet.SheetID; } } - cmp_MU_svgViewer.SheetId = SheetId; } } } \ No newline at end of file diff --git a/NKC_WF/site/MachineUnload.aspx.designer.cs b/NKC_WF/site/MachineUnload.aspx.designer.cs index 14b0e32..e8749b5 100644 --- a/NKC_WF/site/MachineUnload.aspx.designer.cs +++ b/NKC_WF/site/MachineUnload.aspx.designer.cs @@ -23,6 +23,15 @@ namespace NKC_WF /// protected global::System.Web.UI.WebControls.HiddenField hfBatchID; + /// + /// Controllo hfSheetID. + /// + /// + /// 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 hfSheetID; + /// /// Controllo upnlDrawings. ///