Esempio n. 1
0
        /// <summary>
        /// 绑定数据源
        /// </summary>
        private void bind()
        {
            string classId = Request.QueryString["classID"];

            ClassBLL classBLL = new ClassBLL();
            CommonBLL commBLL = new CommonBLL();

            Label_className.Text = classBLL.get(classId).Name;

            DataTable dt = commBLL.getWeekAverageAttendaceRateByClassID(classId, false);

            AspNetPager1.RecordCount = dt.Rows.Count;

            int from = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1;
            int to = from + AspNetPager1.PageSize - 1 > AspNetPager1.RecordCount ? AspNetPager1.RecordCount : from + AspNetPager1.PageSize - 1;

            GridView1.DataSource = PageUtil.getPaged(dt, from, to);
            GridView1.DataBind();
        }