Exemple #1
0
    public void PageBind1()
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_InfoXJB";
        pb.FldName       = "id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = pageSize;
        if (cuttentPage == 0)
        {
            cuttentPage = pb.PageIndex;
        }
        pb.PageIndex = cuttentPage;
        int count = 0;

        pb.DoCount   = 1;
        string where = " typeid =" + typeId + " and sectype=" + sectype;
        string key = "";

        if (where.Length > 0)
        {
            key += " and Title like '%" + TextBox1.Text + "%'";
        }
        else
        {
            key += " 1=1 and Title like '%" + TextBox1.Text + "%'";
        }
        //key += " and bum_bz= " + Request.QueryString["bum_id"].ToString();
        where      += key;
        pb.StrWhere = where + " and del=0";
        mbll.GetList(pb, ref count); //获取总条数

        pb.DoCount = 0;
        List <Tunnel.Model.Tunnel_InfoXJB> modelList = new List <Tunnel.Model.Tunnel_InfoXJB>();

        mbll.GetList(pb, ref count);//获取分页结果
        modelList = mbll.GetList3(pb, ref count);

        //数据绑定
        Repeater2.DataSource = modelList;
        Repeater2.DataBind();

        //数据分页
        MTCPager1.PageSize    = pageSize;
        MTCPager1.RecordCount = count;
        MTCPager1.PageIndex   = cuttentPage;
        if (count <= pb.PageSize)
        {
            MTCPager1.Visible = false;
        }
        else
        {
            MTCPager1.Visible = true;
        }
    }
Exemple #2
0
    public void PageBind2()
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_InfoXJB";
        pb.FldName       = "id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = pageSize;
        if (cuttentPage == 0)
        {
            cuttentPage = pb.PageIndex;
        }
        pb.PageIndex = cuttentPage;
        int count = 0;

        pb.DoCount = 1;
        if (key.Length > 0)
        {
            key += " and Title like '%" + TextBox1.Text + "%'";
        }
        else
        {
            key += " 1=1 and Title like '%" + TextBox1.Text + "%'";
        }
        if (ul.LoginID == 1 || ul.JiaoSe(ul.LoginID).Equals("系统管理员"))
        {
            key += " and typeid in (92,93,94,95,96,97,98,99,100,101,102,103) ";
        }
        else
        {
            key += " and typeid in (92,93,94,95,96,97,98,99,100,101,102,103) and bum_bz= " + ul.getUserModel(ul.LoginID).m_bum.ToString() + " and userid=" + ul.LoginID;
        }
        where      += key;
        pb.StrWhere = key + " and del=0";
        mbll.GetList(pb, ref count); //获取总条数

        pb.DoCount = 0;
        List <Tunnel.Model.Tunnel_InfoXJB> modelList = new List <Tunnel.Model.Tunnel_InfoXJB>();

        modelList = mbll.GetList3(pb, ref count);//获取分页结果


        //数据绑定
        Repeater1.DataSource = modelList;
        Repeater1.DataBind();

        //数据分页
        MTCPager1.PageSize    = pageSize;
        MTCPager1.RecordCount = count;
        MTCPager1.PageIndex   = cuttentPage;
        if (count <= pb.PageSize)
        {
            MTCPager1.Visible = false;
        }
        else
        {
            MTCPager1.Visible = true;
        }
    }