public JsonResult GetTeacherInfo(int teacherId)
        {
            List <CourseAssign> coursesIdList = CourseAssignManager.GetCoursesByTeacherId(teacherId);
            decimal             credit        = 0;

            foreach (CourseAssign course in coursesIdList)
            {
                credit += CourseManager.GetCourseById(course.CourseId).Credit;
            }
            decimal takenCredit     = TeacherManager.GetTeacherById(teacherId).Credit;
            decimal remainingCredit = takenCredit - credit;

            var teacher = new Teacher();

            teacher.Credit          = takenCredit;
            teacher.RemainingCredit = remainingCredit;

            return(Json(teacher));
        }