public JsonResult GetTeachersByDepartmentId(int departmentId) { //var teachers = aCourseAssignManager.GetAllTeachers(); //var teacherList = teachers.Where(a => a.DepartmentId == departmentId).ToList(); //return Json(teacherList); var teacherDetails = aCourseAssignManager.GetTeacherByDepartmentId(departmentId); var courseDetails = aCourseAssignManager.GetCourseByDepartmentId(departmentId); Departmentmustafa departmentmustafa = new Departmentmustafa(); departmentmustafa.Courses = courseDetails; departmentmustafa.Teachers = teacherDetails; return(Json(departmentmustafa)); }
//Json Methods................... public JsonResult GetTeachsersByDepartmentId(int departmentId) { List <Teacher> teacherList = courseAssignManager.GetTeacherByDepartmentId(departmentId); return(Json(teacherList)); }