Esempio n. 1
0
        public JsonResult GetCourseList(int departmentId)
        {
            IEnumerable <Course> coursesList             = aCourseManager.GetCourseByDeptId(departmentId);
            IEnumerable <CourseAssignTeacher> assingList =
                aCourseAssignToTeacherManager.GetListByDepartmentId(departmentId);

            List <Course> courses = new List <Course>();

            foreach (var list in coursesList)
            {
                CourseAssignTeacher assign = assingList.FirstOrDefault(x => x.CourseId == list.Id);
                if (assign == null)
                {
                    courses.Add(list);
                }
            }
            return(Json(courses, JsonRequestBehavior.AllowGet));
        }