public void ShowData(string RongYuTypeNo)
 {
     WebProject.BLL.BaseData.ZT_COM_RongYu bll_RongYu = new WebProject.BLL.BaseData.ZT_COM_RongYu();
     DataSet ds = null;
     if (RongYuTypeNo == "ALL")
     {
         ds = bll_RongYu.GetList("");
     }
     else
     {
         ds = bll_RongYu.GetList("RongYuTypeNo='" + RongYuTypeNo + "'");
     }
     if (ds.Tables[0].Rows.Count > 0)
     {
         this.lblMessage.Visible = false;
         this.btnDeleteSelect.Visible = true;
         this.GridView1.Visible = true;
         this.GridView1.DataSource = ds;
         this.GridView1.DataBind();
     }
     else
     {
         this.lblMessage.Visible = true;
         this.btnDeleteSelect.Visible = false;
         this.GridView1.Visible = false;
     }
 }
示例#2
0
    public void ShowRongYuInfo()
    {
        int currentPage = Convert.ToInt32(this.dang.Text);  //当前页
        WebProject.BLL.BaseData.ZT_COM_RongYu bll_RongYu = new WebProject.BLL.BaseData.ZT_COM_RongYu();
        DataSet ds = bll_RongYu.GetList(" 1=1 ");

        this.count.Text = ds.Tables[0].Rows.Count.ToString();
        if (ds.Tables[0].Rows.Count != 0)
        {
            System.Web.UI.WebControls.PagedDataSource pds = new PagedDataSource();
            pds.DataSource = ds.Tables[0].DefaultView;
            pds.AllowPaging = true;
            pds.PageSize = 6;
            pds.CurrentPageIndex = currentPage - 1; //当前页面索引,索引号从0开始
            this.countpage.Text = pds.PageCount.ToString();//总页数

            if (currentPage == 1)
            {
                this.shou.Enabled = false;
                this.shang.Enabled = false;
            }
            else
            {
                this.shou.Enabled = true;
                this.shang.Enabled = true;
            }
            if (currentPage == pds.PageCount)
            {
                this.xia.Enabled = false;
                this.last.Enabled = false;
            }
            else
            {
                this.xia.Enabled = true;
                this.last.Enabled = true;
            }

            this.DataList1.DataSource = pds;
            this.DataList1.DataBind();
        }

        else
        {
            this.lblMessage.Visible = true;
            this.countpage.Text = this.dang.Text;
            this.shou.Enabled = false;
            this.shang.Enabled = false;
            this.xia.Enabled = false;
            this.last.Enabled = false;

        }
    }