Fix alarm history
This commit is contained in:
@@ -54,7 +54,7 @@ namespace Step.Database.Controllers
|
||||
var occurrencesQuery = dbCtx
|
||||
.AlarmOccurrences
|
||||
.OrderBy(x => x.AlarmOccurrenceId)
|
||||
.Include("Users")
|
||||
.Include("Users")
|
||||
.Where(x =>
|
||||
x.TimeStamp >= startDate && x.TimeStamp <= endDate // Filter by date
|
||||
&& sources.Contains(x.Source) // Check source
|
||||
@@ -62,10 +62,10 @@ namespace Step.Database.Controllers
|
||||
&&
|
||||
((x.Source == ALARM_SOURCE.NC && ncAlarmDescIds.Contains(x.AlarmDescriptionId.Value)) // Check if message is contained in NC messages
|
||||
|| (x.Source == ALARM_SOURCE.PLC && plcAlarmDescIds.Contains(x.AlarmId))) // Check if message is contained in PLC messages
|
||||
);
|
||||
|
||||
pages = occurrencesQuery.Count() / pageSize;
|
||||
).OrderByDescending(t => t.TimeStamp);
|
||||
|
||||
double tmpPages = occurrencesQuery.Count() / pageSize;
|
||||
pages = (int)Math.Ceiling(tmpPages);
|
||||
|
||||
var paginatedQuery = occurrencesQuery
|
||||
.Skip(page * pageSize) // Paginate
|
||||
|
||||
Reference in New Issue
Block a user