示例#1
0
    public void PageBind()
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_mail";
        pb.FldName       = "m_id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = pageSize;
        if (cuttentPage == 0)
        {
            cuttentPage = pb.PageIndex;
        }
        pb.PageIndex = cuttentPage;


        pb.StrWhere = " m_sort=0 and m_main = 1 and m_from = " + ul.LoginID;
        int count = 0;

        pb.DoCount = 1;
        mbll.GetList(pb, ref count); //获取总条数

        pb.DoCount = 0;
        if (delState == true && pageSize == count)
        {
            cuttentPage  = cuttentPage - 1;
            pb.PageIndex = cuttentPage;
        }
        List <Tunnel.Model.Tunnel_mail> modelList = new List <Tunnel.Model.Tunnel_mail>();

        modelList = mbll.GetList(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;
        }
    }
示例#2
0
    public void PageBind()
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_mail";
        pb.FldName       = "m_id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = 10;
        pb.PageIndex     = 1;
        pb.StrWhere      = " m_sort=0 and m_main = 0 and m_state=0 and m_to = " + ul.LoginID;
        pb.DoCount       = 1;
        mbll.GetList(pb, ref Count); //获取总条数
        pb.DoCount = 0;
        List <Tunnel.Model.Tunnel_mail> modelList = new List <Tunnel.Model.Tunnel_mail>();

        modelList = mbll.GetList(pb, ref Count);//获取分页结果
        //数据绑定
        Repeater1.DataSource = modelList;
        Repeater1.DataBind();
        Tunnel.BLL.Tunnel_Remind tr = new Tunnel.BLL.Tunnel_Remind();
        Repeater5.DataSource = tr.GetList("m_type<>2 and m_type<>3 and m_touser=" + ul.LoginID);
        Repeater5.DataBind();
        Label1.Text = Repeater5.Items.Count.ToString();
    }