public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPKaoHeRW MyModel = new ZWL.BLL.ERPKaoHeRW(); DataSet ds = MyModel.GetList("RenWuName Like '%" + this.TextBox1.Text + "%' order by ID desc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["Type"].ToString() == "XM") { ZWL.BLL.ERPKaoHeXM MyModel = new ZWL.BLL.ERPKaoHeXM(); DataSet MYDT = MyModel.GetList(""); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { this.Label1.Text = this.Label1.Text + "<img src=../images/ico_clip.gif /> " + MYDT.Tables[0].Rows[i]["XiangMuName"].ToString() + " 所占分值:" + MYDT.Tables[0].Rows[i]["FenZhi"].ToString() + "<BR>"; } } else { ZWL.BLL.ERPKaoHeRW MyModel = new ZWL.BLL.ERPKaoHeRW(); DataSet MYDT = MyModel.GetList(""); for (int i = 0; i < MYDT.Tables[0].Rows.Count; i++) { this.Label1.Text = this.Label1.Text + "<img src=../images/ico_clip.gif /> " + MYDT.Tables[0].Rows[i]["RenWuName"].ToString() + " 所占分值:" + MYDT.Tables[0].Rows[i]["FenZhi"].ToString() + "<BR>"; } } } }