private void saveRecurrence(Recurrence recurrence) { recurrence.IsActive = true; recurrence.DateEnd = txtRecurrenceEndDate.Date; recurrence.DateStart = txtRecurrenceStartDate.Date; recurrence.RepeatFrequencyID = ddlRecurringRepeatFrequency.SelectedIndex > 0 ? (int?)Convert.ToInt32(ddlRecurringRepeatFrequency.SelectedValue) : null; recurrence = RecurrenceManager.Save(recurrence); }
private void saveRecurrence(Recurrence recurrence) { recurrence.IsActive = true; recurrence.DateEnd = txtRecurrenceEndDate.Date; recurrence.DateStart = txtRecurrenceStartDate.Date; recurrence.RepeatFrequencyID = ddlRecurringRepeatFrequency.SelectedIndex > 0 ? (int?)Convert.ToInt32(ddlRecurringRepeatFrequency.SelectedValue) : null; //repeat daily recurrence.IsRepeatDailyEveryDay = cbxRecurringDailyEveryDay.Checked; recurrence.IsRepeatDailyForEveryNDays = cbxRecurringDailyEveryNDay.Checked; recurrence.RepeatDailyForEveryNDays = txtRecurringDailyEveryNDays.ValueInt; // repeat weekly recurrence.RepeatWeeklyEveryNWeeks = txtRepeatWeeklyEveryNWeeks.ValueInt; recurrence.IsRepeatWeeklyEveryNWeeksSun = cbxEveryWeekSun.Checked; recurrence.IsRepeatWeeklyEveryNWeeksMon = cbxEveryWeekMon.Checked; recurrence.IsRepeatWeeklyEveryNWeeksTue = cbxEveryWeekTue.Checked; recurrence.IsRepeatWeeklyEveryNWeeksWed = cbxEveryWeekWed.Checked; recurrence.IsRepeatWeeklyEveryNWeeksThur = cbxEveryWeekThu.Checked; recurrence.IsRepeatWeeklyEveryNWeeksFri = cbxEveryWeekFri.Checked; recurrence.IsRepeatWeeklyEveryNWeeksSat = cbxEveryWeekSat.Checked; // repeat monthly recurrence.IsRepeatMonthlyOnDay = cbxRecurringMonthlyOnDay.Checked; recurrence.IsRepeatMonthlyOn = cbxRecurringMonthlyOn.Checked; recurrence.RepeatMonthlyOnDay = txtRecurringMonthlyOnDay.ValueInt; recurrence.RepeatMonthlyOnDayEvery = txtRecurringMonthlyOnDayEvery.ValueInt; recurrence.RepeatMonthlyOn = Convert.ToInt32(ddlRecurringMonthlyOn.SelectedValue); recurrence.RepeatMonthlyOnWeekDay = Convert.ToInt32(ddlRecurringMonthlyWeekDay.SelectedValue); recurrence.RepeatMonthlyOnEvery = txtRecurringMonthlyWeekDayOfEveryMonth.ValueInt; // yearly recurrence.IsRepeatYearlyOnEvery = cbxRecurringYearlyOnEvery.Checked; recurrence.RepeatYearlyMonth = Convert.ToInt32(ddlRepeatYearlyOnEveryMonth.SelectedValue); recurrence.RepeatYearlyMonthDay = txtRecurringYearlyOnEveryMonthDay.ValueInt; recurrence.IsRepeatYearlyOn = cbxRecurringYearlyOn.Checked; recurrence.RepeatYearlyOn = Convert.ToInt32(ddlRecurringYearlyOn.SelectedValue); recurrence.RepeatYearlyOnWeekDay = Convert.ToInt32(ddlRecurringYearlyWeekDay.SelectedValue); recurrence.RepeatYearlyOnMonth = Convert.ToInt32(ddlRecurringYearlyMonth.SelectedValue); // save recurrence recurrence = RecurrenceManager.Save(recurrence); }