NoDropAreaCollection

Jan 5, 2016 at 10:03 PM
Hello,

I am trying to add some temporary code into my program that will "block out" or prevent appointments from being scheduled. The days of the week have different definitions. However, when I run the following, the rule gets applied for every day on the calendar, not the specific date.

How can I correctly code the NoDropAreaCollection so that I can have a different criteria for Mondays vs. Tues, wed, etc.

Here is my code:

Color blackoutColor = Color.Black;
        DateTime calendarDate = new DateTime(2016, 01, 04);

        bool done = false;

        string key = "";
        while (!done)
        {
            //MONDAY
            string dateString = calendarDate.ToString("MM/dd/yyyy");




            schedule1.NoDropAreaCollection.Add(key, blackoutColor, DateTime.Parse(dateString + " 9:30:00 AM"), 180, schedule1.ProviderCollection[0]);
            schedule1.NoDropAreaCollection.Add(key, blackoutColor, DateTime.Parse(dateString + " 3:00:00 PM"), 120, schedule1.ProviderCollection[0]);

            schedule1.NoDropAreaCollection.Add(key, blackoutColor, DateTime.Parse(dateString + " 8:00:00 AM"), 120, schedule1.ProviderCollection[1]);
            schedule1.NoDropAreaCollection.Add(key, blackoutColor, DateTime.Parse(dateString + " 12:00:00 PM"), 180, schedule1.ProviderCollection[1]);

           done = true;
}