diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 70e4109..4dfb8c4 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -1184,7 +1184,7 @@ namespace AppData } /// - /// Restituisce il PRIMO bunk secondo criterio: + /// Restituisce il BUNK che è il primo della lissta: /// - posizione = 5 (ho letto da webApp il BUNK e preso in carico) /// - NumSheet > NumSheetUnload /// - Ordinato per StackIndex (crescente) x avere il più VECCHIO @@ -1209,6 +1209,36 @@ namespace AppData } return answ; } + /// + /// BUNK corrente (x ora copia di first, poi sarà quello SELEZIONATO tra quelli SELEZIONABILI) + /// + /// + public static DS_App.StackListRow getCurrBunk() + { + DS_App.StackListRow answ = null; + var tabStl = DataLayer.man.taSTL.getLoaded(); + if (tabStl.Count > 0) + { + answ = tabStl[0]; + } + return answ; + } + /// + /// Recupera lo sheet corrente da un BUNK come quello in status 5... + /// + /// + /// + 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) + { + answ = tabSheets[0]; + } + return answ; + } /// /// Restituisce il PROSSIMO bunk secondo criterio: diff --git a/NKC_WF/site/DBG_QRCode_Unload.aspx.cs b/NKC_WF/site/DBG_QRCode_Unload.aspx.cs index 4ae89c7..37cc9be 100644 --- a/NKC_WF/site/DBG_QRCode_Unload.aspx.cs +++ b/NKC_WF/site/DBG_QRCode_Unload.aspx.cs @@ -1,4 +1,5 @@ -using SteamWare; +using AppData; +using SteamWare; using System; using System.Collections.Generic; using System.Linq; @@ -75,9 +76,25 @@ namespace NKC_WF.site { imgQrLogin.ImageUrl = getLoginUrl(); updateSize(); - //!!!FIXME!!! fare calcolo del VERO batch corrente... - BatchId = 242; // fixed x test! - SheetID = 770; + // 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 // aggiorno child cmp_MU_bins.ShowQr = true; cmp_MU_bins.BatchId = BatchId;