Update x gestione "rilascio licenze" con modifica data veto da admin

This commit is contained in:
Samuele Locatelli
2021-11-08 16:35:13 +01:00
parent 37e487ce54
commit 2d09d153cf
4 changed files with 59 additions and 24 deletions
+26
View File
@@ -176,6 +176,32 @@ namespace LiMan.DB.Controllers
return answ;
}
public bool AttivazioniUnlock(int idxSubLic)
{
bool fatto = false;
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
DateTime oggi = DateTime.Today;
// recupero record
var currData = localDbCtx
.DbSetSubLicenze
.Where(x => x.IdxSubLic == idxSubLic && x.VetoUnlock > oggi)
.FirstOrDefault();
// se ho qualcosa procedo...
if (currData != null)
{
currData.VetoUnlock = oggi;
localDbCtx.Entry(currData).State = EntityState.Modified;
// salvo
localDbCtx.SaveChanges();
}
// comunque true se ci ha provato
fatto = true;
}
return fatto;
}
public bool DbForceMigrate()
{
bool answ = false;