C# Next Day of Week Logic : <p>I am having some issues making this code more efficient; I am writing a basic scheduler and want to know the number of days between the next run from the current day. What I have works, but it seems huge for a simple task? </p>

<p>I set the days of the week I would like using bools in a class...</p>

<p>This is what I have:</p>

<pre><code>class Schedule
{
    public string StartTime;
    public bool Monday;
    public bool Tuesday;
    public bool Wednesday;
    public bool Thursday;
    public bool Friday;
    public bool Saturday;
    public bool Sunday;
} 

Schedule jobSchedule = new Schedule();

jobSchedule.Monday = true;
jobSchedule.Tuesday = true;
jobSchedule.Wednesday = false;
jobSchedule.Thursday = true;
jobSchedule.Friday = true;
jobSchedule.Saturday = true;
jobSchedule.Sunday = true;
</code></pre>

<p>This sets up when I would like the code to run. What I would like now is a function to return an int of the number of days to the next execution... I have the following:</p>

<pre><code>   private int nextDay()
    {
        int days = 0;
        DayOfWeek dow = DateTime.Now.DayOfWeek;

        switch (dow)
        {
            case DayOfWeek.Monday:
                if (jobSchedule.Tuesday) {
                    days += 1;
                } else if (jobSchedule.Wednesday) {
                    days += 2;
                } else if (jobSchedule.Thursday) {
                    days += 3;
                } else if (jobSchedule.Friday) {
                    days += 4;
                } else if (jobSchedule.Saturday) { 
                    days += 5;
                } else if (jobSchedule.Sunday) {
                    days += 6;
                }
        break;
            case DayOfWeek.Tuesday:
                if (jobSchedule.Wednesday)
                {
                    days += 1;
                }
                else if (jobSchedule.Thursday)
                {
                    days += 2;
                }
                else if (jobSchedule.Friday)
                {
                    days += 3;
                }
                else if (jobSchedule.Saturday)
                {
                    days += 4;
                }
                else if (jobSchedule.Sunday)
                {
                    days += 5;
                }
                else if (jobSchedule.Monday)
                {
                    days += 6;
                }
                break;
            case DayOfWeek.Wednesday:
                if (jobSchedule.Thursday)
                {
                    days += 1;
                }
                else if (jobSchedule.Friday)
                {
                    days += 2;
                }
                else if (jobSchedule.Saturday)
                {
                    days += 3;
                }
                else if (jobSchedule.Sunday)
                {
                    days += 4;
                }
                else if (jobSchedule.Monday)
                {
                    days += 5;
                }
                else if (jobSchedule.Tuesday)
                {
                    days += 6;
                }
                break;
            case DayOfWeek.Thursday:
                if (jobSchedule.Friday)
                {
                    days += 1;
                }
                else if (jobSchedule.Saturday)
                {
                    days += 2;
                }
                else if (jobSchedule.Sunday)
                {
                    days += 3;
                }
                else if (jobSchedule.Monday)
                {
                    days += 4;
                }
                else if (jobSchedule.Tuesday)
                {
                    days += 5;
                }
                else if (jobSchedule.Wednesday)
                {
                    days += 6;
                }
                break;
            case DayOfWeek.Friday:
                if (jobSchedule.Saturday)
                {
                    days += 1;
                }
                else if (jobSchedule.Sunday)
                {
                    days += 2;
                }
                else if (jobSchedule.Monday)
                {
                    days += 3;
                }
                else if (jobSchedule.Tuesday)
                {
                    days += 4;
                }
                else if (jobSchedule.Wednesday)
                {
                    days += 5;
                }
                else if (jobSchedule.Thursday)
                {
                    days += 6;
                }
                break;
            case DayOfWeek.Saturday:
                if (jobSchedule.Sunday)
                {
                    days += 1;
                }
                else if (jobSchedule.Monday)
                {
                    days += 2;
                }
                else if (jobSchedule.Tuesday)
                {
                    days += 3;
                }
                else if (jobSchedule.Wednesday)
                {
                    days += 4;
                }
                else if (jobSchedule.Thursday)
                {
                    days += 5;
                }
                else if (jobSchedule.Friday)
                {
                    days += 6;
                }
                break;
            case DayOfWeek.Sunday:
                if (jobSchedule.Monday)
                {
                    days += 1;
                }
                else if (jobSchedule.Tuesday)
                {
                    days += 2;
                }
                else if (jobSchedule.Wednesday)
                {
                    days += 3;
                }
                else if (jobSchedule.Thursday)
                {
                    days += 4;
                }
                else if (jobSchedule.Friday)
                {
                    days += 5;
                }
                else if (jobSchedule.Saturday)
                {
                    days += 6;
                }
                break;
        }

        return days;
    }
</code></pre>

<p>How could I shorted this down? The above works how I want it but seems too much :(</p>

<p>Thanks for any help.</p>
