private void BindData() { WorkGroupBLL bll = null; DataPage dp = new DataPage(); WorkGroup condition = new WorkGroup(); try { bll = BLLFactory.CreateBLL <WorkGroupBLL>(); condition.PNAME = this.PNAME.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <WorkGroup> list = dp.Result as List <WorkGroup>; this.GvList.DataSource = list; this.GvList.DataBind(); for (int i = 0; i < this.GvList.Rows.Count; i++) { string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString()); (this.GvList.Rows[i].Cells[5].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
private void BindWorkGroup() { WorkGroupBLL bll = null; List <WorkGroup> array = null; bll = BLLFactory.CreateBLL <WorkGroupBLL>(); array = bll.GetList(); this.WOID.DataSource = array; this.WOID.DataBind(); }