public JsonResult IsCodeExist(string code)
        {
            List <Course> courses = courseBll.GetCourses();
            bool          isExist = courses.FirstOrDefault(u => u.Code.ToLowerInvariant().Equals(code.ToLower())) != null;

            return(Json(!isExist, JsonRequestBehavior.AllowGet));
        }
 public IEnumerable <Course> Get()
 {
     try
     {
         return(courseBLL.GetCourses());
     }
     catch (Exception ex)
     {
         throw new ArgumentException("Internal server error");
     }
 }
        //加载课程信息
        private void LoadCourseInfo()
        {
            CourseBLL bll = new CourseBLL();

            dataGridView1.DataSource = bll.GetCourses(teacher.TID);
        }