private void BindData() { ProductInfoBLL bll = null; DataPage dp = new DataPage(); ProductInfo condition = new ProductInfo(); try { bll = BLLFactory.CreateBLL <ProductInfoBLL>(); condition.PCODE = this.PCODE.Text; condition.PNAME = this.PNAME.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <ProductInfo> list = dp.Result as List <ProductInfo>; 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[7].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
private void BindProductInfoList() { ProductInfoBLL bll = null; List <ProductInfo> array = null; bll = BLLFactory.CreateBLL <ProductInfoBLL>(); array = bll.GetList(); this.PRODUCTIONID.DataSource = array; this.PRODUCTIONID.DataBind(); }
private void BindProductInfoList() { List <DictInfo> dicts = null; ProductInfoBLL bll = null; List <ProductInfo> array = null; bll = BLLFactory.CreateBLL <ProductInfoBLL>(); array = bll.GetList(); dicts = array.Select(p => new DictInfo { ID = p.PID, Des = p.PNAME }).ToList <DictInfo>(); Tools.BindDataToDDL(this.PRODUCTIONID, dicts, Tools.QueryDDLFirstItem); }