示例#1
0
    //绑定文章信息
    public void DataListBindAdminNotify(int type)
    {
        DalOperationAboutAdminNotify doan = new DalOperationAboutAdminNotify();
        DataView dv = null;
        if(type==0)
          dv = doan.GetAllNotifys().Tables[0].DefaultView;
        else
         dv=doan.FindNotifyByTypeId(type).Tables[0].DefaultView;

        this.AspNetPager1.RecordCount = dv.Count;
        AspNetPager1.PageSize = CommonUtility.pageSize;

        PagedDataSource pds = new PagedDataSource();    //定义一个PagedDataSource类来执行分页功
        pds.DataSource = dv;
        pds.AllowPaging = true;

        pds.CurrentPageIndex = pageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;

        this.dlNotify.DataSource = pds;
        this.dlNotify.DataBind();

        if (pds.Count > 0)
        {
            this.dlNotify.ShowFooter = false;
        }
    }
示例#2
0
    //***第3个标签:显示某一类型的文章信息---------------开始
    //绑定文章类型列表
    protected void DataListBindNotifyByTypeId(int type)
    {
        DalOperationAboutAdminNotify DalOperationAboutAdminNotify = new DalOperationAboutAdminNotify();
        DataSet ds = DalOperationAboutAdminNotify.FindNotifyByTypeId(type);

        this.AspNetPager1.RecordCount = ds.Tables[0].DefaultView.Count;
        this.AspNetPager1.PageSize = CommonUtility.pageSize;

        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = ds.Tables[0].DefaultView;
        pds.AllowPaging = true;

        pds.CurrentPageIndex = pageIndex - 1;
        pds.PageSize = this.AspNetPager1.PageSize;

        this.dlistNotifyList.DataSource = pds;
        this.dlistNotifyList.DataBind();

        if (pds.Count > 0) {
            this.dlistNotifyList.ShowFooter = false;
        }
    }