diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index ead7a188..046f73d0 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -742,19 +742,18 @@ namespace MP.Data.Controllers } /// - /// Recupero Odl CORRENTE x macchina (SE c'è) + /// Recupero Odl CORRENTI /// - /// /// - public ODLModel OdlGetCurrentByMacc(string idxMacchina) + public List OdlGetCurrent() { - ODLModel dbResult = new ODLModel(); - + List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) { dbResult = dbCtx .DbSetODL - .FirstOrDefault(x => x.IdxMacchina == idxMacchina && x.DataInizio != null && x.DataFine == null); + .Where(x => x.DataInizio != null && x.DataFine == null) + .ToList(); } return dbResult; } @@ -932,6 +931,7 @@ namespace MP.Data.Controllers currRec.KeyRichiesta = editRec.KeyRichiesta; currRec.NumPezzi = editRec.NumPezzi; currRec.Tcassegnato = editRec.Tcassegnato; + currRec.Attivabile = editRec.Attivabile; currRec.Note = editRec.Note; dbCtx.Entry(currRec).State = EntityState.Modified; } diff --git a/MP.SPEC/Components/Chart/Doughnut.razor.cs b/MP.SPEC/Components/Chart/Doughnut.razor.cs index 52b21dc9..e8c77ffb 100644 --- a/MP.SPEC/Components/Chart/Doughnut.razor.cs +++ b/MP.SPEC/Components/Chart/Doughnut.razor.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using MP.Data; +using MP.SPEC.Data; using static System.Net.Mime.MediaTypeNames; namespace MP.SPEC.Components.Chart @@ -28,7 +29,7 @@ namespace MP.SPEC.Components.Chart public double[] Data { get; set; } [Parameter] - public string[] BackgroundColor { get; set; } + public List BackgroundColor { get; set; } [Parameter] public string[] Labels { get; set; } @@ -46,7 +47,7 @@ namespace MP.SPEC.Components.Chart { Datasets = new[] { - new { Data = Data, BackgroundColor = BackgroundColor + new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 1, borderRadius = 0 } }, Labels = Labels diff --git a/MP.SPEC/Components/DataPager.razor.cs b/MP.SPEC/Components/DataPager.razor.cs index dc625ff6..5fdb615f 100644 --- a/MP.SPEC/Components/DataPager.razor.cs +++ b/MP.SPEC/Components/DataPager.razor.cs @@ -98,7 +98,7 @@ namespace MP.SPEC.Components protected int _numRecord { get; set; } = 10; - protected int percLoading { get; set; } = 0; + protected int percLoading { get; set; } = 0; #endregion Protected Properties diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 4fde0b3a..09b6ee5b 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Data; namespace MP.SPEC.Components { - public partial class ListDossiers + public partial class ListDossiers: IDisposable { #region Public Properties @@ -40,6 +40,16 @@ namespace MP.SPEC.Components } return answ; } + public void Dispose() + { + MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated; + MessageService.EA_SearchUpdated -= OnSeachUpdated; + currRecord = null; + SearchRecords = null; + ListRecords = null; + GC.Collect(); + } + #endregion Public Methods @@ -81,18 +91,6 @@ namespace MP.SPEC.Components await RecordSelFlux.InvokeAsync(selRec); } - protected string findRec(FluxLog record) - { - string answ = ""; -#if false - if (ListRecordsMod != null) - { - answ = ListRecordsMod.Where(l => l.IdxMacchina == record.IdxMacchina && l.CodFlux == record.CodFlux).Select(x => x.Valore).SingleOrDefault(); - } -#endif - return answ; - } - protected override async Task OnInitializedAsync() { MessageService.EA_PageUpdated += MessageService_EA_PageUpdated; diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 838f5857..0bf33530 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -15,13 +15,14 @@ else @if (currRecord != null && !showStats && isCurrOdl) {
+
@*
- - - -
*@ + + + +
*@ } @@ -178,10 +179,6 @@ else - - - - @@ -224,7 +221,7 @@ else
-
@($"{calcolaPerc(stat.TotDurata):N1}%")
+
@($"{calcolaPerc(stat.TotDurata):N1}%")
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 897c8f71..97105efa 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -1,14 +1,12 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; -using MP.Data; using MP.Data.DatabaseModels; using MP.SPEC.Data; -using MP.SPEC.Pages; -using System.Xml.Linq; +using MP.SPEC.Services; namespace MP.SPEC.Components { - public partial class ListODL + public partial class ListODL : IDisposable { #region Public Properties @@ -40,39 +38,26 @@ namespace MP.SPEC.Components return answ; } + public void Dispose() + { + currRecord = null; + SearchRecords = null; + ListRecords = null; + ListStati = null; + ListOdlStats = null; + statRecord = null; + GC.Collect(); + } + public string formDurata(double durataMin) { return MP.Data.Utils.FormDurata(durataMin); } - //oggetto contenente le funzioni del code behind che sono jsInvokable - private DotNetObjectReference? objRef; - -#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE - - [JSInvokable] - public void setHelper() - { - objRef = DotNetObjectReference.Create(this); - } - [JSInvokable] - public void svuotaRecord() - { - currRecord = null; - - } - public async Task TriggerDotNetInstanceMethod() - { - await JSRuntime.InvokeVoidAsync("recordDeselect", objRef); - } -#endif - #endregion Public Methods #region Protected Properties - - [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; @@ -80,7 +65,7 @@ namespace MP.SPEC.Components protected MpDataService MDService { get; set; } = null!; [Inject] - protected MessageService MessageService { get; set; } = null!; + protected IOApiService MpIoApiCall { get; set; } = null!; #endregion Protected Properties @@ -105,18 +90,6 @@ namespace MP.SPEC.Components await reloadData(); } - protected override async Task OnInitializedAsync() - { - ListStati = await MDService.AnagStatiComm(); - objRef = DotNetObjectReference.Create(this); - //await JSRuntime.InvokeVoidAsync("setHelper", objRef); - } - - protected override async Task OnParametersSetAsync() - { - await reloadData(); - } - protected string colorChanger(string colorCSS) { string answ = ""; @@ -127,13 +100,33 @@ namespace MP.SPEC.Components return answ; } - //protected double durataMin(DateTime? DataInizio, DateTime? DataFine) - //{ - // DateTime end = DataInizio != null ? (DateTime)DataFine : DateTime.Now; - // var tsDurata = (end).Subtract((DateTime)DataInizio); + /// + /// Richiesta invio sync all'IOB-WIN + /// + /// + protected async Task forceSyncDb() + { + if (!await JSRuntime.InvokeAsync("confirm", "Sei sicuro di voler reinviare i dati (Articoli, PODL) all'impianto?")) + return; - // return tsDurata.TotalMinutes; - //} + if (currRecord != null) + { + await callSyncDb(currRecord.IdxMacchina); + // ricarica... + await selectRecord(null); + } + await reloadData(); + } + + protected override async Task OnInitializedAsync() + { + ListStati = await MDService.AnagStatiComm(); + } + + protected override async Task OnParametersSetAsync() + { + await reloadData(); + } protected async void OnSeachUpdated() { @@ -167,6 +160,7 @@ namespace MP.SPEC.Components ListOdlStats = null; } } + protected async Task selectStatRecord(ODLModel? currRec) { showStats = true; @@ -205,8 +199,6 @@ namespace MP.SPEC.Components private ODLModel? currRecord = null; - private ODLModel? statRecord = null; - private List? ListOdlStats; private List? ListRecords; @@ -215,14 +207,18 @@ namespace MP.SPEC.Components private List? SearchRecords; + private ODLModel? statRecord = null; + #endregion Private Fields #region Private Properties + private int _totalCount { get; set; } = 0; + private int currPage { - get => MessageService.currPage; - set => MessageService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } /// @@ -237,22 +233,49 @@ namespace MP.SPEC.Components private int numRecord { - get => MessageService.numRecord; - set => MessageService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private DateTime selDtFine { get; set; } = DateTime.Now; + private bool showStats { get; set; } = false; -#if false - private List? ListOdlStatsData = new List(); - private List? ListOdlStatsLabels = new List(); -#endif - private int totalCount { get; set; } = 0; + + private int totalCount + { + get => _totalCount; + set + { + if (_totalCount != value) + { + _totalCount = value; + updateRecordCount.InvokeAsync(value); + } + } + } #endregion Private Properties #region Private Methods + /// + /// Chiama metodo x chiedere sync DB + /// + /// + /// + private async Task addTask2Exe(string idxMacc, string taskName, string taskVal) + { + // compongo URL e chiamo + string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}"; + try + { + var response = await MpIoApiCall.callMpIoUrlGet(restUrl); + } + catch (Exception exc) + { + } + } + private double calcolaPerc(double durata) { double answ = 0; @@ -278,9 +301,36 @@ namespace MP.SPEC.Components return answ; } - private async void MessageService_EA_PageUpdated() + /// + /// Chiama metodo x chiedere sync DB + /// + /// + /// + private async Task callSyncDb(string IdxMacc) { - await reloadData(); + // chiamo aggiunta task SyncDb... + await addTask2Exe(IdxMacc, "syncDbData", ""); + } + + private string pbStyle(string css) + { + string answ = ""; + if (ListOdlStats != null) + { + if (css == "yellow") + { + answ = "orange"; + } + else if (css == "blue") + { + answ = "#2874A6"; + } + else + { + answ = css; + } + } + return answ; } private async Task reloadData() @@ -291,7 +341,6 @@ namespace MP.SPEC.Components ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); - await updateRecordCount.InvokeAsync(totalCount); isLoading = false; } diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index c699b8fe..9b8844ed 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -62,6 +62,10 @@ namespace MP.SPEC.Components MessageService.EA_SearchUpdated -= OnSeachUpdated; aTimer.Stop(); aTimer.Dispose(); + currRecord = null; + SearchRecords = null; + ListRecords = null; + GC.Collect(); } public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e) diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index dafd63f2..85641a6c 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -1,7 +1,7 @@ @using MP.SPEC.Components @using MP.SPEC.Data -@if (ListRecords == null) +@if (ListRecords == null || isLoading) { } diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index ad5575e3..52150c77 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -6,10 +6,15 @@ using MP.SPEC.Services; namespace MP.SPEC.Components { - public partial class ListPODL + public partial class ListPODL : IDisposable { #region Public Properties + [Parameter] + public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams(); + + private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; + [Parameter] public EventCallback PagerResetReq { get; set; } @@ -40,6 +45,15 @@ namespace MP.SPEC.Components #endregion Public Methods + public void Dispose() + { + currRecord = null; + SearchRecords = null; + ListRecords = null; + ListStati = null; + GC.Collect(); + } + #region Protected Properties [Inject] @@ -51,9 +65,6 @@ namespace MP.SPEC.Components [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; - [Inject] - protected MessageService MsgService { get; set; } = null!; - #endregion Protected Properties #region Protected Methods @@ -103,15 +114,17 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { - MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; - MsgService.EA_SearchUpdated += OnSeachUpdated; - MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; + //await FilterChanged.InvokeAsync(actFilter); ListStati = await MDService.AnagStatiComm(); } protected override async Task OnParametersSetAsync() { - await reloadData(); + if (!lastFilter.Equals(actFilter)) + { + lastFilter = actFilter.clone(); + await reloadData(); + } } protected async void OnSeachUpdated() @@ -210,32 +223,45 @@ namespace MP.SPEC.Components #region Private Properties + private int _totalCount { get; set; } = 0; + private int currPage { - get => MsgService.currPage; - set => MsgService.currPage = value; + get => actFilter.CurrPage; + set => actFilter.CurrPage = value; } private bool isLoading { get; set; } = false; private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => actFilter.NumRec; + set => actFilter.NumRec = value; } private string SearchVal { - get => string.IsNullOrEmpty(MsgService.SearchVal) ? "*" : MsgService.SearchVal; + get => string.IsNullOrEmpty(actFilter.SearchVal) ? "*" : actFilter.SearchVal; } private string StatoSel { - get => MsgService.StateSel; - set => MsgService.StateSel = value; + get => actFilter.CodFase; + set => actFilter.CodFase = value; } - private int totalCount { get; set; } = 0; + private int totalCount + { + get => _totalCount; + set + { + if (_totalCount != value) + { + _totalCount = value; + updateRecordCount.InvokeAsync(value); + } + } + } #endregion Private Properties @@ -254,7 +280,7 @@ namespace MP.SPEC.Components { var response = await MpIoApiCall.callMpIoUrlGet(restUrl); } - catch(Exception exc) + catch (Exception exc) { } } @@ -290,11 +316,6 @@ namespace MP.SPEC.Components { // chiamo aggiunta task SyncDb... await addTask2Exe(IdxMacc, "syncDbData", ""); -#if false - string idxMacc = selRec.IdxMacchina; - string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal="; - var response = await MpIoApiCall.callMpIoUrlGet(restUrl); -#endif } /// @@ -304,27 +325,11 @@ namespace MP.SPEC.Components /// private bool canStartOdl(string idxMacchina) { - var currOdl = MDService.OdlGetCurrentByMacc(idxMacchina); - bool answ = currOdl == null; + var listOdlCurr = MDService.OdlGetCurrent(); + bool answ = !listOdlCurr.Contains(idxMacchina); return answ; } - private async void MessageService_EA_PageUpdated() - { - await reloadData(); - } - - private async void MsgService_EA_StatoSearch() - { - await InvokeAsync(() => - { - PagerResetReq.InvokeAsync(true); - //currPage = 1; - Task task = UpdateData(); - StateHasChanged(); - }); - } - /// /// processa evento richiesto /// @@ -367,7 +372,7 @@ namespace MP.SPEC.Components ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); - await updateRecordCount.InvokeAsync(totalCount); + //await updateRecordCount.InvokeAsync(totalCount); isLoading = false; } diff --git a/MP.SPEC/Components/ODLPlot.razor b/MP.SPEC/Components/ODLPlot.razor index 325b78fb..bbecf152 100644 --- a/MP.SPEC/Components/ODLPlot.razor +++ b/MP.SPEC/Components/ODLPlot.razor @@ -7,7 +7,7 @@ } else { - + } } \ No newline at end of file diff --git a/MP.SPEC/Components/ODLPlot.razor.cs b/MP.SPEC/Components/ODLPlot.razor.cs index 475a5db4..666e3af4 100644 --- a/MP.SPEC/Components/ODLPlot.razor.cs +++ b/MP.SPEC/Components/ODLPlot.razor.cs @@ -49,7 +49,7 @@ namespace MP.SPEC.Components public List Data = new List(); public List Labels = new List(); - public List colors = new List(); + public List colors = new List(); protected async Task ReloadData() { @@ -61,7 +61,20 @@ namespace MP.SPEC.Components { Data.Add(record.TotDurata); Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min"); - colors.Add($"{record.Css}"); + if (record.Css == "yellow") + { + colors.Add(new DoughnutStyling("orange", "ccc")); + } + else if (record.Css == "blue") + { + colors.Add(new DoughnutStyling("#2874A6", "ccc")); + } + else + { + colors.Add(new DoughnutStyling(record.Css, "ccc")); + } + + } await Task.Delay(1); isLoading = false; diff --git a/MP.SPEC/Data/DoughnutStyling.cs b/MP.SPEC/Data/DoughnutStyling.cs new file mode 100644 index 00000000..54a76b53 --- /dev/null +++ b/MP.SPEC/Data/DoughnutStyling.cs @@ -0,0 +1,16 @@ +using System.Drawing; + +namespace MP.SPEC.Data +{ + public class DoughnutStyling + { + public string color { get; set; } + public string border { get; set; } + + public DoughnutStyling(string color, string border) + { + this.color = color; + this.border = border; + } + } +} diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 73f64ab4..84547397 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -665,38 +665,42 @@ namespace MP.SPEC.Data } /// - /// ODL corrente x macchina + /// ODL correnti (tutti) /// /// /// - public ODLModel OdlGetCurrentByMacc(string idxMacchina) + public List OdlGetCurrent() { - ODLModel dbResult = new ODLModel(); + List dbResult = new List(); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); string readType = "DB"; - string currKey = $"{redisOdlCurrByMac}:{idxMacchina}"; + string currKey = $"{redisOdlCurrByMac}"; // cerco in redis dato valore sel macchina... RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { - dbResult = JsonConvert.DeserializeObject($"{rawData}"); + try + { + dbResult = JsonConvert.DeserializeObject>($"{rawData}"); + } + catch + { } readType = "REDIS"; } else { - dbResult = dbController.OdlGetCurrentByMacc(idxMacchina); - // serializzp e salvo... + dbResult = dbController.OdlGetCurrent().Select(x => x.IdxMacchina).Distinct().ToList(); rawData = JsonConvert.SerializeObject(dbResult); redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); } if (dbResult == null) { - dbResult = new ODLModel(); + dbResult = new List(); } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Debug($"OdlGetCurrentByMacc | Read from {readType}: {ts.TotalMilliseconds}ms"); + Log.Debug($"OdlGetCurrent | Read from {readType}: {ts.TotalMilliseconds}ms"); return dbResult; diff --git a/MP.SPEC/Data/SelectOdlParams.cs b/MP.SPEC/Data/SelectOdlParams.cs index 47a23ad0..f9c089dd 100644 --- a/MP.SPEC/Data/SelectOdlParams.cs +++ b/MP.SPEC/Data/SelectOdlParams.cs @@ -17,6 +17,7 @@ namespace MP.SPEC.Data public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; public int NumRec { get; set; } = 10; + public int TotCount { get; set; } = 0; public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5); public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7); public int MaxRecord { get; set; } = 100; diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs new file mode 100644 index 00000000..a4836926 --- /dev/null +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -0,0 +1,83 @@ +namespace MP.SPEC.Data +{ + public class SelectPOdlParams + { + #region Public Constructors + + public SelectPOdlParams() + { } + + #endregion Public Constructors + + #region Public Properties + + public string CodFase { get; set; } = "*"; + + public int CurrPage { get; set; } = 1; + + public string IdxMacchina { get; set; } = "*"; + + public int MaxRecord { get; set; } = 100; + + public int NumRec { get; set; } = 10; + + public string SearchVal { get; set; } = "*"; + + public int TotCount { get; set; } = 0; + + #endregion Public Properties + + #region Public Methods + + public SelectPOdlParams clone() + { + SelectPOdlParams clonedData = new SelectPOdlParams() + { + CodFase = this.CodFase, + CurrPage = this.CurrPage, + IdxMacchina = this.IdxMacchina, + MaxRecord = this.MaxRecord, + NumRec = this.NumRec, + SearchVal = this.SearchVal, + TotCount = this.TotCount + }; + return clonedData; + } + + public override bool Equals(object obj) + { + if (!(obj is SelectPOdlParams item)) + return false; + + if (CodFase != item.CodFase) + return false; + + if (MaxRecord != item.MaxRecord) + return false; + + if (NumRec != item.NumRec) + return false; + + if (TotCount != item.TotCount) + return false; + + if (CurrPage != item.CurrPage) + return false; + + if (IdxMacchina != item.IdxMacchina) + return false; + + if (SearchVal != item.SearchVal) + return false; + + return true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index fa062dff..bd297fa3 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1810 + 6.16.2210.1817 diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs index 577db802..25bceea2 100644 --- a/MP.SPEC/Pages/Articoli.razor.cs +++ b/MP.SPEC/Pages/Articoli.razor.cs @@ -27,6 +27,12 @@ namespace MP.SPEC.Pages public void Dispose() { MessageService.EA_SearchUpdated -= OnSeachUpdated; + currRecord = null; + ListTipoArt = null; + ListAziende = null; + SearchRecords = null; + ListRecords = null; + GC.Collect(); } public async void OnSeachUpdated() diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index a9b5aba2..a8ff4f78 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -26,7 +26,7 @@ namespace MP.SPEC.Pages #region Protected Fields - protected DataPager pagerODL; + protected DataPager pagerODL = null!; #endregion Protected Fields @@ -44,9 +44,6 @@ namespace MP.SPEC.Pages [Inject] protected MpDataService MDService { get; set; } = null!; - [Inject] - protected MessageService MsgService { get; set; } = null!; - protected DateTime selDtEnd { get => currFilter.DtEnd; @@ -87,16 +84,8 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { - // abilito ricerca... - MsgService.ShowSearch = true; - // resetto search - MsgService.SearchVal = ""; ListStati = await MDService.AnagStatiComm(); ListMacchine = await MDService.MacchineWithFlux(); -#if false - // carico dati - await reloadData(); -#endif } protected async Task pgResetReq(bool doReset) @@ -134,8 +123,8 @@ namespace MP.SPEC.Pages private int currPage { - get => MsgService.currPage; - set => MsgService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } private bool isLoading { get; set; } = false; @@ -147,8 +136,8 @@ namespace MP.SPEC.Pages private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private string rightStringCSS @@ -169,8 +158,8 @@ namespace MP.SPEC.Pages private int totalCount { - get => MsgService.totalCount; - set => MsgService.totalCount = value; + get => currFilter.TotCount; + set => currFilter.TotCount = value; } #endregion Private Properties diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 884921cd..edd74ebb 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -4,7 +4,7 @@
-
+

Promesse ODL

@@ -17,9 +17,9 @@
-
+
- + @* + *@ - @if (ListStati != null) { @@ -222,13 +222,10 @@ } else { - + }
-
- - - +
\ No newline at end of file diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 10e1038d..b9699f04 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -11,7 +11,7 @@ namespace MP.SPEC.Pages { #region Protected Fields - protected DataPager pagerODL; + protected DataPager pagerODL = null!; protected bool reqNew = false; @@ -28,9 +28,6 @@ namespace MP.SPEC.Pages [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; - [Inject] - protected MessageService MsgService { get; set; } = null!; - [Inject] protected NavigationManager NavManager { get; set; } = null!; @@ -70,10 +67,6 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { - // abilito ricerca... - MsgService.ShowSearch = true; - // resetto search - MsgService.SearchVal = ""; ListAziende = await MDService.ElencoAziende(); ListGruppiFase = await MDService.ElencoGruppiFase(); ListMacchine = await MDService.MacchineGetAll(); @@ -110,7 +103,7 @@ namespace MP.SPEC.Pages var firstArt = ListArticoli.FirstOrDefault(); currArticolo = firstArt != null ? firstArt.CodArticolo : ""; } - string codExt = $"{selStato}"; + string codExt = $"{currFase}"; string codGruppo = ""; if (ListGruppiFase != null && ListGruppiFase.Count > 0) { @@ -170,15 +163,10 @@ namespace MP.SPEC.Pages #region Private Fields private PODLModel? _currRecord = null; - private List? ListArticoli; - private List? ListAziende; - private List? ListGruppiFase; - private List? ListMacchine; - private List? ListStati; #endregion Private Fields @@ -186,12 +174,11 @@ namespace MP.SPEC.Pages #region Private Properties private string _artSearch { get; set; } = ""; - private string _currAzienda { get; set; } = "*"; private bool addEnabled { - get => selStato != "*"; + get => currFase != "*"; } private string artSearch @@ -217,7 +204,6 @@ namespace MP.SPEC.Pages } private List? configData { get; set; } = null; - private string currArticolo { get; set; } = ""; private string currAzienda @@ -237,10 +223,12 @@ namespace MP.SPEC.Pages } } + private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams(); + private int currPage { - get => MsgService.currPage; - set => MsgService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } private PODLModel? currRecord @@ -257,20 +245,27 @@ namespace MP.SPEC.Pages private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } - private string selStato + private string currFase { - get => MsgService.StateSel; - set => MsgService.StateSel = value; + get => currFilter.CodFase; + set + { + if (!currFilter.CodFase.Equals(value)) + { + currFilter.CodFase = value; + currPage = 1; + } + } } private int totalCount { - get => MsgService.totalCount; - set => MsgService.totalCount = value; + get => currFilter.TotCount; + set => currFilter.TotCount = value; } #endregion Private Properties diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index af7eb687..64a26b06 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1810

+

Versione: 6.16.2210.1817


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index d2be8c80..458a9aa8 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1810 +6.16.2210.1817 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index d4046f3a..4f3dec63 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1810 + 6.16.2210.1817 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false