This is a migrated thread and some comments may be shown as answers.

[Solved] need monthly and yearly details to create recurrence rule

4 Answers 174 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 03 Jun 2008, 01:54 PM
I did get the code to create the recurrence rule for hourly and daily options. for example:

RecurrenceRule

parsedRule;
if (parsedRule != null)
{
String strType = parsedRule.Pattern.Frequency.ToString();
switch (strType)
{
case "Hourly":
{
String strInterval = parsedRule.Pattern.Interval.ToString();
txtHourly.Text = strInterval;
if (!rbHourly.Checked && !rbDaily.Checked && !rbWeekly.Checked && !rbMonthly.Checked && !rbYearly.Checked)
{
Recurrence_HidePanels();
rbHourly.Checked =
true;
pnlHourly.Visible =
true;
}
break;
}

case

"Daily":
{
String strInterval = parsedRule.Pattern.Interval.ToString();
RecurrenceDay rDays = new RecurrenceDay();
rDays = parsedRule.Pattern.DaysOfWeekMask;
if (!rbHourly.Checked && !rbDaily.Checked && !rbWeekly.Checked && !rbMonthly.Checked && !rbYearly.Checked)
{
Recurrence_HidePanels();
rbDaily.Checked =
true;
pnlDaily.Visible =
true;
if (rDays == RecurrenceDay.WeekDays)
{
rbDaily_Weekday.Checked =
true;
rbDaily_Days.Checked =
false;
}
else
{
rbDaily_Days.Checked =
true;
rbDaily_Weekday.Checked =
false;
txtDaily_Days.Text = strInterval;
}
}
break;
}
}

In the same way I want the code for 'Monthly' and 'Yearly'. Please do send me the code. Thanks

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 04 Jun 2008, 07:36 AM
Hello,

Could you please explain what exactly you want to implement? Have you seen the
Customizing the Advanced Template example. The SchedulerDefaultForm.ascx user control might contain the code that you need.



Cheers,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
developer
Top achievements
Rank 1
answered on 12 Jun 2008, 05:24 PM
I'm trying to create the recurrence rule for monthly and yearly options like how i found the code for daily, hourly and weekly recurrence rule. For example: the code i've for hourly n daily is as follows:

#region

Save the Occurence Type and it's data

if (rbHourly.Checked)

{

Int32 intInterval = Includes.Database.ConvertSQLInt32OK(txtHourly.Text);

if (intInterval > 0)

{

HourlyRecurrenceRule rrule = new HourlyRecurrenceRule(intInterval, range);

Includes.

CalendarUtils.Day_Update(intCurrent_cleID, rrule.ToString(), out strErrorMessage);

}

else

{

lblErrorAlertMessage.Text =

"Please make sure that you have specified an amount";

pnlError.Visible =

true;

}

}

else if (rbDaily.Checked)

{

if (rbDaily_Days.Checked)

{

Int32 intInterval = Includes.Database.ConvertSQLInt32OK(txtDaily_Days.Text);

if (intInterval > 0)

{

DailyRecurrenceRule rrule = new DailyRecurrenceRule(intInterval, range); // Creates a recurrence rule to repeat the appointment every two days.

Includes.

CalendarUtils.Day_Update(intCurrent_cleID, rrule.ToString(), out strErrorMessage);

}

else

{

lblErrorAlertMessage.Text =

"Please make sure that you have specified an amount";

pnlError.Visible =

true;

}

}

else if (rbDaily_Weekday.Checked)

{

RecurrenceDay rDay = RecurrenceDay.WeekDays;

DailyRecurrenceRule rrule = new DailyRecurrenceRule(rDay, range); // Creates a recurrence rule to repeat the appointment every two days.

Includes.

CalendarUtils.Day_Update(intCurrent_cleID, rrule.ToString(), out strErrorMessage);

}

}
#endregion

 similarly i want the code for Monthly and yearly

0
developer
Top achievements
Rank 1
answered on 12 Jun 2008, 05:28 PM
I'm trying to store the recurrence rule thru' functions defined by me, hence need more codes for monthly and yearly options
0
T. Tsonev
Telerik team
answered on 16 Jun 2008, 03:12 PM
Hello,

If I understand correctly, you want to create Monthly and Yearly recurrence rule. The way to do it is documented in the examples in the API reference:
http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.monthlyrecurrencerule.html
http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.yearlyrecurrencerule.html

Note that each of these classes has several overloaded constructors that you can use to define different conditions for the recurrence.

I hope this helps.

Regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
developer
Top achievements
Rank 1
Answers by
Peter
Telerik team
developer
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or