aggiunti metodi x deleteScansione

This commit is contained in:
zaccaria.majid
2022-12-13 18:02:21 +01:00
parent d510df4bf8
commit 32334843e0
2 changed files with 41 additions and 0 deletions
+25
View File
@@ -235,6 +235,31 @@ namespace MP.Data.Controllers
return fatto;
}
/// <summary>
/// delete scansione
/// </summary>
/// <returns></returns>
public async Task<bool> deleteScansione(ScanDataModel record)
{
bool fatto = false;
using (var dbCtx = new MoonPro_InveContext(_configuration))
{
try
{
dbCtx
.DbScanData
.Remove(record);
await dbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante deleteScansione{Environment.NewLine}{exc}");
}
}
return fatto;
}
#endregion gestione scansioni
+16
View File
@@ -162,6 +162,7 @@ namespace MP.INVE.Data
return result;
// aggiungo record al DB
}
public async Task<bool> deleteSessione(InventorySessionModel session)
{
bool result = false;
@@ -177,6 +178,21 @@ namespace MP.INVE.Data
return result;
// elimino record dal DB
}
public async Task<bool> deleteScansione(ScanDataModel scan)
{
bool result = false;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
result = await dbController.deleteScansione(scan);
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisScanBaseAddr}*");
bool answ = await ExecFlushRedisPattern(pattern);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"deleteScansione | Id scansione: {scan.ScanID} | Codice scansionato: {scan.ScanValue} | {ts.TotalMilliseconds}ms");
return result;
// elimino record dal DB
}
public async Task<bool> InsertNewMag(AnagMagModel newMag)
{