Update x gestione "rilascio licenze" con modifica data veto da admin
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user