We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Appointments with multiple resources

Thread ID:

Created:

Updated:

Platform:

Replies:

132807 Sep 22,2017 02:28 AM Jun 21,2018 09:14 AM ASP.NET Web Forms 3
loading
Tags: Schedule
James Osborne
Asked On September 22, 2017 02:28 AM

Is it possible to assign an appointment to multiple resources, and if so how is that possible, i've tried leaving the resource id blank and comma separated on my objects and neither currently displays on the resources?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On September 22, 2017 03:24 AM

 
Thank you for contacting Syncfusion support. 
 
Yes, it is possible to assign multiple resources for a single appointment and for the same we have prepared the below sample for your reference. In the sample db, Meeting appointment will be assigned to 3 resources and it will render in Schedule as shown below. Kindly view the below video demo which will demonstrate the single appointment creation for multiple resources and for this scenario AllowMultiple field should be set to true. 
 
<Code> 
<ej:Schedule ID="Schedule1" ClientIDMode="Static" Height="525px" Width="100%" CurrentDate="5/5/2014" runat="server" DataSourceID="SqlDataSource1">    
    <Group Resources="Owners"/> 
<Resources> 
    <ej:Resources Field="OwnerId" Name="Owners" Title="Owner" AllowMultiple="true"> 
        <ResourceSettings Color="color" Id="id" Text="text"></ResourceSettings> 
    </ej:Resources> 
</Resources> 
     <AppointmentSettings ApplyTimeOffset="false" Id="Id" Subject="Subject" AllDay="AllDay" StartTime="StartTime" EndTime="EndTime" Recurrence="Recurrence" RecurrenceRule="RecurrenceRule" ResourceFields="OwnerId"/> 
</ej:Schedule> 
</Code> 
 
 
 
 
 
Note: Even though single appointment is created for 3 resources, db will store the appointment for each resource separately as showm above. 
 
Regards, 
Karthigeyan 



Frederik Gysel
Replied On June 20, 2018 07:59 AM

Hi,

How is the INSERT statement executed 3 times when working with CRUD?

Thank you
Frederik

Velmurugan S [Syncfusion]
Replied On June 21, 2018 09:14 AM

Hi Frederik, 
 
We would like to inform you that, we need to implement a loop to save/insert the created single appointment for multiple resources in the data base table. For example, if you are assigning an appointment for 3 resources, Scheduler will create and send 3 appointment object to the Server Side control method and within that method (ex: CrudResult) we need to include one for loop and save all the three appointment objects in database. Please refer to the following code example to save singe appointment for multiple resources. 
        [WebMethod] 
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static List<ScheduleAppointment> CrudResult(List<ScheduleAppointment> added, List<ScheduleAppointment> changed, List<ScheduleAppointment> deleted) 
        { 
            ScheduleDataDataContext db = new ScheduleDataDataContext(); 
            int intMax = db.ScheduleAppointments.ToList().Count > 0 ? db.ScheduleAppointments.ToList().Max(p => p.Id) : 0; 
            if (added != null && added.Count > 0) 
            { 
                for (int i = 0; i < added.Count; i++) 
                { 
                    intMax = db.ScheduleAppointments.ToList().Count > 0 ? db.ScheduleAppointments.ToList().Max(p => p.Id) : 0; 
                    var value = added[i]; 
                    DateTime startTime = Convert.ToDateTime(value.StartTime); 
                    DateTime endTime = Convert.ToDateTime(value.EndTime); 
                    ScheduleAppointment appoint = new ScheduleAppointment(); 
                    appoint.Id = intMax + 1; 
                    appoint.Subject = value.Subject; 
                    appoint.StartTime = startTime; 
                    appoint.EndTime = endTime; 
                    appoint.AllDay = value.AllDay; 
                    appoint.Recurrence = value.Recurrence; 
                    appoint.RecurrenceRule = value.RecurrenceRule; 
                    appoint.OwnerId = value.OwnerId; 
                    db.ScheduleAppointments.InsertOnSubmit(appoint); 
                    db.SubmitChanges(); 
                }                 
            } 
            ---------------------- 
            ---------------------- 
            ---------------------- 
           return db.ScheduleAppointments.ToList(); 
        } 
 
 
We have prepared the Schedule CRUD sample with the above code example and using local database, which can be downloaded from the following location. 
 
Kindly try with the above sample and let us know if you need any further assistance on this. 
Regards,
Velmurugan    


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;