Esempio n. 1
0
    public void PageBind(string where)
    {
        try
        {
            PageBase pb = new PageBase();
            pb.TblName       = "Tunnel_Cfile";
            pb.FldName       = "f_id";
            pb.ProcedureName = "pagination";
            pb.PageSize      = pageSize;
            if (cuttentPage == 0)
            {
                cuttentPage = pb.PageIndex;
            }
            pb.PageIndex = cuttentPage;
            pb.StrWhere  = where;

            if (!string.IsNullOrEmpty(where))
            {
                pb.StrWhere += "and f_type=" + int.Parse(Request.Params["fid"]);
            }
            else
            {
                pb.StrWhere += " f_type=" + int.Parse(Request.Params["fid"]);
            }
            int count = 0;
            pb.DoCount = 1;
            rbll.GetList(pb, ul.LoginID, ref count); //获取总条数

            pb.DoCount = 0;
            if (delState == true && pageSize == count)
            {
                cuttentPage  = cuttentPage - 1;
                pb.PageIndex = cuttentPage;
            }
            List <Tunnel.Model.Tunnel_Cfile> modelList = new List <Tunnel.Model.Tunnel_Cfile>();
            modelList = rbll.GetList(pb, ul.LoginID, 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;
            }
        }
        catch {
            Tunnel.Common.Message.back("不正确的ID"); return;
        }
    }
Esempio n. 2
0
    public void PageBind(string where)
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_Cfile";
        pb.FldName       = "f_id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = pageSize;
        if (cuttentPage == 0)
        {
            cuttentPage = pb.PageIndex;
        }
        pb.PageIndex = cuttentPage;
        pb.StrWhere  = where;
        if (ul.LoginID > 1 && ul.JiaoSe(ul.LoginID) != "系统管理员")
        {
            if (!string.IsNullOrEmpty(where))
            {
                pb.StrWhere += " and f_user = "******" f_user = " + ul.LoginID;
            }
        }
        int count = 0;

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

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

        modelList = rbll.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;
        }
    }