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

Copy all appointments server side

1 Answer 17 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 09 Jan 2017, 11:29 AM

Hi, I would like to develop a staff rota system, where the staff member would copy all appointments from a "Master Rota" which they would have previously created onto the current month.

E.G the master rota would contain 4 weeks of appointments, which they can then copy each time on to the current month.  They can then do this each month to avoid having to create the appointments each time.  I know that you could set a recurring appointment but we would like to have a fixed 4 week rota which can copied onto a month just by clicking a button which would copy all appointments across from this "master rota" onto the Live rota.

 

Would this be possible?

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 12 Jan 2017, 08:21 AM
Hello David,

In order to achieve the needed functionality, you can clone the appointments for a specific range (one month in your case), clone them and insert the new appointments with 1 month increased. :

protected void Buttoon1_Click(object sender, EventArgs e)
{
 
    DateTime startTime = new DateTime(2017, 1, 1);
    DateTime endtime = startTime.AddMonths(1);
 
    foreach (Appointment app in RadScheduler1.Appointments.GetAppointmentsInRange(startTime, endtime))
    {
        Appointment newAppointment = new Appointment();
        newAppointment = app.Clone();
        newAppointment.Start =  newAppointment.Start.AddMonths(1);
        newAppointment.End = newAppointment.End.AddMonths(1);
        RadScheduler1.InsertAppointment(newAppointment);
    }
}


Regards,
Nencho
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
David
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or