using Microsoft.AspNetCore.Components; using MP.Data.Services; using NLog; namespace MP_TAB3.Pages { public partial class MachineDetail { #region Protected Properties [Inject] protected SharedMemService MStor { get; set; } = null!; [Inject] protected TabDataService TabServ { get; set; } = null!; #endregion Protected Properties #region Protected Methods protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); // recupero parametri configurazione... await setupConf(); if (enableSchedaTecnica) { checkLottiOdl(); } } protected void SetMacc(string selIdxMacc) { IdxMaccSubSel = selIdxMacc; } #endregion Protected Methods #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); private bool enableMagLotti = false; private bool enableSchedaTecnica = false; private string IdxMaccSubSel = ""; private DateTime lastSave = DateTime.Now; #endregion Private Fields #region Private Methods private void checkLottiOdl() { #if false // controlla se abilitato check LOTTI MAG if (enableMagLotti) { if (idxOdl > 0) { // controlla se ci sia lotto x ODL if (DataLayerObj.taMagELotti.getByODL(idxOdl).Rows.Count == 0) { try { // se non c'� chiama stored x rigenerare DataLayerObj.taMagELotti.UpsertByOdl(idxOdl, true); } catch { } } } } #endif } private async Task setupConf() { enableSchedaTecnica = MStor.GetConfBool("enableSchedaTecnica"); enableMagLotti = MStor.GetConfBool("enableMagLotti"); await Task.Delay(1); } #endregion Private Methods } }