private void BindData() { ProduceDOMBLL bll = null; DataPage dp = new DataPage(); ProduceBOM condition = new ProduceBOM(); try { bll = BLLFactory.CreateBLL <ProduceDOMBLL>(); condition.PRODUCENAME = this.PRODUCENAME.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <ProduceBOM> list = dp.Result as List <ProduceBOM>; 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[4].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
private void BindData() { string id = Request.QueryString["id"]; ProduceDOMBLL bll = null; ProduceBOM info = new ProduceBOM(); try { bll = BLLFactory.CreateBLL <ProduceDOMBLL>(); if (!string.IsNullOrEmpty(id)) { info.PID = id; info = bll.Get(info); info.Details = bll.GetList(info.PID); UIBindHelper.BindForm(this.Page, info); this.hiID.Value = info.PID; this.HiCREATEUSER.Value = info.CREATEUSER; this.HiCREATETIME.Value = info.CREATETIME.ToString(); } else { info = new ProduceBOM(); info.Details = new List <BOMDetail>(); } //绑定明细 DataGridResult <BOMDetail> bomDetail = new DataGridResult <BOMDetail>(); bomDetail.Total = info.Details.Count; bomDetail.Rows = info.Details; foreach (BOMDetail detail in info.Details) { detail.DeleteAction = "deleteItem(\'" + detail.MATRIALID + "\')"; } this.hiBomDetailList.Value = bomDetail.GetJsonSource(); } catch (Exception ex) { throw ex; } }