//根据TeachId查找CourseName
        public List <T_Task_Course> FindCourse(int id)
        {
            SqlConnection co = new SqlConnection();

            co.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["dataConnection"];
            SqlCommand cm = new SqlCommand();

            cm.CommandText = "select Id from T_Task_Course where TeaId=" + id;

            co.Open();
            cm.Connection = co;

            SqlDataReader        dr   = cm.ExecuteReader();
            List <T_Task_Course> list = new List <T_Task_Course>();

            while (dr.Read())
            {
                T_Task_Course    head     = new T_Task_Course();
                DALT_Task_Course head_dal = new DALT_Task_Course();
                int Id = Convert.ToInt32(dr["Id"]);
                head = head_dal.GetModel(Id);
                list.Add(head);
            }
            dr.Close();
            co.Close();
            return(list);
        }
        //王一情
        public string GetCourseTask(int userid, int userlevel)
        {
            T_Base_Teacher    teacher     = new T_Base_Teacher();
            DALT_Base_Teacher dal_Teacher = new DALT_Base_Teacher();

            teacher = dal_Teacher.GetModel(userid);

            DALT_Event_CourseTask     dal  = new DALT_Event_CourseTask();
            List <T_Event_CourseTask> list = new List <T_Event_CourseTask>();

            if (userlevel != 10 && userlevel != 11)
            {
                list = dal.GetStuCourseList(userid);
            }
            else
            {
                list = dal.GetTeaCourseList("WPeople=" + "'" + teacher.Name + "'");
            }

            string res = "";

            foreach (T_Event_CourseTask item in list)
            {
                T_Task_Course    course     = new T_Task_Course();
                DALT_Task_Course dal_course = new DALT_Task_Course();
                course = dal_course.GetModel(item.CourseId);

                string st_date = ((DateTime)item.StartWeek).ToString("yyyy-MM-dd");
                string st      = st_date + " " + item.StartTime;
                string ed      = st_date + " " + item.EndTime;

                res += "{\"id\":\"" + item.Id
                       + "\",\"title\":\"" + course.Name
                       + "\",\"type\":\"" + item.Type
                       + "\",\"des\":\"" + item.Description
                       + "\",\"start\":\"" + st
                       + "\",\"end\":\"" + ed + "\"}";
                res += ",";
            }


            return(res);
        }