+
+
+
+
+
+
+
+
diff --git a/MP.SPEC/Shared/MainLayout.razor b/MP.SPEC/Components/Layout/MainLayout.razor
similarity index 100%
rename from MP.SPEC/Shared/MainLayout.razor
rename to MP.SPEC/Components/Layout/MainLayout.razor
diff --git a/MP.SPEC/Shared/MainLayout.razor.cs b/MP.SPEC/Components/Layout/MainLayout.razor.cs
similarity index 90%
rename from MP.SPEC/Shared/MainLayout.razor.cs
rename to MP.SPEC/Components/Layout/MainLayout.razor.cs
index dffbf458..725d3227 100644
--- a/MP.SPEC/Shared/MainLayout.razor.cs
+++ b/MP.SPEC/Components/Layout/MainLayout.razor.cs
@@ -1,4 +1,4 @@
-namespace MP.SPEC.Shared
+namespace MP.SPEC.Components.Layout
{
public partial class MainLayout
{
diff --git a/MP.SPEC/Shared/MainLayout.razor.css b/MP.SPEC/Components/Layout/MainLayout.razor.css
similarity index 100%
rename from MP.SPEC/Shared/MainLayout.razor.css
rename to MP.SPEC/Components/Layout/MainLayout.razor.css
diff --git a/MP.SPEC/Shared/MainLayout.razor.less b/MP.SPEC/Components/Layout/MainLayout.razor.less
similarity index 100%
rename from MP.SPEC/Shared/MainLayout.razor.less
rename to MP.SPEC/Components/Layout/MainLayout.razor.less
diff --git a/MP.SPEC/Shared/MainLayout.razor.min.css b/MP.SPEC/Components/Layout/MainLayout.razor.min.css
similarity index 100%
rename from MP.SPEC/Shared/MainLayout.razor.min.css
rename to MP.SPEC/Components/Layout/MainLayout.razor.min.css
diff --git a/MP.SPEC/Shared/NavMenu.razor b/MP.SPEC/Components/Layout/NavMenu.razor
similarity index 100%
rename from MP.SPEC/Shared/NavMenu.razor
rename to MP.SPEC/Components/Layout/NavMenu.razor
diff --git a/MP.SPEC/Shared/NavMenu.razor.cs b/MP.SPEC/Components/Layout/NavMenu.razor.cs
similarity index 98%
rename from MP.SPEC/Shared/NavMenu.razor.cs
rename to MP.SPEC/Components/Layout/NavMenu.razor.cs
index 0d2208e9..87d2a650 100644
--- a/MP.SPEC/Shared/NavMenu.razor.cs
+++ b/MP.SPEC/Components/Layout/NavMenu.razor.cs
@@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc.RazorPages;
using MP.SPEC.Data;
-namespace MP.SPEC.Shared
+namespace MP.SPEC.Components.Layout
{
public partial class NavMenu : IDisposable
{
diff --git a/MP.SPEC/Shared/NavMenu.razor.css b/MP.SPEC/Components/Layout/NavMenu.razor.css
similarity index 100%
rename from MP.SPEC/Shared/NavMenu.razor.css
rename to MP.SPEC/Components/Layout/NavMenu.razor.css
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index f0cf41b7..480caa30 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -1,8 +1,6 @@
using Microsoft.AspNetCore.Components;
-using Microsoft.AspNetCore.DataProtection;
using Microsoft.JSInterop;
using MP.Data.DbModels;
-using MP.SPEC.Components;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
@@ -209,7 +207,7 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
- ListArtKit = MDService.ArticoliGetByTipo("KIT", "*");
+ ListArtKit = await MDService.ArticoliGetByTipoAsync("KIT", "*");
string SPEC_PODL_gest = await MDService.ConfigTryGetAsync("SPEC_PODL_gest");
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
{
diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs
index 3217b076..29151abe 100644
--- a/MP.SPEC/Components/ListPODL.razor.cs
+++ b/MP.SPEC/Components/ListPODL.razor.cs
@@ -216,9 +216,8 @@ namespace MP.SPEC.Components
.Select(x => x.IdxMacchina)
.ToHashSet();
-
ListStati = await MDService.AnagStatiComm();
- ListArtKit = MDService.ArticoliGetByTipo("KIT", "*");
+ ListArtKit = await MDService.ArticoliGetByTipoAsync("KIT", "*");
string strMachRecipe = await MDService.ConfigTryGetAsync("MachineWithRecipe");
if (!string.IsNullOrEmpty(strMachRecipe))
{
diff --git a/MP.SPEC/Components/Routes.razor b/MP.SPEC/Components/Routes.razor
new file mode 100644
index 00000000..37c2f803
--- /dev/null
+++ b/MP.SPEC/Components/Routes.razor
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Not found
+
+
Sorry, there's nothing at this address.
+
+
+
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 46079cca..5d7405d1 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -417,15 +417,15 @@ namespace MP.SPEC.Data
///
///
///
- public List ArticoliGetByTipo(string tipo, string azienda = "*")
+ public async Task> ArticoliGetByTipoAsync(string tipo, string azienda = "*")
{
- using var activity = ActivitySource.StartActivity("ArticoliGetByTipo");
+ using var activity = ActivitySource.StartActivity("ArticoliGetByTipoAsync");
List? result = new List();
string source = "DB";
string sKey = string.IsNullOrEmpty(tipo) ? "ALL" : tipo;
string currKey = $"{Utils.redisArtList}:{azienda}:Tipo:{sKey}";
// cerco in redis dato valore sel idxMaccSel...
- RedisValue rawData = redisDb.StringGet(currKey);
+ RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject>($"{rawData}");
@@ -433,10 +433,10 @@ namespace MP.SPEC.Data
}
else
{
- result = dbController.ArticoliGetByTipo(tipo, azienda);
+ result = await dbController.ArticoliGetByTipoAsync(tipo, azienda);
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
- redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
+ await redisDb.StringSetAsync(currKey, rawData, getRandTOut(redisLongTimeCache));
}
if (result == null)
{
@@ -445,7 +445,7 @@ namespace MP.SPEC.Data
activity?.SetTag("data.source", source);
activity?.SetTag("result.count", result.Count);
activity?.Stop();
- LogTrace($"ArticoliGetByTipo | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
+ LogTrace($"ArticoliGetByTipoAsync | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
return result;
}
@@ -685,34 +685,6 @@ namespace MP.SPEC.Data
LogTrace($"ConfigTryGet Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
return value ?? "";
-
-#if false
- string answ = "";
- using var activity = ActivitySource.StartActivity("ConfigTryGet");
- string source = "DB+REDIS";
- // preselezione valori
- if (configData == null || configData.Count == 0)
- {
- configData = ConfigGetAll();
- }
- var currRec = configData.FirstOrDefault(x => x.Chiave == keyName);
-
- // se non trovato provo a ricaricare..
- if (currRec == null)
- {
- configData = ConfigGetAll();
- currRec = configData.FirstOrDefault(x => x.Chiave == keyName);
- }
- // verifico se ci sia il dato...
- if (currRec != null)
- {
- answ = currRec.Valore;
- }
- activity?.SetTag("data.source", source);
- activity?.Stop();
- LogTrace($"ConfigTryGet Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
- return answ;
-#endif
}
///
@@ -732,36 +704,8 @@ namespace MP.SPEC.Data
activity?.SetTag("data.source", source);
activity?.Stop();
- LogTrace($"ConfigTryGetAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
+ LogTrace($"ConfigTryGetAsync | {keyName} | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
return value ?? "";
-
-#if false
- string answ = "";
- using var activity = ActivitySource.StartActivity("ConfigTryGetAsync");
- string source = "DB+REDIS";
- // preselezione valori
- if (configData == null || configData.Count == 0)
- {
- configData = await ConfigGetAllAsync();
- }
- var currRec = configData.FirstOrDefault(x => x.Chiave == keyName);
-
- // se non trovato provo a ricaricare..
- if (currRec != null)
- {
- configData = await ConfigGetAllAsync();
- currRec = configData.FirstOrDefault(x => x.Chiave == keyName);
- }
- // verifico se ci sia il dato...
- if (currRec != null)
- {
- answ = currRec.Valore;
- }
- activity?.SetTag("data.source", source);
- activity?.Stop();
- LogTrace($"ConfigTryGetAsync Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
- return answ;
-#endif
}
///
@@ -2070,27 +2014,6 @@ namespace MP.SPEC.Data
// chiamo metodo conferma!
fatto = await dbController.ODLClose(idxOdl, idxMacchina, matrOpr, confPezzi, confRett, modoConfProd);
-#if false
- // recupero dati x conf modalità conferma
- var configData = await ConfigGetAllAsync();
- if (configData != null)
- {
- bool confRett = false;
- var currRec = configData.FirstOrDefault(x => x.Chiave == "confRett");
- if (currRec != null)
- {
- bool.TryParse(currRec.Valore, out confRett);
- }
- int modoConfProd = 0;
- currRec = configData.FirstOrDefault(x => x.Chiave == "modoConfProd");
- if (currRec != null)
- {
- int.TryParse(currRec.Valore, out modoConfProd);
- }
- // chiamo metodo conferma!
- fatto = await dbController.ODLClose(idxOdl, idxMacchina, matrOpr, confPezzi, confRett, modoConfProd);
- }
-#endif
activity?.SetTag("data.source", source);
activity?.Stop();
LogTrace($"ODLClose | Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
@@ -3344,17 +3267,6 @@ namespace MP.SPEC.Data
#endregion Private Fields
- #region Private Properties
-
-#if false
- ///
- /// Cache dati config
- ///
- private List configData { get; set; } = new List();
-#endif
-
- #endregion Private Properties
-
#region Private Methods
///
@@ -3368,6 +3280,7 @@ namespace MP.SPEC.Data
ExecFlushRedisPattern(pattern);
}
}
+
private void EnsureConfigLoaded()
{
if (_configData.Count == 0)
@@ -3379,6 +3292,7 @@ namespace MP.SPEC.Data
.ToDictionary(g => g.Key, g => g.First().Valore);
}
}
+
private async Task EnsureConfigLoadedAsync()
{
if (_configData.Count == 0)
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index 06d98519..e978a1c1 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enableenableMP.SPEC
- 8.16.2605.2616
+ 8.16.2605.26171800a78a-6ff1-40f9-b490-87fb8bfc1394en
diff --git a/MP.SPEC/Pages/_Host.cshtml b/MP.SPEC/Pages/_Host.cshtml
deleted file mode 100644
index cc60006b..00000000
--- a/MP.SPEC/Pages/_Host.cshtml
+++ /dev/null
@@ -1,8 +0,0 @@
-@page "/"
-@namespace MP.SPEC.Pages
-@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
-@{
- Layout = "_Layout";
-}
-
-
\ No newline at end of file
diff --git a/MP.SPEC/Pages/_Layout.cshtml b/MP.SPEC/Pages/_Layout.cshtml
deleted file mode 100644
index ce82407f..00000000
--- a/MP.SPEC/Pages/_Layout.cshtml
+++ /dev/null
@@ -1,69 +0,0 @@
-@using Microsoft.AspNetCore.Components.Web
-@namespace MP.SPEC.Pages
-@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
-
-
-
-
- MP-SPEC
-
-
-
-
-
-
-
-
-
-
-
-
-
- @RenderBody()
-
-
-
- An error has occurred. This application may no longer respond until reloaded.
-
-
- An unhandled exception has occurred. See browser dev tools for details.
-
- Reload
- 🗙
-