NON ok gestione reload dettaglio macchina
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
@if (RecMSE == null)
|
||||
@if (isLoading)
|
||||
{
|
||||
<div class="card text-white mapBlock shadow bg-secondary p-0 m-0">
|
||||
<div class="card-body">
|
||||
@@ -166,139 +166,4 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public MappaStatoExpl? RecMSE { get; set; } = null;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public int keepAliveMin { get; set; } = 5;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public bool FullMode { get; set; } = true;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
|
||||
protected int kaFactor = 60 / 2;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// se configurata uso cartella virtuale... altrimenti cartella processo
|
||||
imgBasePath = Environment.CurrentDirectory;// @"C:\Steamware\macchine";
|
||||
}
|
||||
|
||||
private string imgBasePath = "";
|
||||
|
||||
protected ProdAdvDispl.ProdCounter CurrCount
|
||||
{
|
||||
get
|
||||
{
|
||||
ProdAdvDispl.ProdCounter answ = new ProdAdvDispl.ProdCounter()
|
||||
{
|
||||
numPzConf = (int)RecMSE.PezziConf,
|
||||
numPzOrd= (int)RecMSE.NumPezzi,
|
||||
numPzProd= (int)RecMSE.PezziProd
|
||||
};
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ShowDetail()
|
||||
{
|
||||
NavMan.NavigateTo($"machine-detail/?IdxMacc={RecMSE!.IdxMacchina}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// url completo immagine
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public string ImgUrlMacc(string url)
|
||||
{
|
||||
string answ = "";
|
||||
if (string.IsNullOrEmpty(url.ToString()))
|
||||
{
|
||||
url = "Steamware.png";
|
||||
}
|
||||
// verifico esistenza macchina SMALL...
|
||||
answ = $"images/macchine/small/{url}";
|
||||
string fullPath = Path.Combine(imgBasePath, "wwwroot", answ);
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
// se non ci fosse cerco immagine fullsize
|
||||
answ = $"images/macchine/{url}";
|
||||
fullPath = Path.Combine(imgBasePath, "wwwroot", answ);
|
||||
}
|
||||
// altrimenti metto default Steamware
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
answ = "images/macchine/Steamware.png";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// formatta la durata in minuti in un modo "human readable" gg/ore/min
|
||||
/// </summary>
|
||||
/// <param name="minuti">minuti</param>
|
||||
/// <returns></returns>
|
||||
public static string formatDurata(double? minuti)
|
||||
{
|
||||
string answ = "??";
|
||||
if (minuti != null)
|
||||
{
|
||||
DateTime tempo = new DateTime();
|
||||
tempo = tempo.AddMinutes((double)minuti);
|
||||
|
||||
if (minuti < 60)
|
||||
{
|
||||
answ = $"{tempo.Minute:00}:{tempo.Second:00}";
|
||||
}
|
||||
else if (minuti < 1440)
|
||||
{
|
||||
answ = $"{tempo.Hour}h {tempo.Minute}m";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tempo.DayOfYear}g {tempo.Hour}h";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
|
||||
{
|
||||
DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1);
|
||||
string answ = cssStatus(semaforo);
|
||||
if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor))
|
||||
{
|
||||
answ = $"{baseCss}Ro";
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
answ += "_b";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string cssStatus(string codSemaforo)
|
||||
{
|
||||
// se vuoto --> mostra nero!
|
||||
if (string.IsNullOrEmpty(codSemaforo))
|
||||
{
|
||||
codSemaforo = "sNe";
|
||||
}
|
||||
string codColore = codSemaforo.Substring(1, 2);
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
return answ;
|
||||
}
|
||||
protected string baseCss = "sem";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
{
|
||||
public partial class MachineBlock
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public bool FullMode { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public int keepAliveMin { get; set; } = 5;
|
||||
|
||||
[Parameter]
|
||||
public MappaStatoExpl? RecMSE { get; set; } = null;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// formatta la durata in minuti in un modo "human readable" gg/ore/min
|
||||
/// </summary>
|
||||
/// <param name="minuti">minuti</param>
|
||||
/// <returns></returns>
|
||||
public static string formatDurata(double? minuti)
|
||||
{
|
||||
string answ = "??";
|
||||
if (minuti != null)
|
||||
{
|
||||
DateTime tempo = new DateTime();
|
||||
tempo = tempo.AddMinutes((double)minuti);
|
||||
if (minuti < 60)
|
||||
{
|
||||
answ = $"{tempo.Minute:00}:{tempo.Second:00}";
|
||||
}
|
||||
else if (minuti < 1440)
|
||||
{
|
||||
answ = $"{tempo.Hour}h {tempo.Minute}m";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tempo.DayOfYear}g {tempo.Hour}h";
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// url completo immagine
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public string ImgUrlMacc(string url)
|
||||
{
|
||||
string answ = "";
|
||||
if (string.IsNullOrEmpty(url.ToString()))
|
||||
{
|
||||
url = "Steamware.png";
|
||||
}
|
||||
|
||||
// verifico esistenza macchina SMALL...
|
||||
answ = $"images/macchine/small/{url}";
|
||||
string fullPath = Path.Combine(imgBasePath, "wwwroot", answ);
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
// se non ci fosse cerco immagine fullsize
|
||||
answ = $"images/macchine/{url}";
|
||||
fullPath = Path.Combine(imgBasePath, "wwwroot", answ);
|
||||
}
|
||||
|
||||
// altrimenti metto default Steamware
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
answ = "images/macchine/Steamware.png";
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string baseCss = "sem";
|
||||
|
||||
protected int kaFactor = 60 / 2;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected ProdAdvDispl.ProdCounter CurrCount
|
||||
{
|
||||
get
|
||||
{
|
||||
ProdAdvDispl.ProdCounter answ = new ProdAdvDispl.ProdCounter()
|
||||
{
|
||||
numPzConf = (int)RecMSE.PezziConf,
|
||||
numPzOrd = (int)RecMSE.NumPezzi,
|
||||
numPzProd = (int)RecMSE.PezziProd
|
||||
};
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected MessageService MServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
isLoading = true;
|
||||
// se configurata uso cartella virtuale... altrimenti cartella processo
|
||||
imgBasePath = Environment.CurrentDirectory; // @"C:\Steamware\macchine";
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
isLoading = RecMSE == null;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
isLoading = RecMSE == null;
|
||||
await Task.Delay(1);
|
||||
//return base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
||||
|
||||
protected async Task ShowDetail()
|
||||
{
|
||||
// salvo idxMacch
|
||||
await MServ.IdxMaccSet(RecMSE!.IdxMacchina);
|
||||
// navigo!
|
||||
NavMan.NavigateTo($"machine-detail");
|
||||
}
|
||||
|
||||
private bool isLoading = false;
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string imgBasePath = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
|
||||
{
|
||||
DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1);
|
||||
string answ = cssStatus(semaforo);
|
||||
if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor))
|
||||
{
|
||||
answ = $"{baseCss}Ro";
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
answ += "_b";
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string cssStatus(string codSemaforo)
|
||||
{
|
||||
// se vuoto --> mostra nero!
|
||||
if (string.IsNullOrEmpty(codSemaforo))
|
||||
{
|
||||
codSemaforo = "sNe";
|
||||
}
|
||||
|
||||
string codColore = codSemaforo.Substring(1, 2);
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -3,32 +3,12 @@
|
||||
@using MP.Data.Services;
|
||||
@inject MessageService MsgServ
|
||||
|
||||
<h1>Machine Detail</h1>
|
||||
<h2><b>@IdxMacc</b></h2>
|
||||
@if (CurrMSE == null)
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<MachineBlock FullMode="false"></MachineBlock>
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
[SupplyParameterFromQuery(Name = "IdxMacc")]
|
||||
public string? IdxMacc { get; set; }
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
// recupero MSE macchina....
|
||||
if (!string.IsNullOrEmpty(IdxMacc))
|
||||
{
|
||||
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
|
||||
}
|
||||
//await InvokeAsync(StateHasChanged);
|
||||
// return base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using global::System;
|
||||
using global::System.Collections.Generic;
|
||||
using global::System.Linq;
|
||||
using global::System.Threading.Tasks;
|
||||
using global::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_TAB_SERV;
|
||||
using MP_TAB_SERV.Shared;
|
||||
using MP_TAB_SERV.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using NLog;
|
||||
using MP.Data.Services;
|
||||
|
||||
namespace MP_TAB_SERV.Pages
|
||||
{
|
||||
public partial class MachineDetail
|
||||
{
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
IdxMacc = await MsgServ.IdxMaccGet();
|
||||
// recupero MSE macchina....
|
||||
if (!string.IsNullOrEmpty(IdxMacc))
|
||||
{
|
||||
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
|
||||
}
|
||||
//await InvokeAsync(StateHasChanged);
|
||||
// return base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@*@page "/"*@
|
||||
@page "/"
|
||||
@page "/home"
|
||||
@page "/status-map"
|
||||
|
||||
|
||||
+131
-116
@@ -107,6 +107,21 @@ namespace MP.Data.Services
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Macchine attualmente selezionata
|
||||
/// </summary>
|
||||
public async Task<string> IdxMaccGet()
|
||||
{
|
||||
return await localStorage.GetItemAsync<string>("CurrMach");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Macchine attualmente selezionata
|
||||
/// </summary>
|
||||
public async Task IdxMaccSet(string machSel)
|
||||
{
|
||||
await localStorage.SetItemAsync("CurrMach", machSel);
|
||||
}
|
||||
|
||||
#if false
|
||||
public bool IsActive
|
||||
@@ -188,19 +203,19 @@ namespace MP.Data.Services
|
||||
public RegAttivitaModel? recordRA { get; set; } = null;
|
||||
#endif
|
||||
|
||||
public AnagOperatoriModel? RigaOper
|
||||
public AnagOperatoriModel? RigaOper
|
||||
{
|
||||
get => _rigaOper;
|
||||
set
|
||||
{
|
||||
get => _rigaOper;
|
||||
set
|
||||
// salvo
|
||||
_rigaOper = value;
|
||||
if (EA_OperUpdated != null)
|
||||
{
|
||||
// salvo
|
||||
_rigaOper = value;
|
||||
if (EA_OperUpdated != null)
|
||||
{
|
||||
EA_OperUpdated?.Invoke();
|
||||
}
|
||||
EA_OperUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
public string SearchVal
|
||||
@@ -239,42 +254,42 @@ namespace MP.Data.Services
|
||||
public DateTime targetDateMancTimb { get; set; }
|
||||
#endif
|
||||
|
||||
#endregion Public Properties
|
||||
#endregion Public Properties
|
||||
|
||||
protected const string KeyMacDict = "MachineDict";
|
||||
protected const string KeyDevSec = "DevSec";
|
||||
protected const string KeyDevIp4 = "DevIpv4";
|
||||
protected const string KeyMacDict = "MachineDict";
|
||||
protected const string KeyDevSec = "DevSec";
|
||||
protected const string KeyDevIp4 = "DevIpv4";
|
||||
|
||||
#region Public Methods
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce il valore di DeviceSecret da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> getDevSecretAsync()
|
||||
/// <summary>
|
||||
/// Restituisce il valore di DeviceSecret da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> getDevSecretAsync()
|
||||
{
|
||||
string answ = "";
|
||||
var result = await localStorage.GetItemAsync<string>(KeyDevSec);
|
||||
if (result != null)
|
||||
{
|
||||
string answ = "";
|
||||
var result = await localStorage.GetItemAsync<string>(KeyDevSec);
|
||||
if (result != null)
|
||||
{
|
||||
answ = result;
|
||||
}
|
||||
return answ;
|
||||
answ = result;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce il valore Ipv4 del Device da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> getDevIpAsync()
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce il valore Ipv4 del Device da localstorage
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<string> getDevIpAsync()
|
||||
{
|
||||
string answ = "";
|
||||
var result = await localStorage.GetItemAsync<string>(KeyDevIp4);
|
||||
if (result != null)
|
||||
{
|
||||
string answ = "";
|
||||
var result = await localStorage.GetItemAsync<string>(KeyDevIp4);
|
||||
if (result != null)
|
||||
{
|
||||
answ = result;
|
||||
}
|
||||
return answ;
|
||||
answ = result;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
#if false
|
||||
|
||||
public void ReportDateChange()
|
||||
@@ -344,112 +359,112 @@ namespace MP.Data.Services
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Scrive il valore di DeviceSecret nel localstoragee
|
||||
/// </summary>
|
||||
/// <param name="newVal"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> setDevSecretAsync(string newVal)
|
||||
/// <summary>
|
||||
/// Scrive il valore di DeviceSecret nel localstoragee
|
||||
/// </summary>
|
||||
/// <param name="newVal"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> setDevSecretAsync(string newVal)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
await localStorage.SetItemAsync(KeyDevSec, newVal);
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"Eccezione in setDevSecretAsync{Environment.NewLine}{ex}");
|
||||
}
|
||||
return answ;
|
||||
await localStorage.SetItemAsync(KeyDevSec, newVal);
|
||||
answ = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Scrive il valore di IPV4 del device nel localstoragee
|
||||
/// </summary>
|
||||
/// <param name="newVal"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> setDevIpv4Async(string newVal)
|
||||
catch (Exception ex)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
await localStorage.SetItemAsync(KeyDevIp4, newVal);
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"Eccezione in setDevIpv4Async{Environment.NewLine}{ex}");
|
||||
}
|
||||
return answ;
|
||||
Log.Error($"Eccezione in setDevSecretAsync{Environment.NewLine}{ex}");
|
||||
}
|
||||
|
||||
private string machineMse(string idxMacc)
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Scrive il valore di IPV4 del device nel localstoragee
|
||||
/// </summary>
|
||||
/// <param name="newVal"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> setDevIpv4Async(string newVal)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
return $"MSE_{idxMacc}";
|
||||
await localStorage.SetItemAsync(KeyDevIp4, newVal);
|
||||
answ = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio in localstorage dei dati MSE correnti
|
||||
/// </summary>
|
||||
/// <param name="currListMSE"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task SaveMse(List<MappaStatoExpl> currListMSE)
|
||||
catch (Exception ex)
|
||||
{
|
||||
foreach (var item in currListMSE)
|
||||
{
|
||||
string serVal = JsonSerializer.Serialize(item);
|
||||
await localStorage.SetItemAsync(machineMse(item.IdxMacchina), serVal);
|
||||
}
|
||||
Log.Error($"Eccezione in setDevIpv4Async{Environment.NewLine}{ex}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero dati MSE x macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<MappaStatoExpl> GetMachineMse(string idxMacchina)
|
||||
private string machineMse(string idxMacc)
|
||||
{
|
||||
return $"MSE_{idxMacc}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio in localstorage dei dati MSE correnti
|
||||
/// </summary>
|
||||
/// <param name="currListMSE"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task SaveMse(List<MappaStatoExpl> currListMSE)
|
||||
{
|
||||
foreach (var item in currListMSE)
|
||||
{
|
||||
MappaStatoExpl answ = new MappaStatoExpl();
|
||||
//answ = await localStorage.GetItemAsync<MappaStatoExpl>(machineMse(idxMacchina));
|
||||
string tryString = await localStorage.GetItemAsync<string>(machineMse(idxMacchina));
|
||||
if(tryString != "")
|
||||
{
|
||||
answ = JsonSerializer.Deserialize<MappaStatoExpl>(tryString);
|
||||
}
|
||||
return answ;
|
||||
string serVal = JsonSerializer.Serialize(item);
|
||||
await localStorage.SetItemAsync(machineMse(item.IdxMacchina), serVal);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
/// <summary>
|
||||
/// Recupero dati MSE x macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<MappaStatoExpl> GetMachineMse(string idxMacchina)
|
||||
{
|
||||
MappaStatoExpl answ = new MappaStatoExpl();
|
||||
//answ = await localStorage.GetItemAsync<MappaStatoExpl>(machineMse(idxMacchina));
|
||||
string tryString = await localStorage.GetItemAsync<string>(machineMse(idxMacchina));
|
||||
if (tryString != "")
|
||||
{
|
||||
answ = JsonSerializer.Deserialize<MappaStatoExpl>(tryString);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#region Protected Properties
|
||||
#endregion Public Methods
|
||||
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
#region Protected Properties
|
||||
|
||||
protected ISessionStorageService sessionStore { get; set; } = null!;
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
protected ISessionStorageService sessionStore { get; set; } = null!;
|
||||
|
||||
#region Private Fields
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
#if false
|
||||
private string _pageIcon = "";
|
||||
private string _pageName = "";
|
||||
#endif
|
||||
|
||||
private AnagOperatoriModel? _rigaOper;
|
||||
private AnagOperatoriModel? _rigaOper;
|
||||
|
||||
|
||||
private Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#if false
|
||||
private string _searchVal = "";
|
||||
private bool showSearch;
|
||||
#endif
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
#region Private Properties
|
||||
|
||||
|
||||
#if false
|
||||
@@ -457,9 +472,9 @@ namespace MP.Data.Services
|
||||
private bool nextIsEntrata { get; set; } = true;
|
||||
#endif
|
||||
|
||||
#endregion Private Properties
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
#region Private Methods
|
||||
|
||||
#if false
|
||||
private void ReportPageUpd()
|
||||
@@ -479,6 +494,6 @@ namespace MP.Data.Services
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user