diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs
index 929c3344..1c0f822f 100644
--- a/MP.Data/Controllers/MpSpecController.cs
+++ b/MP.Data/Controllers/MpSpecController.cs
@@ -79,6 +79,15 @@ namespace MP.Data.Controllers
return ListValuesFilt("AnagArticoli", "Tipo");
}
+ ///
+ /// Elenco valori ammessi x Stati commessa (es Yacht Baglietto)
+ ///
+ ///
+ public List AnagStatiComm()
+ {
+ return ListValuesFilt("PODL", "StatoComm");
+ }
+
///
/// Elenco valori link (x home e navMenu laterale)
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 70069dad..10cb7fff 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -69,9 +69,38 @@ namespace MP.SPEC.Data
public async Task> AnagTipoArtLV()
{
- return await Task.FromResult(dbController.AnagTipoArtLV());
+ int maxAgeConfig = 5;
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ List? result = new List();
+ // cerco in redis...
+ RedisValue rawData = await redisDb.StringGetAsync(redisTipoArt);
+ if (!string.IsNullOrEmpty($"{rawData}"))
+ {
+ result = JsonConvert.DeserializeObject>($"{rawData}");
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"AnagTipoArtLV Read from REDIS: {ts.TotalMilliseconds}ms");
+ }
+ else
+ {
+ result = await Task.FromResult(dbController.AnagTipoArtLV());
+ // serializzp e salvo...
+ rawData = JsonConvert.SerializeObject(result);
+ await redisDb.StringSetAsync(redisTipoArt, rawData, TimeSpan.FromMinutes(maxAgeConfig));
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"AnagTipoArtLV Read from DB: {ts.TotalMilliseconds}ms");
+ }
+ if (result == null)
+ {
+ result = new List();
+ }
+ return result;
}
+
+
///
/// Eliminazione record selezionato
///
@@ -202,6 +231,38 @@ namespace MP.SPEC.Data
return result;
}
+ public async Task> AnagStatiComm()
+ {
+ int maxAgeConfig = 5;
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ List? result = new List();
+ // cerco in redis...
+ RedisValue rawData = await redisDb.StringGetAsync(redisStatoCom);
+ if (!string.IsNullOrEmpty($"{rawData}"))
+ {
+ result = JsonConvert.DeserializeObject>($"{rawData}");
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"AnagStatiComm Read from REDIS: {ts.TotalMilliseconds}ms");
+ }
+ else
+ {
+ result = await Task.FromResult(dbController.AnagStatiComm());
+ // serializzp e salvo...
+ rawData = JsonConvert.SerializeObject(result);
+ await redisDb.StringSetAsync(redisStatoCom, rawData, TimeSpan.FromMinutes(maxAgeConfig));
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"AnagStatiComm Read from DB: {ts.TotalMilliseconds}ms");
+ }
+ if (result == null)
+ {
+ result = new List();
+ }
+ return result;
+ }
+
///
/// Reset dati cache config
///
@@ -330,6 +391,8 @@ namespace MP.SPEC.Data
private int fastRefreshMs = 1000;
private string redisConfKey = "MP:MON:Cache:Config";
+ private string redisTipoArt = "MP:MON:Cache:TipoArt";
+ private string redisStatoCom = "MP:MON:Cache:StatoCom";
///
/// Oggetto per connessione a REDIS
diff --git a/MP.SPEC/Pages/ODL.razor b/MP.SPEC/Pages/ODL.razor
index 71321c43..57978dd3 100644
--- a/MP.SPEC/Pages/ODL.razor
+++ b/MP.SPEC/Pages/ODL.razor
@@ -1,7 +1,43 @@
@page "/ODL"
-ODL
-@code {
-}
+
+
+
diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs
new file mode 100644
index 00000000..1e203e99
--- /dev/null
+++ b/MP.SPEC/Pages/ODL.razor.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Components;
+using System.Net.Http;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Components.Authorization;
+using Microsoft.AspNetCore.Components.Forms;
+using Microsoft.AspNetCore.Components.Routing;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.AspNetCore.Components.Web.Virtualization;
+using Microsoft.JSInterop;
+using MP.SPEC;
+using MP.SPEC.Shared;
+using MP.SPEC.Components;
+using MP.SPEC.Data;
+
+namespace MP.SPEC.Pages
+{
+ public partial class ODL
+ {
+
+ private List? ListStati;
+
+ [Inject]
+ protected IJSRuntime JSRuntime { get; set; }
+
+ [Inject]
+ protected MpDataService MDService { get; set; }
+
+ [Inject]
+ protected MessageService MessageService { get; set; }
+
+ [Inject]
+ protected NavigationManager NavManager { get; set; }
+
+
+ private bool isLoading { get; set; } = false;
+
+ protected override async Task OnInitializedAsync()
+ {
+ await reloadData();
+ }
+
+
+ private async Task reloadData()
+ {
+ isLoading = true;
+ ListStati = await MDService.AnagStatiComm();
+ isLoading = false;
+ }
+
+ private bool showCurrent { get; set; } = false;
+
+ private async Task toggleCurrent()
+ {
+ showCurrent = !showCurrent;
+ await Task.Delay(1);
+ }
+
+ private string textToggle
+ {
+ get => showCurrent ? "In Corso" : "Programmati";
+ }
+
+ private string selStato { get; set; } = "*";
+ }
+}
\ No newline at end of file