private void AddSysNodes() { DataView dvRight = new Epoint.Frame.Webbuilder.Bizlogic.Site.DB_Site_Right().SelectAll(); dvRight.RowFilter = "SiteGuid='" + this.SiteGuid + "' and AllowTo='All' and AllowType='Role'"; if (FC.GetDetail("ConsultMainSite").ConfigValue == "1" || dvRight.Count > 0) { DataView dv = ous.Select(""); EpointTreeNode node; int HasChildOu = 0; for (int i = 0; i < dv.Count; i++) { node = new EpointTreeNode(); node.Text = dv[i]["OUName"].ToString(); node.Value = dv[i]["OUGuid"].ToString(); HasChildOu = Epoint.Common.Functions.IntNull(Convert.ToString(dv[i]["HasChildOu"])); if (HasChildOu > 0) { node.PopulateOnDemand = true; node.RunClickEvtOnInit = false; //是否在生成checkbox的时候运行click事件 node.ExpandOnCheckedChanged = false; //是否在checkbox变化的时候自动展开 } node.ShowInputCtrl = true; node.CtrlClickFunction = "AutoSetOuValue(this,'" + node.Text + "','" + node.Value + "');"; TreeView1.Nodes.Add(node); } } else { DataView dv = new Epoint.WebbuilderInfo.Bizlogic.UserManage.DB_Frame_SiteOU().SelectSiteOU(this.SiteGuid); EpointTreeNode node; int HasChildOu = 0; for (int i = 0; i < dv.Count; i++) { node = new EpointTreeNode(); node.Text = dv[i]["OUName"].ToString(); node.Value = dv[i]["OUGuid"].ToString(); HasChildOu = Epoint.Common.Functions.IntNull(Convert.ToString(dv[i]["HasChildOu"])); if (HasChildOu > 0) { node.PopulateOnDemand = true; node.RunClickEvtOnInit = false; //是否在生成checkbox的时候运行click事件 node.ExpandOnCheckedChanged = false; //是否在checkbox变化的时候自动展开 } node.ShowInputCtrl = true; node.CtrlClickFunction = "AutoSetOuValue(this,'" + node.Text + "','" + node.Value + "');"; TreeView1.Nodes.Add(node); } } }
private void AddSysNodes() { DataView dvRight = new Epoint.Frame.Webbuilder.Bizlogic.Site.DB_Site_Right().SelectAll(); dvRight.RowFilter = "SiteGuid='" + this.SiteGuid + "' and AllowTo='All' and AllowType='Role'"; if (FC.GetDetail("ConsultMainSite").ConfigValue == "1" || dvRight.Count > 0) { DataView dv = ous.Select(""); EpointTreeNode node; int HasChildOu = 0, HasChildUser = 0; for (int i = 0; i < dv.Count; i++) { node = new EpointTreeNode(); node.Text = dv[i]["OUName"].ToString(); node.Value = dv[i]["OUGuid"].ToString(); HasChildOu = Epoint.Common.Functions.IntNull(Convert.ToString(dv[i]["HasChildOu"])); HasChildUser = Epoint.Common.Functions.IntNull(Convert.ToString(dv[i]["HasChildUser"])); if (HasChildOu + HasChildUser > 0) { node.PopulateOnDemand = true; node.CtrlClickFunction = "AutoSetPValue_OuGuid(this,'" + node.Value + "')"; } node.ShowInputCtrl = true; TreeView1.Nodes.Add(node); } } else { DataView dv = new Epoint.WebbuilderInfo.Bizlogic.UserManage.DB_Frame_SiteUser().SelectSiteUser(this.SiteGuid, ""); EpointTreeNode node; for (int i = 0; i < dv.Count; i++) { node = new EpointTreeNode(); node.Text = dv[i]["displayname"].ToString(); node.Value = dv[i]["UserGuid"].ToString(); node.CtrlClickFunction = "AutoSetUserValue(this,'" + node.Text + "','" + node.Value + "');"; node.ImageUrl = "../../Images/TreeImages/person.gif"; node.RunClickEvtOnInit = true;//是否在生成checkbox的时候运行click事件 node.PopulateOnDemand = false; node.ShowInputCtrl = true; TreeView1.Nodes.Add(node); } } }