public JsonResult GetSetupInfo() { SchedulerSetup Data = new SchedulerSetup(); var categories = (from a in db.apl_Cyca_Appointment_Category select new AppointmentList() { Id = a.AppointmentCategoryId, Description = a.Description }).ToList(); Data.AppointmentCategories.AddRange(categories); var types = (from a in db.apl_Cyca_Appointment_Type select new AppointmentList() { Id = a.AppointmentTypeId, Description = a.Description, CatId = a.AppointmentCategoryId }).ToList(); Data.AppointmentTypes.AddRange(types); //Data.AppointmentTypes.AddRange(db.apl_Cyca_Appointment_Type); return(Json(Data, JsonRequestBehavior.AllowGet)); }
// controller to send some basic setup infor for example to the index page - down to your particular implementation to decide how to do this. public JsonResult GetSetupInfo() { // PID got from cookie as shared login with VI, for the moment, get it from var at top of controllers testHarness = utils.Load <TestHarness>(utils.GetTestFileLocation()); SchedulerSetup Data = new SchedulerSetup(); Data.Employees = testHarness.Employees; Data.Branches = testHarness.Branches; Data.Equipment = testHarness.Equipment; Data.Clients = testHarness.Clients; return(Json(Data, JsonRequestBehavior.AllowGet)); }