bool IsInFilter(FiresecService.SKUD.DataAccess.Employee employee, EmployeeFilter filter) { if (filter == null) return true; bool isInUids = !filter.HasUids || filter.Uids.Any(x => employee.Uid == x); bool isInDepartments = !filter.HasDepartments || filter.DepartmentUids.Any(x => employee.DepartmentUid == x); bool isInPositions = !filter.HasPositions || filter.PositionUids.Any(x => employee.PositionUid == x); bool isInAppointed = filter.Appointed == null || (employee.Appointed >= filter.Appointed.StartDate && employee.Appointed <= filter.Appointed.EndDate); bool isInDismissed = filter.Dismissed == null || (employee.Dismissed >= filter.Dismissed.StartDate && employee.Dismissed <= filter.Dismissed.EndDate); return isInUids && isInDepartments && isInPositions && isInAppointed && isInDepartments; }
bool IsInFilter(FiresecService.SKUD.DataAccess.Position item, PositionFilter filter) { if (filter == null) return true; bool isInUids = !filter.HasUids || filter.Uids.Any(x => item.Uid == x); return isInUids; }