Riorganizzazione commenti --> note

This commit is contained in:
Samuele Locatelli
2023-10-07 12:27:00 +02:00
parent fd1c96929c
commit 59c973bf4a
18 changed files with 537 additions and 70 deletions
+32
View File
@@ -302,6 +302,38 @@ namespace MP.Data.Controllers
_configuration = null;
}
/// <summary>
/// Eliminazione record EventList (SE trovato)
/// </summary>
/// <param name="newRec"></param>
/// <returns></returns>
public async Task<bool> EvListDelete(string idxMacchina, DateTime dtEvento)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var item2del = dbCtx
.DbSetEvList
.Where(x => x.IdxMacchina == idxMacchina && x.InizioStato == dtEvento)
.FirstOrDefault();
if (item2del != null)
{
dbCtx.DbSetEvList.Remove(item2del);
await dbCtx.SaveChangesAsync();
}
}
catch (Exception exc)
{
Log.Error($"Eccezione durante EvListDelete{Environment.NewLine}{exc}");
}
}
await Task.Delay(1);
return fatto;
}
/// <summary>
/// Aggiunta record EventList
/// </summary>