Condensing if statement in C# I have this if statement

if (dt.Month &gt; 3 &amp;&amp; dt.Month &lt; 11)
{
    if (hours == 23 || (hours &gt;= 0 &amp;&amp; hours &lt;= 6))
    {
        session = String.Empty;
    }
    else if (hours == 7)
    {
        session = String.Empty;
    }
    else if (hours &gt;= 8 &amp;&amp; hours &lt;= 11)
    {
        session = String.Empty;
    }
    else if (hours &gt;= 12 &amp;&amp; hours &lt;= 15)
    {
        session = String.Empty;
    }
    else if (hours &gt;= 16 &amp;&amp; hours &lt;= 20)
    {
        session = String.Empty;
    }
    else if (hours == 22)
    {
        session = String.Empty;
    }
    else
    {
        session = String.Empty;
    }
}
else
{
    if (hours == 22)
    {
        session = String.Empty;
    }
    else if (hours == 23 || (hours &gt;= 0 &amp;&amp; hours &lt;= 6))
    {
        session = String.Empty;
    }
    else if (hours == 7)
    {
        session = String.Empty;
    }
    else if (hours &gt;= 8 &amp;&amp; hours &lt;= 12)
    {
        session = String.Empty;
    }
    else if (hours &gt;= 13 &amp;&amp; hours &lt;= 16)
    {
        session = String.Empty;
    }
    else if (hours &gt;= 17 &amp;&amp; hours &lt;= 20)
    {
        session = String.Empty;
    }
    else if (hours == 21)
    {
        session = String.Empty;
    }
    else
    {
        session = String.Empty; // I dont think this one is needed
    }
}


As you can see it's pretty long and nasty.  Is there a way to shrink it?  I was going to use a switch but in C# you can't fall through case statements.
Shouldn't you replace the whole code with session = String.Empty; ?

Let's assumme that this is just a placeholder for actual code. If you handle your different cases in order and if hours is an int, then you can make the logic a bit easier to follow :

if (hours == 23 || (hours &gt;= 0 &amp;&amp; hours &lt;= 6))
{
    session = A;
}
else if (hours == 7)
{
    session = B;
}
else if (hours &gt;= 8 &amp;&amp; hours &lt;= 11)
{
    session = C;
}
else if (hours &gt;= 12 &amp;&amp; hours &lt;= 15)
{
    session = D;
}
else if (hours &gt;= 16 &amp;&amp; hours &lt;= 20)
{
    session = E;
}
else if (hours == 22)
{
    session = F;
}
else
{
    session = G;
}


becomes

if (hours &lt; 0 || hours &gt; 23)
{
    session = G;
}
else if (hours &lt;=6)
{
    session = A;
}
else if (hours &lt;= 7)
{
    session = B;
}
else if (hours &lt;= 11)
{
    session = C;
}
else if (hours &lt;= 15)
{
    session = D;
}
else if (hours &lt;= 20)
{
    session = E;
}
else if (hours &lt;= 22)
{
    session = F;
}
else
{
    session = A;
}