using AppData; using SteamWare; using System; using System.Web.UI; namespace NKC_WF.WebUserControls { public partial class cmp_validationSummary : BaseUserControl { #region Public Properties /// /// 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 #region Public Methods /// /// Update forzato /// public void doUpdate(bool reportEvent = true) { fixVisibility(); frmView.DataBind(); if (reportEvent) { raiseEvent(); } } #endregion Public Methods #region Protected Methods protected void lbtForceRevali_Click(object sender, EventArgs e) { // rimetto da validare tramite stored try { DLMan.taBL.redoPartValid("*"); // eventualmente mando primo batch da validare... bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } // update! doUpdate(); } protected void lbtRevalAll_Click(object sender, EventArgs e) { // rimetto da validare tramite stored try { // eventualmente mando primo batch da validare... bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } // update! doUpdate(); } protected void lbtRevalidate_Click(object sender, EventArgs e) { // rimetto da validare tramite stored try { DLMan.taBL.resetPartUnValid(); // eventualmente mando primo batch da validare... bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } // update! doUpdate(); } protected void lbtValidateMissing_Click(object sender, EventArgs e) { // chiamo stored x creazione NUOVI BATCH... try { string cadBasePath = $"{memLayer.ML.CRS("nestBasePath")}{memLayer.ML.CRS("drawingFolder")}/"; DLMan.taBL.createPartValBatch(cadBasePath); // eventualmente mando primo batch da validare... bool newValidSent = ComLib.sendFirstValidationBatch(forceCreatePng); } catch { } // update! doUpdate(); } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { fixVisibility(); } } protected void Timer1_Tick(object sender, EventArgs e) { doUpdate(); } #endregion Protected Methods #region Private Methods /// /// fix visibilità buttons /// private void fixVisibility() { // 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 Private Methods } }