aggiunti metodi x deleteScansione
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user