Fix selezione interventi nel periodo
This commit is contained in:
@@ -85,17 +85,6 @@ namespace MP.MONO.UI.Data
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<bool> createMissingSchedTask(int machineId)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
bool answ = await dbController.SchedMaintTaskCreateMissing(machineId);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata chiamata a createMissingSchedTask: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public async Task<List<DataLogModel>> DataLogGetFilt(int machineId, string fluxType, DateTime inizio, DateTime fine)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
@@ -334,11 +323,25 @@ namespace MP.MONO.UI.Data
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<ScheduledMaintModel>> SchedMaintTaskGetFilt(int machineId, int skipRec, int numRec, bool showCompleted)
|
||||
public async Task<bool> SchedMaintTaskCreateMissing(int machineId)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<ScheduledMaintModel>? dbResult = dbController.SchedMaintTaskGetFilt(machineId, skipRec, numRec, showCompleted);
|
||||
bool answ = await dbController.SchedMaintTaskCreateMissing(machineId);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata chiamata a createMissingSchedTask: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public async Task<List<ScheduledMaintModel>> SchedMaintTaskGetFilt(int machineId, int maxRemain, int skipRec, int numRec, bool showCompleted)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
// ricerca sul DB "raw"
|
||||
List<ScheduledMaintModel>? rawResult = dbController.SchedMaintTaskGetFilt(machineId, skipRec, numRec, showCompleted);
|
||||
// filtro ulteriormente ora...
|
||||
var dbResult = rawResult.Where(x => x.CountRemainVal <= maxRemain || maxRemain == 0).ToList();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB SchedMaintTaskGetFilt: {ts.TotalMilliseconds} ms");
|
||||
|
||||
Reference in New Issue
Block a user