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. Image for the cookie policy date

Schedule Control Resources and Appointment Management


I've been working this week on trying to figure out how to use the schedule control. I have some basic functionality down, but I am struggling with a few items. 

I am attempting to model your sample app located at http://mvc.syncfusion.com/demos/web/AppointmentPlanner/Home/Index.

I love the way this looks and feels, but am having a hard time wring everything up correctly. 

I'm trying to load in a list of resources from an employees table containing the following fields:

I want to be able to create appointments for patients from the patient table:

I'd also like to be able to create a new patient record and add it to the patient table. 

Appointments are currently being created in DefaultSchedule table. 

The appointment should be for the patient and the owner should be the employee resource selected when creating the appointment.  

Here is my controller code:

 List<String> resources = new List<String>();
            ViewBag.Resources = resources;
            return View();

        public ActionResult GetData()
            IEnumerable data = new PPDB2Entities().DefaultSchedules.Take(100); // nw.Appointment.Take(5);
            return Json(data, JsonRequestBehavior.AllowGet);

        public JsonResult GetResources()
            IEnumerable data = new PPDB2Entities().Employees.Take(100);
            return Json(data, JsonRequestBehavior.AllowGet);

My View:

    ViewBag.Title = "Home Page";

          .Resources(res => { res.Field("employeeId").Title("Owner").Name("Owners").AllowMultiple(true).ResourceSettings(flds => flds.Datasource(ds => ds.URL("/Home/GetResources")).Text("Text").Id("Id").Color("Color")).Add(); })
            .Group(gr =>
            .AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor"))

The schedule control will not load at all with this code. If I populate the resources from a list instead, it does show and I can create appointments, but they do not show on the calendar for the given resource and the ownerId is not saved in the database. 

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team February 23, 2017 01:49 PM UTC

Hi Michael, 
Thank you for contacting Syncfusion support. 
We have prepared the Appointment Planner CRUD sample which can be download from the below location. 
In the sample resource and Scheduler data are fetched from data source and appointment added/edited/deleted with in Scheduler will be reflected in database too. Kindly refer the below code example used in the sample. 
.Resources(res => 
                           .ResourceSettings(flds => flds.Datasource(ViewBag.departmentDB).Text("Text").Id("Id").GroupId("GroupId").Color("Color")).Add(); 
                            .ResourceSettings(flds => flds.Datasource(ViewBag.doctorDB).Text("text").Id("Id").GroupId("GroupId").Color("Color")).Add(); 
.AppointmentSettings(fields => fields.Datasource(ds => ds.URL("Home/GetHspt").CrudURL("Home/Batch").Adaptor("UrlAdaptor")) 
Note: In the sample, CRUD operation will be performed only for Scheduler part and not for Category, Doctors, Waiting list labeled portions. 

Live Chat Icon For mobile
Up arrow icon