diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index b584d136..77989a0d 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -1,6 +1,7 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; +using MP.Data.DatabaseModels; using NLog; using System; using System.Collections.Generic; @@ -277,6 +278,28 @@ namespace MP.Data.Controllers { } + /// + /// Eliminazione di un dossier + /// + /// record dossier da eliminare + /// + public bool DossiersDelete(Dossiers selRecord) + { + bool answ = false; + using (var dbCtx = new MoonProContext(_configuration)) + { + var pIdxMacchina = new SqlParameter("@Original_IdxMacchina", selRecord.IdxMacchina); + var pIdxODL = new SqlParameter("@Original_IdxODL", selRecord.IdxODL); + var pDtRif = new SqlParameter("@Original_DtRif ", selRecord.DtRif); + + var dbResult = dbCtx + .Database + .ExecuteSqlRaw("EXEC stp_DOSS_deleteQuery @Original_IdxMacchina,@Original_IdxODL,@Original_DtRif", pIdxMacchina, pIdxODL, pDtRif); + answ = true; + } + return answ; + } + /// /// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato /// macchina (ordinato x data registrazione) diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 47db791d..f14e6733 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -289,6 +289,23 @@ namespace MP.SPEC.Data redisConn.Dispose(); } + /// + /// Eliminazione di un dossier + /// + /// record dossier da eliminare + /// + public async Task DossiersDelete(Dossiers selRecord) + { + bool result = false; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + result = await Task.FromResult(dbController.DossiersDelete(selRecord)); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"DossiersDelete | IdxMacchina {selRecord.IdxMacchina} | DtRif {selRecord.DtRif} | IdxODL {selRecord.IdxODL} | {ts.TotalMilliseconds}ms"); + return result; + } + /// /// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato /// macchina (ordinato x data registrazione) @@ -340,7 +357,7 @@ namespace MP.SPEC.Data bool answ = false; await Task.Delay(1); // chiamo stored x salvare parametri - dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec,DtRif); + dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec, DtRif); // svuoto cache redis x macchina string currKey = $"{redisDossByMac}:{IdxMacchina}"; redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1)); diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 801bd66f..f7fd0cfb 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2209.2620 + 6.16.2209.2708 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index bc62cdf5..bb3055e4 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2209.2620

+

Versione: 6.16.2209.2708


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 1bb8d749..9ec82147 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2209.2620 +6.16.2209.2708 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 73152861..813a0be2 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2209.2620 + 6.16.2209.2708 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false