From cc6529a017d5ea7db45f3d35b8ec326c711bc041 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 26 Apr 2023 19:41:52 +0200 Subject: [PATCH] update force PNG x componente --- .../WebUserControls/cmp_batchDetail.ascx.cs | 206 +++++++++--------- NKC_WF/WebUserControls/cmp_batchList.ascx | 1 + NKC_WF/WebUserControls/cmp_batchList.ascx.cs | 21 +- .../cmp_batchList.ascx.designer.cs | 9 + .../cmp_validationSummary.ascx | 3 +- .../cmp_validationSummary.ascx.cs | 74 ++++--- .../cmp_validationSummary.ascx.designer.cs | 67 +++--- 7 files changed, 219 insertions(+), 162 deletions(-) diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs index a323da7..876264e 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs @@ -1,31 +1,11 @@ using AppData; using NKC_SDK; -using SteamWare; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace NKC_WF.WebUserControls { public partial class cmp_batchDetail : BaseUserControl { - #region Protected Properties - - - /// - /// verifica se il batch sia di tipo ancestor (da splittare su macchine) - /// - protected bool BatchIsAncestor - { - get - { - return ComLib.BType(BatchId) == BatchType.Ancestor; - } - } - - #endregion Protected Properties - #region Public Properties public int BatchId @@ -61,17 +41,85 @@ namespace NKC_WF.WebUserControls } } - #endregion Public Properties - - #region Private Methods - - private void fixDisplayDesc() + /// + /// Verifica se il batch sia stato splittato + /// + public bool isSplitted { - divSplit.Visible = BatchIsAncestor; - cmp_batchDetailMongo.Visible = !BatchIsAncestor; + get => cmp_batchDetailSplit.isSplitted; } - #endregion Private Methods + #endregion Public Properties + + #region Public Methods + + /// + /// Converte il codice stato in effettivo campo + /// + /// + /// + public string BStatus(object _status) + { + string answ = ComLib.BatchStatusDescr(_status); + return answ; + } + + /// + /// Controlla se lo stato sia uguale a quello richiesto + /// + /// + /// + /// + public bool checkStatus(object _status, BatchStatus statusReq) + { + bool answ = false; + int status = -1; + int.TryParse(_status.ToString(), out status); + answ = (status == (int)statusReq); + return answ; + } + + /// + /// Controlla se il type sia uguale a quello richiesto + /// + /// + /// + /// + public bool checkType(object _bType, BatchType bTypeReq) + { + bool answ = false; + int bType = -1; + int.TryParse(_bType.ToString(), out bType); + answ = (bType == (int)bTypeReq); + return answ; + } + + public void doUpdate() + { + frmView.DataBind(); + fixDisplayDesc(); + if (divSplit.Visible) + { + cmp_batchDetailSplit.doUpdate(); + } + } + + #endregion Public Methods + + #region Protected Properties + + /// + /// verifica se il batch sia di tipo ancestor (da splittare su macchine) + /// + protected bool BatchIsAncestor + { + get + { + return ComLib.BType(BatchId) == BatchType.Ancestor; + } + } + + #endregion Protected Properties #region Protected Methods @@ -87,14 +135,6 @@ namespace NKC_WF.WebUserControls raiseEvent(); } - /// - /// Verifica se il batch sia stato splittato - /// - public bool isSplitted - { - get => cmp_batchDetailSplit.isSplitted; - } - /// /// Riporta nesting a stato ESTIMATED /// @@ -113,8 +153,7 @@ namespace NKC_WF.WebUserControls { // invia a redis una richiesta... ComLib.sendMaterials(); - ComLib.sendBatchReq(BatchId, "Estimation", 3, false, 0); - + ComLib.sendBatchReq(BatchId, "Estimation", 3, false, 0, false); // ri-assegnazione ordini/kit a batch ancestor if (BatchIsAncestor) @@ -133,20 +172,6 @@ namespace NKC_WF.WebUserControls raiseEvent(); } - private void resetChildBatch() - { - var tabDesc = ComLib.BatchDescendant(BatchId); - if (tabDesc != null && tabDesc.Count > 0) - { - foreach (var item in tabDesc) - { - DLMan.taBL.updateStatus(item.BatchID, (int)BatchStatus.Imported, "", -1); - // elimino order tree eventuale... - DLMan.taOLT.deleteByBatch(item.BatchID); - } - } - } - protected void lbtSendNesting_Click(object sender, EventArgs e) { // invia a redis a a richiesta... @@ -160,8 +185,8 @@ namespace NKC_WF.WebUserControls } else { - // invio il batch corrente - ComLib.sendBatchReq(BatchId, "Nesting", 2, false, 1); + // invio il batch corrente, SENZA richiesta PNG + ComLib.sendBatchReq(BatchId, "Nesting", 2, false, 1, false); // registro su DB nesting iniziato... DLMan.taBL.updateStatus(BatchId, (int)BatchStatus.NestRequested, "", -1); } @@ -207,12 +232,6 @@ namespace NKC_WF.WebUserControls cmp_batchDetailSplit.eh_doReset += Cmp_batchDetailSplit_eh_doReset; } - private void Cmp_batchDetailSplit_eh_doReset(object sender, EventArgs e) - { - frmView.DataBind(); - fixDisplayDesc(); - } - /// /// Effettua divisione evitando zeri a den... /// @@ -227,59 +246,34 @@ namespace NKC_WF.WebUserControls #endregion Protected Methods - #region Public Methods + #region Private Methods - /// - /// Converte il codice stato in effettivo campo - /// - /// - /// - public string BStatus(object _status) - { - string answ = ComLib.BatchStatusDescr(_status); - return answ; - } - - /// - /// Controlla se lo stato sia uguale a quello richiesto - /// - /// - /// - /// - public bool checkStatus(object _status, BatchStatus statusReq) - { - bool answ = false; - int status = -1; - int.TryParse(_status.ToString(), out status); - answ = (status == (int)statusReq); - return answ; - } - - /// - /// Controlla se il type sia uguale a quello richiesto - /// - /// - /// - /// - public bool checkType(object _bType, BatchType bTypeReq) - { - bool answ = false; - int bType = -1; - int.TryParse(_bType.ToString(), out bType); - answ = (bType == (int)bTypeReq); - return answ; - } - - public void doUpdate() + private void Cmp_batchDetailSplit_eh_doReset(object sender, EventArgs e) { frmView.DataBind(); fixDisplayDesc(); - if (divSplit.Visible) + } + + private void fixDisplayDesc() + { + divSplit.Visible = BatchIsAncestor; + cmp_batchDetailMongo.Visible = !BatchIsAncestor; + } + + private void resetChildBatch() + { + var tabDesc = ComLib.BatchDescendant(BatchId); + if (tabDesc != null && tabDesc.Count > 0) { - cmp_batchDetailSplit.doUpdate(); + foreach (var item in tabDesc) + { + DLMan.taBL.updateStatus(item.BatchID, (int)BatchStatus.Imported, "", -1); + // elimino order tree eventuale... + DLMan.taOLT.deleteByBatch(item.BatchID); + } } } - #endregion Public Methods + #endregion Private Methods } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_batchList.ascx b/NKC_WF/WebUserControls/cmp_batchList.ascx index c9485b7..068b796 100644 --- a/NKC_WF/WebUserControls/cmp_batchList.ascx +++ b/NKC_WF/WebUserControls/cmp_batchList.ascx @@ -8,6 +8,7 @@
+
diff --git a/NKC_WF/WebUserControls/cmp_batchList.ascx.cs b/NKC_WF/WebUserControls/cmp_batchList.ascx.cs index eea03f9..f73cfc3 100644 --- a/NKC_WF/WebUserControls/cmp_batchList.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_batchList.ascx.cs @@ -100,6 +100,25 @@ namespace NKC_WF.WebUserControls chkShowSplit.Checked = value; } } + /// + /// Indica se abilitare creazioen automatica dei PNG x le parts nel batch + /// + public bool forceCreatePng + { + get + { + bool answ = false; + if (!string.IsNullOrEmpty(hfCreatePng.Value)) + { + bool.TryParse(hfCreatePng.Value, out answ); + } + return answ; + } + set + { + hfCreatePng.Value = $"{value}"; + } + } #endregion Public Properties @@ -245,7 +264,7 @@ namespace NKC_WF.WebUserControls // eseguo richiesta reset DLMan.taBL.redoPartValid(lbt.CommandArgument); // eventualmente mando primo batch da validare... - bool newValidSent = ComLib.sendFirstValidationBatch(); + bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); // refresh! resetSelezione(); } diff --git a/NKC_WF/WebUserControls/cmp_batchList.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_batchList.ascx.designer.cs index 388a212..2f5d407 100644 --- a/NKC_WF/WebUserControls/cmp_batchList.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_batchList.ascx.designer.cs @@ -50,6 +50,15 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HiddenField hfLastSelRow; + /// + /// hfCreatePng control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfCreatePng; + /// /// chkShowSplit control. /// diff --git a/NKC_WF/WebUserControls/cmp_validationSummary.ascx b/NKC_WF/WebUserControls/cmp_validationSummary.ascx index d73ca4b..fc62a34 100644 --- a/NKC_WF/WebUserControls/cmp_validationSummary.ascx +++ b/NKC_WF/WebUserControls/cmp_validationSummary.ascx @@ -1,6 +1,7 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_validationSummary.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_validationSummary" %> +
@@ -64,6 +65,6 @@ - + diff --git a/NKC_WF/WebUserControls/cmp_validationSummary.ascx.cs b/NKC_WF/WebUserControls/cmp_validationSummary.ascx.cs index e3f9ba9..62ee924 100644 --- a/NKC_WF/WebUserControls/cmp_validationSummary.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_validationSummary.ascx.cs @@ -7,23 +7,46 @@ namespace NKC_WF.WebUserControls { public partial class cmp_validationSummary : BaseUserControl { - #region Private Methods + #region Public Properties /// - /// fix visibilità buttons + /// Indica se abilitare creazioen automatica dei PNG x le parts nel batch /// - private void fixVisibility() + public bool forceCreatePng { - // controllo SE HO nuove PARTS da validare... - var tabItems2Valid = DLMan.taIL.getNeedValid(); - var tabItemsUnValid = DLMan.taIL.getUnValid(); - var tabItems2ReValid = DLMan.taIL.getNeedRevalid(); - lbtValidateMissing.Visible = tabItems2Valid.Count > 0; - lbtRevalidate.Visible = tabItemsUnValid.Count > 0; - lbtReValidAll.Visible = tabItems2ReValid.Count > 0; + get + { + bool answ = false; + if (!string.IsNullOrEmpty(hfCreatePng.Value)) + { + bool.TryParse(hfCreatePng.Value, out answ); + } + return answ; + } + set + { + hfCreatePng.Value = $"{value}"; + } } - #endregion Private Methods + #endregion Public Properties + + #region Public Methods + + /// + /// Update forzato + /// + public void doUpdate(bool reportEvent = true) + { + fixVisibility(); + frmView.DataBind(); + if (reportEvent) + { + raiseEvent(); + } + } + + #endregion Public Methods #region Protected Methods @@ -34,7 +57,7 @@ namespace NKC_WF.WebUserControls { DLMan.taBL.redoPartValid("*"); // eventualmente mando primo batch da validare... - bool newValidSent = ComLib.sendFirstValidationBatch(); + bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } @@ -48,7 +71,7 @@ namespace NKC_WF.WebUserControls try { // eventualmente mando primo batch da validare... - bool newValidSent = ComLib.sendFirstValidationBatch(); + bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } @@ -63,7 +86,7 @@ namespace NKC_WF.WebUserControls { DLMan.taBL.resetPartUnValid(); // eventualmente mando primo batch da validare... - bool newValidSent = ComLib.sendFirstValidationBatch(); + bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } @@ -79,7 +102,7 @@ namespace NKC_WF.WebUserControls string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("drawingFolder")}/"; DLMan.taBL.createPartValBatch(cadBasePath); // eventualmente mando primo batch da validare... - bool newValidSent = ComLib.sendFirstValidationBatch(); + bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } @@ -102,21 +125,22 @@ namespace NKC_WF.WebUserControls #endregion Protected Methods - #region Public Methods + #region Private Methods /// - /// Update forzato + /// fix visibilità buttons /// - public void doUpdate(bool reportEvent = true) + private void fixVisibility() { - fixVisibility(); - frmView.DataBind(); - if (reportEvent) - { - raiseEvent(); - } + // controllo SE HO nuove PARTS da validare... + var tabItems2Valid = DLMan.taIL.getNeedValid(); + var tabItemsUnValid = DLMan.taIL.getUnValid(); + var tabItems2ReValid = DLMan.taIL.getNeedRevalid(); + lbtValidateMissing.Visible = tabItems2Valid.Count > 0; + lbtRevalidate.Visible = tabItemsUnValid.Count > 0; + lbtReValidAll.Visible = tabItems2ReValid.Count > 0; } - #endregion Public Methods + #endregion Private Methods } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_validationSummary.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_validationSummary.ascx.designer.cs index bc89dbb..7f92f74 100644 --- a/NKC_WF/WebUserControls/cmp_validationSummary.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_validationSummary.ascx.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.WebUserControls @@ -15,74 +15,83 @@ namespace NKC_WF.WebUserControls { /// - /// Controllo updPanelDetail. + /// hfCreatePng 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 hfCreatePng; + + /// + /// updPanelDetail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.UpdatePanel updPanelDetail; /// - /// Controllo lbtForceRevali. + /// lbtForceRevali 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.LinkButton lbtForceRevali; /// - /// Controllo lbtRevalidate. + /// lbtRevalidate 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.LinkButton lbtRevalidate; /// - /// Controllo lbtReValidAll. + /// lbtReValidAll 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.LinkButton lbtReValidAll; /// - /// Controllo lbtValidateMissing. + /// lbtValidateMissing 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.LinkButton lbtValidateMissing; /// - /// Controllo frmView. + /// frmView 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.FormView frmView; /// - /// Controllo ods. + /// ods 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.ObjectDataSource ods; /// - /// Controllo Timer1. + /// Timer1 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.Timer Timer1; }