BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<code> [index.cshtml] @(Html.EJ().Schedule("Schedule1") .Width("100%") .Height("525px") .Resources(res => { res.Field("ResourceId").Title("Owner").Name("Owners").AllowMultiple(true).ResourceSettings(flds => flds.Datasource(ds => ds.URL("/Home/GetResources")).Text("Text").Id("Id").Color("Color")).Add(); }) //Bind the resource data value to schedule .Group(gr => { gr.Resources(ViewBag.Resources); }) .AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor")) //Bind the appointments data to get and also perform CRUD operation .Id("BookingId") .StartTime("StartTime") .EndTime("EndTime") .ResourceFields("ResourceId") //Bind the appointmentSetting field for resource to process the resource value .StartTimeZone("StartTimeZone") .EndTimeZone("EndTimeZone")) public JsonResult GetData() //Method to get the appointments data { IEnumerable data = new ScheduleDataDataContext().Bookings.Take(100); return Json(data, JsonRequestBehavior.AllowGet); }
public JsonResult GetResources() //Method to get the resources data { IEnumerable data = new ScheduleDataDataContext().Resources.Take(100); return Json(data, JsonRequestBehavior.AllowGet); |