/// <summary> /// 绑定Grid /// </summary> protected void BindGrid() { LTallyNoPassReasonBB tallyNoPassReasonBB = new LTallyNoPassReasonBB(); DataSet ds = new DataSet(); try { string strWhere = this.StrWhere; ds = tallyNoPassReasonBB.GetList(strWhere); this.grid.DataSource = ds.Tables[0]; this.grid.DataBind(); //赋值记录条数、页面总数 this.Label3.Text = ds.Tables[0].Rows.Count.ToString(); this.Label2.Text = this.grid.PageCount.ToString(); this.currPage.Text = (this.grid.PageIndex + 1).ToString(); } finally { tallyNoPassReasonBB.Dispose(); } }
public DataTable GetTallyNoPassReason() { LTallyNoPassReasonBB tallyNoPassReasonBB = new LTallyNoPassReasonBB(); try { DataTable dt = new DataTable(); dt = tallyNoPassReasonBB.GetList("isDel=0").Tables[0]; return dt; } finally { tallyNoPassReasonBB.Dispose(); } }