I'm not sure how to write the whole code for your project, but I can help you in the right direction with the logic and SQL statement. You'll need to use a couple subqueries to get the values from the OvernightParkingSetting table that you need.
Start here:
SELECT * FROM parkingPermitTable
WHERE validFrom < SELECT(NightStart FROM OvernightParkingSetting)
AND validTo > SELECT(NightEnd FROM OvernightParkingSetting)
Here I'm making the assumption that your OvernightParkingSetting table has only one row. If it does not, you need to find a way to restrict that to receiving a specific night start and night end time.
This will select any rows from the parking permit table that has a valid from time earlier than the night start time, as well as a valid to time that is later than the night end time. If you want this to be inclusive, you can change the less than and greater than operators accordingly.
EDIT
This also makes the assumptions that all of the variables are datetime variables. I believe that is the variable that would be most relevant here.