How to use Schedule in asp.net mvc using web.config

Hi Team

I have have been following the examples here below, but i am struggling to populate exact guid with schedule. Maybe i am missing some configuration on web.config. Do i need to config this control in there as well? The problem is the cshtml on my side is not showing anything and inspected no error found, i saw some examples on Youtube about Dashboad being embedded and saw some config setting in there, if this is important can you team assist me on this regard. Last question does the data get store on the database? I see entity framework is used, do those events gets stored as localdata?

https://ej2.syncfusion.com/aspnetmvc/Schedule/LocalData#/material

1 Reply 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team October 20, 2020 11:00 AM UTC

Hi Gcobani, 

Greetings from Syncfusion Support..! 

We have prepared a CRUD sample based on your shared query “but i am struggling to populate exact guid with schedule” by modifying our Id as “GUID” type and the sample can be downloaded from the following link. 

DB structure definition: 
 

DB data collection: 
 

[Controller.cs]: 
        public JsonResult UpdateData(EditParams param) 
       { 
            if (param.action == "insert" || (param.action == "batch" && param.added != null)) // this block of code will execute while inserting the appointments 
            { 
                var value = (param.action == "insert") ? param.value : param.added[0]; 
               DateTime startTime = Convert.ToDateTime(value.StartTime); 
                DateTime endTime = Convert.ToDateTime(value.EndTime); 
                ScheduleEventData appointment = new ScheduleEventData() 
                { 
                    Id = Guid.NewGuid(), 
                    StartTime = startTime.ToLocalTime(), 
                    EndTime = endTime.ToLocalTime(), 
                    Subject = value.Subject, 
                    IsAllDay = value.IsAllDay, 
                    StartTimezone = value.StartTimezone, 
                    EndTimezone = value.EndTimezone, 
                    RecurrenceRule = value.RecurrenceRule, 
                    RecurrenceID = value.RecurrenceID, 
                    RecurrenceException = value.RecurrenceException, 
                    ConferenceId = value.ConferenceId 
                }; 
                db.ScheduleEventDatas.InsertOnSubmit(appointment); 
                db.SubmitChanges(); 
            } 
            if (param.action == "update" || (param.action == "batch" && param.changed != null)) // this block of code will execute while updating the appointment 
            { 
                var value = (param.action == "update") ? param.value : param.changed[0]; 
                var filterData = db.ScheduleEventDatas.Where(c => c.Id == value.Id); 
                if (filterData.Count() > 0) 
                { 
                    DateTime startTime = Convert.ToDateTime(value.StartTime); 
                    DateTime endTime = Convert.ToDateTime(value.EndTime); 
                    ScheduleEventData appointment = db.ScheduleEventDatas.Single(A => A.Id == (value.Id)); 
                    appointment.StartTime = startTime.ToLocalTime(); 
                    appointment.EndTime = endTime.ToLocalTime(); 
                    appointment.StartTimezone = value.StartTimezone; 
                    appointment.EndTimezone = value.EndTimezone; 
                    appointment.Subject = value.Subject; 
                    appointment.IsAllDay = value.IsAllDay; 
                    appointment.RecurrenceRule = value.RecurrenceRule; 
                    appointment.RecurrenceID = value.RecurrenceID; 
                    appointment.RecurrenceException = value.RecurrenceException; 
                    appointment.ConferenceId = value.ConferenceId; 
                } 
                db.SubmitChanges(); 
            } 
            if (param.action == "remove" || (param.action == "batch" && param.deleted != null)) // this block of code will execute while removing the appointment 
            { 
                if (param.action == "remove") 
               { 
                    ScheduleEventData appointment = db.ScheduleEventDatas.Where(c => c.Id == Guid.Parse(param.key)).FirstOrDefault(); 
                    if (appointment != null) db.ScheduleEventDatas.DeleteOnSubmit(appointment); 
                } 
                else 
                { 
                    foreach (var apps in param.deleted) 
                    { 
                        ScheduleEventData appointment = db.ScheduleEventDatas.Where(c => c.Id == apps.Id).FirstOrDefault(); 
                        if (apps != null) db.ScheduleEventDatas.DeleteOnSubmit(appointment); 
                    } 
                } 
                db.SubmitChanges(); 
            } 
            var data = db.ScheduleEventDatas.ToList(); 
            return Json(data, JsonRequestBehavior.AllowGet); 
        }        

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Hareesh 


Marked as answer
Loader.
Up arrow icon