Hello, I'm trying to build a weekly recurrence rule string based on 7 asp.net checkboxes (1 for each day of the week) and was wondering what the c# code should look like. Here is my initial novice attempt which is probably way off as it doesn't appear to be working:
var temp_WeeklyRecurrenceRule = new WeeklyRecurrenceRule(1,
(chkSU.Checked ? RecurrenceDay.Sunday : null) |
(chkMO.Checked ? RecurrenceDay.Monday : null) |
(chkTU.Checked ? RecurrenceDay.Tuesday : null) |
(chkWE.Checked ? RecurrenceDay.Wednesday : null) |
(chkTH.Checked ? RecurrenceDay.Thursday : null) |
(chkFR.Checked ? RecurrenceDay.Friday : null) |
(chkSA.Checked ? RecurrenceDay.Saturday : null),
Temp_Recurrence_range_Standard);
I'm hoping that there's an easy way of having it check each week day checkbox and then append it or not append it if it wasn't checked to the WeeklyRecurrenceRule object instead of having it check all different combinations.
Thanks in advance.
var temp_WeeklyRecurrenceRule = new WeeklyRecurrenceRule(1,
(chkSU.Checked ? RecurrenceDay.Sunday : null) |
(chkMO.Checked ? RecurrenceDay.Monday : null) |
(chkTU.Checked ? RecurrenceDay.Tuesday : null) |
(chkWE.Checked ? RecurrenceDay.Wednesday : null) |
(chkTH.Checked ? RecurrenceDay.Thursday : null) |
(chkFR.Checked ? RecurrenceDay.Friday : null) |
(chkSA.Checked ? RecurrenceDay.Saturday : null),
Temp_Recurrence_range_Standard);
I'm hoping that there's an easy way of having it check each week day checkbox and then append it or not append it if it wasn't checked to the WeeklyRecurrenceRule object instead of having it check all different combinations.
Thanks in advance.