Ricerca cartellini (fixed)

This commit is contained in:
Samuele Locatelli
2021-09-21 16:18:11 +02:00
parent 77a45dbdc1
commit 01ed314319
15 changed files with 141 additions and 70 deletions
+22 -18
View File
@@ -34,19 +34,21 @@ namespace MP.AppAuth.Controllers
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
{
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
if (!string.IsNullOrEmpty(searchVal))
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = dbCtx
.DbSetAnagOpr
.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal))
.ToList();
}
else
{
dbResult = dbCtx
.DbSetAnagOpr
.ToList();
if (!string.IsNullOrEmpty(searchVal))
{
dbResult = localDbCtx
.DbSetAnagOpr
.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal))
.ToList();
}
else
{
dbResult = localDbCtx
.DbSetAnagOpr
.ToList();
}
}
// ritorno
return dbResult;
@@ -93,11 +95,12 @@ namespace MP.AppAuth.Controllers
public List<Models.UpdMan> UpdManGetAll()
{
List<Models.UpdMan> dbResult = new List<Models.UpdMan>();
dbResult = dbCtx
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetUpdMan
.ToList();
}
return dbResult;
}
@@ -108,11 +111,12 @@ namespace MP.AppAuth.Controllers
public List<Models.Vocabolario> VocabolarioGetAll()
{
List<Models.Vocabolario> dbResult = new List<Models.Vocabolario>();
dbResult = dbCtx
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetVocabolario
.ToList();
}
return dbResult;
}