aggiunto metodo specifico per il login
This commit is contained in:
@@ -54,32 +54,46 @@ namespace MP.Data.Controllers
|
||||
/// /// <param name="MatrOpr"></param>
|
||||
/// /// <param name="authKey"></param>
|
||||
/// <returns></returns>
|
||||
public List<AnagOperatoriModel> ElencoOperatori(int matrOpr, string authKey)
|
||||
public List<AnagOperatoriModel> ElencoOperatori()
|
||||
{
|
||||
List<AnagOperatoriModel> dbResult = new List<AnagOperatoriModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
if ((matrOpr == 0) && (authKey == ""))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbOperatori
|
||||
.Where(s => s.MatrOpr > 0)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.MatrOpr)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbOperatori
|
||||
.Where(s => (s.MatrOpr > 0) && (s.MatrOpr == matrOpr) && (s.authKey == authKey))
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
dbResult = dbCtx
|
||||
.DbOperatori
|
||||
.Where(s => s.MatrOpr > 0)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.MatrOpr)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// login operatori
|
||||
/// </summary>
|
||||
/// /// <param name="MatrOpr"></param>
|
||||
/// /// <param name="authKey"></param>
|
||||
/// <returns></returns>
|
||||
public bool LoginOperatore(int matrOpr, string authKey)
|
||||
{
|
||||
List<AnagOperatoriModel> dbResult = new List<AnagOperatoriModel>();
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbOperatori
|
||||
.Where(s => (s.MatrOpr > 0) && (s.MatrOpr == matrOpr) && (s.authKey == authKey))
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
if(dbResult.Count == 1)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#region gestione magazzini
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user