diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 88f3d1b..52d1423 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -3502,7 +3502,7 @@ namespace AppData protected static void setCurrSheetTab(string machine, DS_App.SheetListDataTable tabella) { string rawData = JsonConvert.SerializeObject(tabella); - // TTL 2 sec + // TTL 1 sec memLayer.ML.setRSV(redCurrSheetTabKey(machine), rawData, 1); } diff --git a/NKC_WF/BaseUserControl.cs b/NKC_WF/BaseUserControl.cs index f6be53d..22f19e3 100644 --- a/NKC_WF/BaseUserControl.cs +++ b/NKC_WF/BaseUserControl.cs @@ -4,6 +4,7 @@ using NKC_SDK; using SteamWare; using System; using System.Collections.Generic; +using System.Web; namespace NKC_WF { @@ -58,6 +59,22 @@ namespace NKC_WF } } + /// + /// pagina corrente... + /// + public string currPage + { + get + { + string url = HttpContext.Current.Request.Url.PathAndQuery; + if (url.Contains("?")) + { + url = url.Substring(0, url.IndexOf("?")); + } + return url; + } + } + #endregion Public Properties #region Public Methods diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index f30d3cd..fa55d02 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -85,10 +85,6 @@ - - - - diff --git a/NKC_WF/WebUserControls/cmp_MachSelSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_MachSelSmart.ascx.cs index a4f4d32..d3a8968 100644 --- a/NKC_WF/WebUserControls/cmp_MachSelSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_MachSelSmart.ascx.cs @@ -12,18 +12,6 @@ namespace NKC_WF.WebUserControls { #region Public Properties - public string currPage - { - get - { - string url = HttpContext.Current.Request.Url.PathAndQuery; - if (url.Contains("?mach=")) - { - url = url.Substring(0, url.IndexOf("?mach=")); - } - return url; - } - } public string MachineSel { diff --git a/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs b/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs index 370dc2d..652c1fb 100644 --- a/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs @@ -31,19 +31,6 @@ namespace NKC_WF.WebUserControls } } - public string currPage - { - get - { - string url = HttpContext.Current.Request.Url.PathAndQuery; - if (url.Contains("?mach=")) - { - url = url.Substring(0, url.IndexOf("?mach=")); - } - return url; - } - } - public bool machSelected { get diff --git a/NKC_WF/WebUserControls/cmp_barcode.ascx.cs b/NKC_WF/WebUserControls/cmp_barcode.ascx.cs index 36b376d..9fe02ba 100644 --- a/NKC_WF/WebUserControls/cmp_barcode.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_barcode.ascx.cs @@ -127,6 +127,8 @@ namespace NKC_WF.WebUserControls { resetInput(); resetMessage(); + setTimer(); + test4reload(); } else if (string.IsNullOrEmpty(inputAcquired)) { @@ -147,14 +149,7 @@ namespace NKC_WF.WebUserControls protected void UiTimer_Tick(object sender, EventArgs e) { - // controllo, se ultima operazione > smartForceReloadPagina_ms --> reload! - var tsLastUpdate = DateTime.Now.Subtract(lastDtInput); - if (tsLastUpdate.TotalMilliseconds > memLayer.ML.confReadInt("smartForceReloadPagina_ms")) - { - lgInfo($"cmp_barcode | Reload page for timeout: {tsLastUpdate.TotalSeconds} sec from last update"); - inputAcquired = "##"; - Response.Redirect(Request.RawUrl); - } + test4reload(); } #endregion Protected Methods @@ -182,10 +177,32 @@ namespace NKC_WF.WebUserControls { resetInput(); } - } + } resetInput(); } + /// + /// imposta il tempo di scadenza del timer x il refresh del componente + /// + private void setTimer() + { + int timer = memLayer.ML.CRI("timerBarcode"); + timer = timer > 0 ? timer : 10000; + UiTimer.Interval = timer; + } + + private void test4reload() + { + // controllo, se ultima operazione > smartForceReloadPagina_ms --> reload! + var tsLastUpdate = DateTime.Now.Subtract(lastDtInput); + if (tsLastUpdate.TotalMilliseconds > memLayer.ML.CRI("smartForceReloadPagina_ms")) + { + lgInfo($"cmp_barcode | Reload page for timeout: {tsLastUpdate.TotalSeconds} sec from last update"); + inputAcquired = "##"; + Response.Redirect(Request.RawUrl); + } + } + #endregion Private Methods } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_footer.ascx.cs b/NKC_WF/WebUserControls/cmp_footer.ascx.cs index 7630679..6d31fa1 100644 --- a/NKC_WF/WebUserControls/cmp_footer.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_footer.ascx.cs @@ -26,9 +26,7 @@ namespace NKC_WF.WebUserControls /// private void setTimer() { - //Timer1.Tick += Timer1_Tick; - int intUpdatePagina_ms = memLayer.ML.confReadInt("intUpdatePagina_ms"); - //intUpdatePagina_ms = intUpdatePagina_ms > 10000 ? 10000 : intUpdatePagina_ms; + int intUpdatePagina_ms = memLayer.ML.CRI("intUpdatePagina_ms"); Timer1.Interval = intUpdatePagina_ms; } diff --git a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs index 1ddced8..d169147 100644 --- a/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_kittingSmart.ascx.cs @@ -4,10 +4,11 @@ using SteamWare; using System; using System.Data; using System.Linq; +using System.Web.WebPages; namespace NKC_WF.WebUserControls { - public partial class cmp_kittingSmart : BaseUserControl + public partial class cmp_kittingSmart : BaseUserControl, IDisposable { #region Public Properties @@ -47,6 +48,19 @@ namespace NKC_WF.WebUserControls #endregion Public Properties + #region Public Methods + + public override void Dispose() + { + cmp_barcode.eh_doRefresh -= Cmp_barcode_eh_doRefresh; + cmp_barcode.eh_doReset -= Cmp_barcode_eh_doReset; + cmp_KS_BinCart.eh_doRefresh -= cmp_KS_BinCart_eh_doRefresh; + cmp_KS_OtherItemsCart.eh_doRefresh -= cmp_KS_OtherItemsCart_eh_doRefresh; + cmp_KS_Items.eh_doRefresh -= cmp_KS_Items_eh_doRefresh; + } + + #endregion Public Methods + #region Protected Properties protected DS_App.BinsDataTable currBinTab @@ -330,6 +344,7 @@ namespace NKC_WF.WebUserControls DS_App.ItemListDataTable tabItem = null; DataLayer DLMan = new DataLayer(); divInfo.Visible = false; + divError.Visible = false; // processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero) switch (tipoCod) { @@ -392,7 +407,7 @@ namespace NKC_WF.WebUserControls if (lastObject == rawData) { // --> metto cart in scarico e registro LOG come se avesse - // appena letto 1:1 ogni Dtmx + // appena letto 1:1 ogni Dtmx DLMan.taPLog.closeCart(codeInt); lgInfo($"cmp_kittingSmart | taPLog.closeCart | codeInt: {codeInt} | rawData: {rawData}"); // mostro che ho fatto @@ -430,7 +445,7 @@ namespace NKC_WF.WebUserControls if (lastObject == rawData) { // --> metto cart in scarico e registro LOG come se - // avesse appena letto 1:1 ogni Dtmx + // avesse appena letto 1:1 ogni Dtmx DLMan.taPLog.acquireCart(rawData, currIpAddress, user_std.UtSn.userNameAD); lgInfo($"cmp_kittingSmart | taPLog.acquireCart | KittingStart = GETDATE() | rawData: {rawData} | UserName: {user_std.UtSn.userNameAD} | currIpAddress: {currIpAddress}"); displInfo($"OK: CART acquired {rawData} - item confirmed"); diff --git a/NKC_WF/WebUserControls/cmp_partMIA_byPLID.ascx.cs b/NKC_WF/WebUserControls/cmp_partMIA_byPLID.ascx.cs index 9257433..23372be 100644 --- a/NKC_WF/WebUserControls/cmp_partMIA_byPLID.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_partMIA_byPLID.ascx.cs @@ -1,4 +1,5 @@ -using SteamWare; +using NKC_SDK; +using SteamWare; using System; using System.Collections.Generic; using System.Linq; @@ -75,7 +76,16 @@ namespace NKC_WF.WebUserControls set { hfShowFull.Value = value.ToString(); - grView.DataBind(); + try + { + grView.DataBind(); + } + catch (Exception exc) + { + lgError($"Eccezione durante cpm_partMIA_byPLID.showFull{Environment.NewLine}{exc}"); + // rimando a pagina + Response.Redirect(currPage); + } } } diff --git a/NKC_WF/WebUserControls/cmp_reportSelector.ascx.cs b/NKC_WF/WebUserControls/cmp_reportSelector.ascx.cs index db787bd..20c4495 100644 --- a/NKC_WF/WebUserControls/cmp_reportSelector.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_reportSelector.ascx.cs @@ -12,19 +12,6 @@ namespace NKC_WF.WebUserControls { #region Public Properties - public string currPage - { - get - { - string url = HttpContext.Current.Request.Url.PathAndQuery; - if (url.Contains("?")) - { - url = url.Substring(0, url.IndexOf("?")); - } - return url; - } - } - public ReportType SelReport { get diff --git a/NKC_WF/site/KittingSmart.aspx.cs b/NKC_WF/site/KittingSmart.aspx.cs index fa4617c..c88eea3 100644 --- a/NKC_WF/site/KittingSmart.aspx.cs +++ b/NKC_WF/site/KittingSmart.aspx.cs @@ -4,7 +4,7 @@ using System.Web.UI; namespace NKC_WF.site { - public partial class KittingSmart : BasePage + public partial class KittingSmart : BasePage, IDisposable { #region Public Properties @@ -27,6 +27,30 @@ namespace NKC_WF.site #endregion Public Properties + #region Public Methods + + public override void Dispose() + { + cmp_kittingSmart.eh_doRefresh -= cmp_kittingSmart_eh_doRefresh; + } + + #endregion Public Methods + + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + ((SiteMaster)this.Master).showSearch = false; + doUpdate(); + } + cmp_kittingSmart.eh_doRefresh += cmp_kittingSmart_eh_doRefresh; + cmp_kittingSmart.PlaceCod = "KIT001"; + } + + #endregion Protected Methods + #region Private Methods private void cmp_kittingSmart_eh_doRefresh(object sender, EventArgs e) @@ -57,20 +81,5 @@ namespace NKC_WF.site } #endregion Private Methods - - #region Protected Methods - - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - ((SiteMaster)this.Master).showSearch = false; - doUpdate(); - } - cmp_kittingSmart.eh_doRefresh += cmp_kittingSmart_eh_doRefresh; - cmp_kittingSmart.PlaceCod = "KIT001"; - } - - #endregion Protected Methods } } \ No newline at end of file diff --git a/NKC_WF/site/KittingSmart.aspx.designer.cs b/NKC_WF/site/KittingSmart.aspx.designer.cs index 2bf792e..650390d 100644 --- a/NKC_WF/site/KittingSmart.aspx.designer.cs +++ b/NKC_WF/site/KittingSmart.aspx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// This code was generated by a tool. // -// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se -// il codice viene rigenerato. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ namespace NKC_WF.site @@ -15,20 +15,20 @@ namespace NKC_WF.site { /// - /// Controllo hfPackListID. + /// hfPackListID control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HiddenField hfPackListID; /// - /// Controllo cmp_kittingSmart. + /// cmp_kittingSmart control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::NKC_WF.WebUserControls.cmp_kittingSmart cmp_kittingSmart; } diff --git a/NKC_WF/site/MachineUnload.aspx.cs b/NKC_WF/site/MachineUnload.aspx.cs index c10558b..686d4b3 100644 --- a/NKC_WF/site/MachineUnload.aspx.cs +++ b/NKC_WF/site/MachineUnload.aspx.cs @@ -6,6 +6,79 @@ namespace NKC_WF { public partial class MachineUnload : BasePage, IDisposable { + #region Public Properties + + /// + /// BatchId corrente... + /// + public int BatchId + { + set + { + hfBatchID.Value = value.ToString(); + ComLib.setCurrBatchId(MachineSel, value); + } + get + { + int answ = 0; + int.TryParse(hfBatchID.Value, out answ); + return answ; + } + } + + /// + /// SheetId corrente... + /// + public int SheetId + { + set + { + hfSheetID.Value = value.ToString(); + ComLib.setCurrSheetId(MachineSel, value); + } + get + { + int answ = 0; + int.TryParse(hfSheetID.Value, out answ); + return answ; + } + } + + /// + /// Verifica se sia da mostrare pagina MissingInAction + /// + public bool showPartMIA + { + get + { + bool answ = false; + if (BatchId > 0) + { + try + { + bool hasMIA = DLMan.taIL.getMissingByBatch(BatchId).Count > 0; + answ = hasMIA && MachineSel != "#"; + } + catch + { } + } + return answ; + } + } + + #endregion Public Properties + + #region Public Methods + + public override void Dispose() + { + timerSvg.Tick -= timerSvg_Tick; + timerSvg.Dispose(); + base.Dispose(); + } + + #endregion Public Methods + #region Protected Properties protected string MachineSel @@ -73,67 +146,68 @@ namespace NKC_WF #endregion Protected Properties - #region Public Properties + #region Protected Methods /// - /// BatchId corrente... + /// Incrementa counter redis /// - public int BatchId + protected void incrNumWait() { - set + if (numWaitSvg > 30) { - hfBatchID.Value = value.ToString(); - ComLib.setCurrBatchId(MachineSel, value); + memLayer.ML.resetRCnt(redProdReq); + Response.Redirect(Request.RawUrl); } - get + memLayer.ML.setRCntI(redProdReq); + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) { - int answ = 0; - int.TryParse(hfBatchID.Value, out answ); - return answ; + ((SiteMaster)this.Master).showSearch = false; + setTimer(); + doUpdate(); } } /// - /// SheetId corrente... + /// Main SVG timer /// - public int SheetId + /// + /// + protected void timerSvg_Tick(object sender, EventArgs e) { - set + // in base al num di sec dell'ora decido cosa aggiornare... + int counter = numWaitSvg; + // ogni x cicli resetto batch/Foglio + if (counter % 15 == 0) { - hfSheetID.Value = value.ToString(); - ComLib.setCurrSheetId(MachineSel, value); + SheetId = -3; } - get + // ora faccio verifiche + doUpdate(); + // ogni x cicli + if (counter % 5 == 0) { - int answ = 0; - int.TryParse(hfSheetID.Value, out answ); - return answ; + cmp_MU_stats.doUpdate(); + upnlStats.Update(); } + // faccio update bin/cart ogni pari/dispari... + if (counter % 2 == 0) + { + cmp_MU_carts.doUpdate(); + upnlCarts.Update(); + } + else + { + cmp_MU_bins.doUpdate(); + upnlBins.Update(); + } + incrNumWait(); } - /// - /// Verifica se sia da mostrare pagina MissingInAction - /// - public bool showPartMIA - { - get - { - bool answ = false; - if (BatchId > 0) - { - try - { - bool hasMIA = DLMan.taIL.getMissingByBatch(BatchId).Count > 0; - answ = hasMIA && MachineSel!="#"; - } - catch - { } - } - return answ; - } - } - - #endregion Public Properties + #endregion Protected Methods #region Private Methods @@ -168,8 +242,8 @@ namespace NKC_WF upnlTitle.Update(); } } - // definisco se mostrare PartMIA - hlPartMIA.Visible = showPartMIA; + // definisco se mostrare PartMIA + hlPartMIA.Visible = showPartMIA; } /// @@ -218,34 +292,6 @@ namespace NKC_WF return needUpdate; } - #endregion Private Methods - - #region Protected Methods - - /// - /// Incrementa counter redis - /// - protected void incrNumWait() - { - if (numWaitSvg > 30) - { - memLayer.ML.resetRCnt(redProdReq); - Response.Redirect(Request.RawUrl); - } - memLayer.ML.setRCntI(redProdReq); - } - - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - ((SiteMaster)this.Master).showSearch = false; - setTimer(); - doUpdate(); - } - } - - /// /// imposta il tempo di scadenza del timer x il refresh del componente /// @@ -255,50 +301,7 @@ namespace NKC_WF timerSvgInt = timerSvgInt > 0 ? timerSvgInt : 500; timerSvg.Interval = timerSvgInt; } - public override void Dispose() - { - timerSvg.Tick -= timerSvg_Tick; - timerSvg.Dispose(); - base.Dispose(); - } - - /// - /// Main SVG timer - /// - /// - /// - protected void timerSvg_Tick(object sender, EventArgs e) - { - // in base al num di sec dell'ora decido cosa aggiornare... - int counter = numWaitSvg; - // ogni x cicli resetto batch/Foglio - if (counter % 15 == 0) - { - SheetId = -3; - } - // ora faccio verifiche - doUpdate(); - // ogni x cicli - if (counter % 5 == 0) - { - cmp_MU_stats.doUpdate(); - upnlStats.Update(); - } - // faccio update bin/cart ogni pari/dispari... - if (counter % 2 == 0) - { - cmp_MU_carts.doUpdate(); - upnlCarts.Update(); - } - else - { - cmp_MU_bins.doUpdate(); - upnlBins.Update(); - } - incrNumWait(); - } - - #endregion Protected Methods + #endregion Private Methods } } \ No newline at end of file