public void ShowLiuYanInfo() { int currentPage = Convert.ToInt32(this.dang.Text); //当前页 WebProject.BLL.BaseData.ZT_COM_LiuYan bll_LiuYan = new WebProject.BLL.BaseData.ZT_COM_LiuYan(); DataSet ds = bll_LiuYan.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 = 5; //设置页面显示的数目 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.Repeater1.DataSource = pds; this.Repeater1.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; } }
public void ShowData() { WebProject.BLL.BaseData.ZT_COM_LiuYan bll_LiuYan = new WebProject.BLL.BaseData.ZT_COM_LiuYan(); DataSet ds = bll_LiuYan.GetList(""); 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; } }