Aggiunta cache metodi:
- elenco operatori - elenco sessioni in corso
This commit is contained in:
@@ -28,17 +28,31 @@ namespace MP.Data.Controllers
|
||||
/// Elenco Inventari CORRENTI (=aperti, senza data fine)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<InventorySessionModel> InventSessCurrList()
|
||||
public List<InventorySessionModel> InventSessCurrList(DateTime dtStart, DateTime? dtEnd)
|
||||
{
|
||||
List<InventorySessionModel> dbResult = new List<InventorySessionModel>();
|
||||
using (var dbCtx = new MoonPro_InveContext(_configuration))
|
||||
{
|
||||
if(dtEnd == null)
|
||||
{
|
||||
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbInveSess
|
||||
.Where(x => x.DtEnd == null)
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtStart)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbInveSess
|
||||
.Where(x => (x.DtEnd == dtEnd) && (x.DtStart == dtStart))
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.DtStart)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user