From d80691ac0cd065401d9ae5a9ba2a8cb6b31cb5bb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 30 Jun 2021 13:04:25 +0200 Subject: [PATCH] =?UTF-8?q?visibilit=C3=A0=20da=20sel=20macchina=20x=20LOA?= =?UTF-8?q?D/UNLOAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NKC_WF/WebUserControls/cmp_MachSem.ascx | 2 +- NKC_WF/WebUserControls/cmp_MachSem.ascx.cs | 10 ++-- NKC_WF/site/MachineLoad.aspx | 4 +- NKC_WF/site/MachineLoad.aspx.cs | 54 ++++++++++++++-------- NKC_WF/site/MachineLoad.aspx.designer.cs | 13 +++++- NKC_WF/site/MachineUnload.aspx | 2 +- NKC_WF/site/MachineUnload.aspx.cs | 39 ++++++++++------ NKC_WF/site/MachineUnload.aspx.designer.cs | 9 ++++ 8 files changed, 87 insertions(+), 46 deletions(-) diff --git a/NKC_WF/WebUserControls/cmp_MachSem.ascx b/NKC_WF/WebUserControls/cmp_MachSem.ascx index c26750e..dc69528 100644 --- a/NKC_WF/WebUserControls/cmp_MachSem.ascx +++ b/NKC_WF/WebUserControls/cmp_MachSem.ascx @@ -16,7 +16,7 @@
-  <%: hfMachine.Value %> +  <%: hfMachine.Value %>
diff --git a/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs b/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs index f22062f..9ed46fe 100644 --- a/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_MachSem.ascx.cs @@ -24,12 +24,7 @@ namespace NKC_WF.WebUserControls { if (!string.IsNullOrEmpty(value)) { - string url = HttpContext.Current.Request.Url.AbsoluteUri; - if (url.Contains("?mach=")) - { - url = url.Substring(0, url.IndexOf("?mach=")); - } - url += $"?mach={value}"; + string url = $"{currPage}?mach={value}"; Response.Redirect(url); } } @@ -39,7 +34,7 @@ namespace NKC_WF.WebUserControls { get { - string url = HttpContext.Current.Request.Url.AbsoluteUri; + string url = HttpContext.Current.Request.Url.PathAndQuery; if (url.Contains("?mach=")) { url = url.Substring(0, url.IndexOf("?mach=")); @@ -64,6 +59,7 @@ namespace NKC_WF.WebUserControls { divSelect.Visible = !machSelected; divRuntime.Visible = machSelected; + hfMachClass.Value = currMachine == "NE01" ? "dark" : "light"; lbtReset.Attributes.Remove("class"); lbtReset.Attributes.Add("class", $"btn btn-block text-center btn-{hfMachClass.Value}"); } diff --git a/NKC_WF/site/MachineLoad.aspx b/NKC_WF/site/MachineLoad.aspx index e66ed7b..d38107a 100644 --- a/NKC_WF/site/MachineLoad.aspx +++ b/NKC_WF/site/MachineLoad.aspx @@ -17,9 +17,9 @@
-
+
- +
diff --git a/NKC_WF/site/MachineLoad.aspx.cs b/NKC_WF/site/MachineLoad.aspx.cs index e4e6376..6725d80 100644 --- a/NKC_WF/site/MachineLoad.aspx.cs +++ b/NKC_WF/site/MachineLoad.aspx.cs @@ -5,6 +5,39 @@ namespace NKC_WF { public partial class MachineLoad : BasePage { + #region Private Methods + + private void Cmp_stackLoading_eh_doRefresh(object sender, EventArgs e) + { + forceRefresh(); + } + + private void forceRefresh() + { + // verifico CI SIA la macchina... + if (string.IsNullOrEmpty(cmp_MachSem.currMachine)) + { + divMain.Visible = false; + } + else + { + divMain.Visible = true; + cmp_stackLoading.doUpdate(); + cmp_ML_ShDet.BatchId = cmp_stackLoading.BatchIdCurr; + cmp_ML_ShDet1.BatchId = cmp_stackLoading.BatchIdCurr; + cmp_ML_ShDet2.BatchId = cmp_stackLoading.BatchIdCurr; + cmp_ML_ShDet3.BatchId = cmp_stackLoading.BatchIdCurr; + cmp_ML_ShDet.doUpdate(); + cmp_ML_ShDet1.doUpdate(); + cmp_ML_ShDet2.doUpdate(); + cmp_ML_ShDet3.doUpdate(); + } + } + + #endregion Private Methods + + #region Protected Methods + protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) @@ -15,31 +48,16 @@ namespace NKC_WF cmp_stackLoading.eh_doRefresh += Cmp_stackLoading_eh_doRefresh; } - private void Cmp_stackLoading_eh_doRefresh(object sender, EventArgs e) - { - forceRefresh(); - } - - private void forceRefresh() - { - cmp_stackLoading.doUpdate(); - cmp_ML_ShDet.BatchId = cmp_stackLoading.BatchIdCurr; - cmp_ML_ShDet1.BatchId = cmp_stackLoading.BatchIdCurr; - cmp_ML_ShDet2.BatchId = cmp_stackLoading.BatchIdCurr; - cmp_ML_ShDet3.BatchId = cmp_stackLoading.BatchIdCurr; - cmp_ML_ShDet.doUpdate(); - cmp_ML_ShDet1.doUpdate(); - cmp_ML_ShDet2.doUpdate(); - cmp_ML_ShDet3.doUpdate(); - } - protected void timerLoad_Tick(object sender, EventArgs e) { forceRefresh(); } + protected void timerLong_Tick(object sender, EventArgs e) { Response.Redirect(Request.RawUrl); } + + #endregion Protected Methods } } \ No newline at end of file diff --git a/NKC_WF/site/MachineLoad.aspx.designer.cs b/NKC_WF/site/MachineLoad.aspx.designer.cs index bf22d46..d5e5d36 100644 --- a/NKC_WF/site/MachineLoad.aspx.designer.cs +++ b/NKC_WF/site/MachineLoad.aspx.designer.cs @@ -23,6 +23,15 @@ namespace NKC_WF /// protected global::NKC_WF.WebUserControls.cmp_MachSem cmp_MachSem; + /// + /// divMain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMain; + /// /// timerLong control. /// @@ -33,13 +42,13 @@ namespace NKC_WF protected global::System.Web.UI.Timer timerLong; /// - /// upnlBCode control. + /// upnlMain control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.UpdatePanel upnlBCode; + protected global::System.Web.UI.UpdatePanel upnlMain; /// /// timerLoad control. diff --git a/NKC_WF/site/MachineUnload.aspx b/NKC_WF/site/MachineUnload.aspx index d6d560c..7624abf 100644 --- a/NKC_WF/site/MachineUnload.aspx +++ b/NKC_WF/site/MachineUnload.aspx @@ -24,7 +24,7 @@
-
+
diff --git a/NKC_WF/site/MachineUnload.aspx.cs b/NKC_WF/site/MachineUnload.aspx.cs index ebdcbf9..fdbff97 100644 --- a/NKC_WF/site/MachineUnload.aspx.cs +++ b/NKC_WF/site/MachineUnload.aspx.cs @@ -123,23 +123,32 @@ namespace NKC_WF /// private void doUpdate() { - // imposto dati correnti - bool doUpdate = setCurrData(); - // aggiorno child - cmp_MU_stats.BatchId = BatchId; - cmp_MU_bins.BatchId = BatchId; - cmp_MU_carts.BatchId = BatchId; - cmp_MU_svgViewer.BatchId = BatchId; - cmp_MU_svgViewer.SheetId = SheetId; - if (doUpdate) + // verifico CI SIA la macchina... + if (string.IsNullOrEmpty(cmp_MachSem.currMachine)) { - cmp_MU_svgViewer.doUpdate(); - upnlDrawings.DataBind(); - upnlDrawings.Update(); - upnlTitle.Update(); + divMain.Visible = false; + } + else + { + divMain.Visible = true; + // imposto dati correnti + bool doUpdate = setCurrData(); + // aggiorno child + cmp_MU_stats.BatchId = BatchId; + cmp_MU_bins.BatchId = BatchId; + cmp_MU_carts.BatchId = BatchId; + cmp_MU_svgViewer.BatchId = BatchId; + cmp_MU_svgViewer.SheetId = SheetId; + if (doUpdate) + { + cmp_MU_svgViewer.doUpdate(); + upnlDrawings.DataBind(); + upnlDrawings.Update(); + upnlTitle.Update(); + } + // definisco se mostrare PartMIA + hlPartMIA.Visible = showPartMIA; } - // definisco se mostrare PartMIA - hlPartMIA.Visible = showPartMIA; } /// diff --git a/NKC_WF/site/MachineUnload.aspx.designer.cs b/NKC_WF/site/MachineUnload.aspx.designer.cs index ca72db9..9e7ca2c 100644 --- a/NKC_WF/site/MachineUnload.aspx.designer.cs +++ b/NKC_WF/site/MachineUnload.aspx.designer.cs @@ -41,6 +41,15 @@ namespace NKC_WF /// protected global::System.Web.UI.WebControls.HyperLink hlPartMIA; + /// + /// divMain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMain; + /// /// upnlStats control. ///