private void BindWorkStation() { WorkStationBLL bll = null; List <WorkStation> array = null; bll = BLLFactory.CreateBLL <WorkStationBLL>(); array = bll.GetList(); this.STID.DataSource = array; this.STID.DataBind(); }
private void BindData() { WorkStationBLL bll = null; DataPage dp = new DataPage(); WorkStation condition = new WorkStation(); string wsID = Request.QueryString["wsID"]; if (!string.IsNullOrEmpty(wsID)) { if (wsID.Split('|')[1] == "F") { condition.FACTORYPID = wsID.Split('|')[0]; } else { condition.PRODUCTLINEPID = wsID.Split('|')[0]; } } try { bll = BLLFactory.CreateBLL <WorkStationBLL>(); condition.WSCODE = this.WSCODE.Text; condition.WSNAME = this.WSNAME.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <WorkStation> list = dp.Result as List <WorkStation>; 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[8].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }