FluxLogDTO:

- Update modello dati x gestione nuovo DTO
- bozza udpatre DB e servizio
This commit is contained in:
Samuele Locatelli
2022-10-12 06:20:54 +02:00
parent a4810826f8
commit d5f5cf9b11
12 changed files with 169 additions and 89 deletions
+37
View File
@@ -403,6 +403,43 @@ namespace MP.Data.Controllers
return answ;
}
/// <summary>
/// Update ddel campo VALORE di un dossier (che contiene json flux log serializzati)
/// </summary>
/// <param name="editRec">record dossier da modificare</param>
/// <returns></returns>
public async Task<bool> DossiersUpdateValore(Dossiers editRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var currRec = dbCtx
.DbSetDossiers
.Where(x => x.IdxDossier == editRec.IdxDossier)
.FirstOrDefault();
if (currRec != null)
{
currRec.Valore= editRec.Valore;
dbCtx.Entry(currRec).State = EntityState.Modified;
}
else
{
dbCtx
.DbSetDossiers
.Add(editRec);
}
await dbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DossiersUpdateRecord{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Elenco valori link (x home e navMenu laterale)
/// </summary>