Metodi cancellazione dossier (2 test)

This commit is contained in:
Samuele Locatelli
2022-09-27 08:20:40 +02:00
parent 35c0f2856d
commit 523b1683d9
6 changed files with 45 additions and 5 deletions
+23
View File
@@ -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
{
}
/// <summary>
/// Eliminazione di un dossier
/// </summary>
/// <param name="selRecord">record dossier da eliminare</param>
/// <returns></returns>
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;
}
/// <summary>
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
/// macchina (ordinato x data registrazione)
+18 -1
View File
@@ -289,6 +289,23 @@ namespace MP.SPEC.Data
redisConn.Dispose();
}
/// <summary>
/// Eliminazione di un dossier
/// </summary>
/// <param name="selRecord">record dossier da eliminare</param>
/// <returns></returns>
public async Task<bool> 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;
}
/// <summary>
/// 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));
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2209.2620</Version>
<Version>6.16.2209.2708</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2209.2620</h4>
<h4>Versione: 6.16.2209.2708</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2209.2620
6.16.2209.2708
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2209.2620</version>
<version>6.16.2209.2708</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>