diff --git a/MP.IOC/Components/Layout/NavMenu.razor b/MP.IOC/Components/Layout/NavMenu.razor index 74f53187..c3b47ab6 100644 --- a/MP.IOC/Components/Layout/NavMenu.razor +++ b/MP.IOC/Components/Layout/NavMenu.razor @@ -49,16 +49,8 @@ } - - *@ } diff --git a/MP.IOC/Components/Pages/RouteConf.razor b/MP.IOC/Components/Pages/RouteConf.razor index 8c5bc43c..2d68634b 100644 --- a/MP.IOC/Components/Pages/RouteConf.razor +++ b/MP.IOC/Components/Pages/RouteConf.razor @@ -1,27 +1,85 @@ @page "/RouteConf"
-

Route Configuration (IO/IOC)

+
+
+

Route Configuration (IO/IOC)

+
+
+
+ + + +
+
+
+ - - + + + + @foreach (var record in ListPaged) { + - - + + + + } + + + + +
+ + MetodoIO %IOC %IO %BalanceIOC %
+ @if (SelRecord == null) + { + + } + else + { + if (SelRecord.Method == record.Method) + { + + } + else + { + + } + } + @record.Method@record.OldWeight@record.NewWeight + + @record.OldWeight + + + + + + @record.NewWeight + + + @if (SelRecord != null && SelRecord.Method == record.Method) + { + + } +
+ +
+
\ No newline at end of file diff --git a/MP.IOC/Components/Pages/RouteConf.razor.cs b/MP.IOC/Components/Pages/RouteConf.razor.cs index ece23e90..18edc714 100644 --- a/MP.IOC/Components/Pages/RouteConf.razor.cs +++ b/MP.IOC/Components/Pages/RouteConf.razor.cs @@ -6,6 +6,28 @@ namespace MP.IOC.Components.Pages { public partial class RouteConf { + #region Protected Properties + + protected string CssReset + { + get => string.IsNullOrEmpty(SearchVal) ? "btn-outline-secondary" : "btn-primary"; + } + + protected string SearchVal + { + get => _searchVal; + set + { + if (_searchVal != value) + { + _searchVal = value; + UpdateTable(); + } + } + } + + #endregion Protected Properties + #region Protected Methods protected string CheckSelect(WeightDTO currRec) @@ -20,19 +42,30 @@ namespace MP.IOC.Components.Pages UpdateTable(); } + protected void ResetSearch() + { + SearchVal = ""; + //UpdateTable(); + } + #endregion Protected Methods #region Private Fields + private string _searchVal = ""; + private List ListComplete = new(); private List ListPaged = new(); + private List ListSearch = new(); + private int numRecPage = 10; private int pageNum = 1; private WeightDTO? SelRecord = null; + private int totalCount = 0; #endregion Private Fields @@ -46,10 +79,30 @@ namespace MP.IOC.Components.Pages #region Private Methods + /// + /// Edit record selezionato + /// + /// + private void DoEdit(WeightDTO curRec) + { + SelRecord = curRec; + } + + private void DoReset() + { + SelRecord = null; + } + + private void DoSave(WeightDTO updRec) + { + // salvo e resetto... + + SelRecord = null; + } + private async Task ReloadData() { ListComplete = await WService.GetAllWeightsAsync(); - totalCount = ListComplete.Count(); } private void SaveNumRec(int newNum) @@ -66,14 +119,26 @@ namespace MP.IOC.Components.Pages private void UpdateTable() { - // esegue paginazione - if (totalCount > numRecPage) + // effettuo eventuale ricerca + conteggio... + if (string.IsNullOrEmpty(SearchVal)) { - ListPaged = ListComplete.Skip((pageNum - 1) * numRecPage).Take(numRecPage).ToList(); + ListSearch = ListComplete; } else { - ListPaged = ListComplete; + ListSearch = ListComplete + .Where(x => x.Method.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase)) + .ToList(); + } + totalCount = ListSearch.Count(); + // esegue paginazione + if (totalCount > numRecPage) + { + ListPaged = ListSearch.Skip((pageNum - 1) * numRecPage).Take(numRecPage).ToList(); + } + else + { + ListPaged = ListSearch; } } diff --git a/MP.IOC/Controllers/IOBController.cs b/MP.IOC/Controllers/IOBController.cs index 12f2241a..ac09fab3 100644 --- a/MP.IOC/Controllers/IOBController.cs +++ b/MP.IOC/Controllers/IOBController.cs @@ -13,10 +13,8 @@ namespace MP.IOC.Controllers public IOBController(IConfiguration configuration, MpDataService DataService) { - Log.Info("Starting IOBController"); _configuration = configuration; DService = DataService; - Log.Info("Avviato IOBController"); } @@ -82,29 +80,19 @@ namespace MP.IOC.Controllers [HttpGet("enabled/{id}")] public string enabled(string id) { - string answ = "ND"; - // se id nullo --> KO! - if (id == null) - { - answ = "KO"; - } - else - { - try - { - answ = DService.IobInsEnab(id) ? "OK" : "NO"; + if (string.IsNullOrEmpty(id)) return "KO"; - //// 2025.03.04 aggiunto keepalive x evitare C101 - //MapoDb.MapoDb connDb = new MapoDb.MapoDb(); - //connDb.scriviKeepAlive(id, DateTime.Now); - } - catch (Exception exc) - { - Log.Error($"Errore in enabled{Environment.NewLine}{exc}"); - answ = "NO"; - } + try + { + var result = DService.IobInsEnab(id) ? "OK" : "NO"; + // Logga solo l'esito se necessario + return result; + } + catch (Exception exc) + { + Log.Error($"Errore in enabled {id}: {exc.Message}"); + return "NO"; } - return answ; } ///// AGGIUNGE TASK richiesto x macchina: diff --git a/MP.IOC/MP.IOC.csproj b/MP.IOC/MP.IOC.csproj index 3e24d840..da4a0e09 100644 --- a/MP.IOC/MP.IOC.csproj +++ b/MP.IOC/MP.IOC.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 6.16.2604.1010 + 6.16.2604.1011 diff --git a/MP.IOC/Resources/ChangeLog.html b/MP.IOC/Resources/ChangeLog.html index 06b3bac4..4e51627c 100644 --- a/MP.IOC/Resources/ChangeLog.html +++ b/MP.IOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-IOC -

Versione: 6.16.2604.1010

+

Versione: 6.16.2604.1011


Note di rilascio:
  • diff --git a/MP.IOC/Resources/VersNum.txt b/MP.IOC/Resources/VersNum.txt index 23941d63..89c61afb 100644 --- a/MP.IOC/Resources/VersNum.txt +++ b/MP.IOC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2604.1010 +6.16.2604.1011 diff --git a/MP.IOC/Resources/manifest.xml b/MP.IOC/Resources/manifest.xml index c34b9278..ba9f0d17 100644 --- a/MP.IOC/Resources/manifest.xml +++ b/MP.IOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2604.1010 + 6.16.2604.1011 https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html false