Modifiche per permettere la deserializzazione dei

valori in dossier
This commit is contained in:
zaccaria.majid
2022-09-20 17:16:21 +02:00
parent 0e9e7f3dda
commit d0d30bd1c3
3 changed files with 24 additions and 19 deletions
-13
View File
@@ -312,19 +312,6 @@ namespace MP.Data.Controllers
return ListLinkFilt("SpecLink");
}
/// <summary>
/// Effettua deserializzaizone in fluxlog dei dati ricevuti come stringa json
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public List<DatabaseModels.FluxLog> convertToFluxLog(string value)
{
var fluxDeserialize = JsonSerializer.Deserialize<FluxLog>(value);
List<DatabaseModels.FluxLog> listFlux = new List<DatabaseModels.FluxLog>();
listFlux.Add(fluxDeserialize);
return listFlux;
}
/// <summary>
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
/// </summary>
+21 -3
View File
@@ -29,19 +29,21 @@ namespace MP.SPEC.Components
[Parameter]
public EventCallback<int> TotRecordChanged { get; set; }
[Parameter]
public EventCallback<Dossiers> RecordSel { get; set; }
#endregion Public Properties
#region Public Methods
public string checkSelect(string IdxMacchina)
public string checkSelect(Dossiers recordSel)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.IdxMacchina == IdxMacchina) ? "table-info" : "";
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
}
catch
{ }
@@ -139,6 +141,13 @@ namespace MP.SPEC.Components
await reloadData();
}
protected async Task selRecord(Dossiers selRec)
{
currRecord = selRec;
await RecordSel.InvokeAsync(selRec);
//listaFlux = MDService.convertToFluxLog(selRec.Valore);
toggleTableFlux();
}
protected async void OnSeachUpdated()
{
@@ -165,7 +174,7 @@ namespace MP.SPEC.Components
private Dossiers? currRecord = null;
private List<Dossiers>? ListRecords;
private List<Dossiers>? SearchRecords;
private List<FluxLog>? listaFlux;
private FluxLog? listaFlux;
#endregion Private Fields
@@ -177,6 +186,8 @@ namespace MP.SPEC.Components
set => MessageService.currPage = value;
}
private bool visualizzaFlux { get; set; } = true;
private bool isLoading { get; set; } = false;
private int MaxRecord
@@ -231,6 +242,13 @@ namespace MP.SPEC.Components
isLoading = false;
}
private async Task toggleTableFlux()
{
visualizzaFlux = !visualizzaFlux;
await Task.Delay(1);
}
#endregion Private Methods
}
}
+3 -3
View File
@@ -322,10 +322,10 @@ namespace MP.SPEC.Data
return await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, DtRef, MaxRec));
}
public async Task<List<FluxLog>> convertToFluxLog(string Valore)
public FluxLog convertToFluxLog(string Valore)
{
return await Task.FromResult(dbController.convertToFluxLog(Valore));
var result = JsonConvert.DeserializeObject<FluxLog>(Valore);
return result;
}
/// <summary>