Not exactly sure what you're trying to accomplish.
Simply put, you have 4 cases:
- Old range contains new range
- New range contains old range
- Old range starts before new range, but also ends before new range
- New range starts before old range, but also ends before old range
If you want to test all of these, you need to if, else if them all. But if you only care about case 1, you can test that by doing this sort of thing:
var oldCheckout = DateTime.Now.AddMinutes(-500);
var oldCheckin = DateTime.Now.AddMinutes(-30);
var newCheckout = DateTime.Now.AddMinutes(-400);
var newCheckin = DateTime.Now.AddMinutes(-50);
if (oldCheckout < newCheckout && newCheckin < oldCheckin)
return true;
else
return false;