Пример #1
0
    private void bindData()
    {
        DataTable dt = AddSQLStringToDAL.GetDT4Course("Teacher_id", "Current_Week", Session["userID"].ToString(), Session["currentWeek"].ToString());

        if (dt.Rows.Count == 0)
        {
            lbTitile.Text = "您本周无授课安排";
        }
        else
        {
            DataView dv = dt.DefaultView;
            dv.Sort = "week ASC,time";
            Repeater1.DataSource = dv.ToTable();
            Repeater1.DataBind();
        }

        //作业处理
        int weekNum = Convert.ToInt32(Session["currentWeek"].ToString()), lastWeek = 0;

        if (weekNum > 1)
        {
            lastWeek = weekNum - 1;
        }
        if (lastWeek != 0)
        {
            //TODO
            DataTable dtHome = AddSQLStringToDAL.GetDTBySQL("TabCourses", "Teacher_ID", "Current_Week", "Count", Session["userID"].ToString(), lastWeek.ToString(), "已布置作业");
            if (dtHome.Rows.Count == 0)
            {
                lbWork.Text = "上周作业没有未批改情况!";
            }
            else
            {
                Repeater2.DataSource = dtHome;
                Repeater2.DataBind();
            }
        }
    }