Beispiel #1
0
    /// <summary>
    /// 绑定信息
    /// </summary>
    private void BindInfo()
    {
        //搜索控件
        MyTitle.Value = Request.QueryString["title"];

        //组合查询条件
        List <SqlWhere> sqlWhereList = new List <SqlWhere>();

        sqlWhereList.Add(new SqlWhere(OnePageModel.TITLE, SqlWhere.Oper.Like, Request.QueryString["title"]));
        sqlWhereList.Add(new SqlWhere(OnePageModel.INBUILT, SqlWhere.Oper.Equal, true));

        //读取分页数据
        int iRecordsTotal = bll_onePage.DoCount(sqlWhereList);

        QianZhu.Utility.Pagination pagination = new QianZhu.Utility.Pagination(Request.QueryString["page"], iRecordsTotal, iPageSize, "?page=$p" + WebUtility.GetUrlParams("&", false), true);
        pagination.HAlign = QianZhu.Utility.Pagination.Align.Right;
        Paging.InnerHtml  = pagination.Show();
        List <OnePageModel> onePageList = bll_onePage.GetList(pagination.PageIndex, iPageSize, sqlWhereList);

        //绑定
        if (onePageList.Count == 0)
        {
            NoDataRow.Visible = true;
        }
        Repeater1.DataSource = onePageList;
        Repeater1.DataBind();
    }