public PaginatedItems <Alarm> GetAll(IMongoFilter <Device, Alarm> filter, int rowsPerPage, int pageNumber) { DeviceAlarmFilter alarmFilter = new DeviceAlarmFilter { Context = (filter as AlarmFilter).Context, AlarmType = (filter as AlarmFilter).AlarmType, Gravity = (filter as AlarmFilter).Gravity, DeviceId = string.Empty, IsRead = (filter as AlarmFilter).IsRead, IsActive = (filter as AlarmFilter).IsActive }; var totalCount = alarmRepository.Count(alarmFilter); var pageCount = rowsPerPage == 0 ? 1 : (int)Math.Ceiling((double)totalCount / rowsPerPage); return(new PaginatedItems <Alarm> { PageCount = pageCount, TotalItemsCount = totalCount, Items = alarmRepository.Get(alarmFilter, rowsPerPage, pageNumber) }); }
public int GetCounts(int eNodebId, DateTime begin, DateTime end) { return(_repository.Count(begin, end, eNodebId)); }