Exemplo n.º 1
0
        private void AllDataBind()
        {
            course.CourseID = int.Parse(courseid);
            course.UserID   = user.UserID;
            course.GetCourseInfo();
            Teacher_TA = course.GetCourseTeacher();

            Teacher_DataList.DataSource = course.GetCourseTeacher().Tables["TeacherName"];
            Teacher_DataList.DataBind();
            TA_DataList.DataSource = course.GetCourseTeacher().Tables["AssistantName"];
            TA_DataList.DataBind();
            if (Teacher_DataList.Items.Count == 0 && TA_DataList.Items.Count == 0)
            {
                ((HtmlGenericControl)Page.FindControl("No_t")).InnerHtml = "由于这门课程的老师或助教未注册,暂时无法发表建议o(╥﹏╥)o";
                Page.FindControl("MyAdvice_TextBox").Visible             = false;
                Page.FindControl("MyAdvice_Button").Visible          = false;
                Page.FindControl("MyAnonymousAdvice_Button").Visible = false;
            }

            myadvice = course.GetMyCourseAdvice();
            AspNetPager.RecordCount         = myadvice.Tables["CourseAdvice"].Rows.Count;
            AllMyAdvice_DataList.DataSource = FilterTable(myadvice.Tables["CourseAdvice"], AspNetPager.StartRecordIndex - 1, AspNetPager.EndRecordIndex - 1);
            AllMyAdvice_DataList.DataBind();
        }