private void BindData() { RoleManageBLL bll = null; DataPage dp = new DataPage(); Entity.Sys.RoleInfo condition = new Entity.Sys.RoleInfo(); try { bll = BLLFactory.CreateBLL <RoleManageBLL>(); condition.RoleDESC = this.RoleName.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <Entity.Sys.RoleInfo> list = dp.Result as List <Entity.Sys.RoleInfo>; 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]["RoleID"].ToString()); (this.GvList.Rows[i].Cells[3].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"]; RoleManageBLL bll = null; Entity.Sys.RoleInfo info = new Entity.Sys.RoleInfo(); try { bll = BLLFactory.CreateBLL <RoleManageBLL>(); if (string.IsNullOrEmpty(id) == false) { info.RoleID = id; info = bll.Get(info); UIBindHelper.BindForm(this.Page, info); this.hiID.Value = info.RoleID; this.HiCREATEUSER.Value = info.CreateUser; this.HiCREATETIME.Value = info.CreateTime.ToString(); } else { info = new RoleInfo(); info.Powers = new List <RoleAuthority>(); } this.HiPowerList.Value = this.GetTreePowers(info); } catch (Exception ex) { throw ex; } }