public JsonResult LoadData(Params param) // Here we get the Start and End Date and based on that we can filter the data and return to Scheduler
{
DateTime start = DateTime.Parse(param.StartDate);
DateTime end = DateTime.Parse(param.EndDate);
var data = db.ScheduleEventDatas.Where(app => (app.StartTime >= start && app.StartTime <= end) || (app.RecurrenceRule != null && app.RecurrenceRule != "")).ToList(); // Here filtering the events based on the start and end date value.
return Json(data, JsonRequestBehavior.AllowGet);
}
public class Params
{
public string StartDate { get; set; }
public string EndDate { get; set; }
} |