Ejemplo n.º 1
0
    private void BindDataList()
    {
        string userCode = CurrentEmployee.EmployeeCode;
        int    count    = bll.GetRuleFocusCount(userCode);

        this.AspNetPager1.RecordCount = count;
        lblCount.Text = count.ToString();
        List <V_WR_RuleFocus> list = bll.GetRuleFocusList(this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, userCode);

        //AspNetPager修复删除最后一页最后一条记录的问题
        if (this.AspNetPager1.CurrentPageIndex > 1 && list.Count == 0)
        {
            this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex - 1;
            BindDataList();
        }
        else
        {
            this.rptRule.DataSource = list;
            this.rptRule.DataBind();
        }
    }