private void BiudTree(int treeType) { DataTable table; SysTree tree = new SysTree(); if (treeType > -1) { table = tree.GetTreeList("TreeType = " + treeType).Tables[0]; } else { table = tree.GetTreeList("").Tables[0]; } this.listTarget.Items.Clear(); this.listTarget.Items.Add(new ListItem(Site.lblRootDirectory, "0")); foreach (DataRow row in table.Select("ParentID= " + 0)) { string str = row["NodeID"].ToString(); string text = row["TreeText"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, str)); int parentid = int.Parse(str); string blank = "├"; this.BindNode(parentid, table, blank); } this.listTarget.DataBind(); }
private void BiudTree(int treeType) { DataTable table; SysTree tree = new SysTree(); if (treeType > -1) { table = tree.GetTreeList("TreeType = " + treeType).Tables[0]; } else { table = tree.GetTreeList("").Tables[0]; } this.listTarget.Items.Clear(); this.listTarget2.Items.Clear(); this.listTarget.Items.Add(new ListItem(SysManage.listTargetOne, "-1")); this.listTarget.Items.Add(new ListItem(SysManage.listTargetTwo, "0")); this.listTarget2.Items.Add(new ListItem(SysManage.listTargetTwo, "0")); foreach (DataRow row in table.Select("ParentID= " + 0)) { string str = row["NodeID"].ToString(); string text = row["TreeText"].ToString(); row["ParentID"].ToString(); row["PermissionID"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, str)); this.listTarget2.Items.Add(new ListItem(text, str)); int parentid = int.Parse(str); string blank = "├"; this.BindNode(parentid, table, blank); } this.listTarget.DataBind(); this.listTarget2.DataBind(); this.listTarget2.Items.Insert(0, new ListItem("移动到...", "")); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack && (this.TreeType <= -1)) { this.username = base.CurrentUser.UserName; DataSet set = new SysTree().GetEnabledTreeByParentId(0, 4, true); this.LoadTree(set.Tables[0]); } }
protected void Page_Load(object sender, EventArgs e) { this.username = base.CurrentUser.TrueName; if (!base.IsPostBack) { DataSet treeList = new SysTree().GetTreeList("ParentID=0"); this.LoadTree(treeList.Tables[0]); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { this.id = base.Request.Params["id"]; if ((this.id == null) || (this.id.Trim() == "")) { base.Response.Redirect("treelist.aspx?TreeType=" + this.TreeType); base.Response.End(); } SysTree tree = new SysTree(); SysNode node = tree.GetNode(int.Parse(this.id)); this.lblID.Text = this.id; this.lblOrderid.Text = node.OrderID.ToString(); this.lblName.Text = node.TreeText; if (node.ParentID == 0) { this.lblTarget.Text = Site.lblRootDirectory; } else { this.lblTarget.Text = tree.GetNode(node.ParentID).TreeText; } this.lblUrl.Text = node.Url; this.Image1.ImageUrl = node.ImageUrl; Permissions permissions = new Permissions(); if (node.PermissionID == -1) { this.lblPermission.Text = SysManage.lblPermissionText; } else { this.lblPermission.Text = permissions.GetPermissionName(node.PermissionID); } switch (node.TreeType) { case 0: this.lblTreeType.Text = SysManage.dropBackendSystem; break; case 1: this.lblTreeType.Text = SysManage.dropBackendEnterprise; break; case 2: this.lblTreeType.Text = SysManage.dropBackendAgent; break; case 3: this.lblTreeType.Text = SysManage.dropBackendUser; break; } this.lblEnable.Text = node.Enabled ? SysManage.lblEnableTrue : SysManage.lblEnableFalse; this.lblDescription.Text = node.Comment; } }
protected void Page_Load(object sender, EventArgs e) { this.username = string.IsNullOrWhiteSpace(base.CurrentUser.NickName) ? base.CurrentUser.UserName : base.CurrentUser.NickName; if (!base.IsPostBack) { DataSet set = new SysTree().GetEnabledTreeByParentId(0, 0, true); this.LoadTree(set.Tables[0]); } this.hfCurrentID.Value = base.CurrentUser.UserID.ToString(); }
private void BiudTree() { SysTree tree = new SysTree(); DataTable dt = tree.GetTreeList("").Tables[0]; this.listTarget.Items.Clear(); this.listTarget.Items.Add(new ListItem(Site.lblRootDirectory, "0")); foreach (DataRow row in dt.Select("ParentID= " + 0)) { string str = row["NodeID"].ToString(); string text = row["TreeText"].ToString(); row["ParentID"].ToString(); row["PermissionID"].ToString(); text = "╋" + text; this.listTarget.Items.Add(new ListItem(text, str)); int parentid = int.Parse(str); string blank = "├"; this.BindNode(parentid, dt, blank); } this.listTarget.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if ((!this.Page.IsPostBack && (base.Request.Params["id"] != null)) && (base.Request.Params["id"].ToString() != "")) { string str = "zh-CN"; if (this.Session["language"] != null) { str = this.Session["language"].ToString(); } this.TreeListofLang = this.bllML.GetHashValueListByLangCache("TreeText", str); string str2 = base.Request.Params["id"]; SysTree tree = new SysTree(); SysNode modelByCache = tree.GetModelByCache(Convert.ToInt32(str2)); this.NodeName = modelByCache.TreeText; this.Page.Title = this.NodeName; DataSet allEnabledTreeByType = tree.GetAllEnabledTreeByType(0); this.LoadMenu(allEnabledTreeByType.Tables[0], modelByCache.NodeID); } }
private void ShowInfo(string id) { SysNode node = new SysTree().GetNode(int.Parse(id)); this.lblID.Text = id; this.txtOrderid.Text = node.OrderID.ToString(); this.txtTreeText.Text = node.TreeText; if (node.ParentID == 0) { this.listTarget.SelectedIndex = 0; } else { for (int j = 0; j < this.listTarget.Items.Count; j++) { if (this.listTarget.Items[j].Value == node.ParentID.ToString()) { this.listTarget.Items[j].Selected = true; } } } this.txtUrl.Text = node.Url; this.txtDescription.Text = node.Comment; this.UCDroplistPermission1.PermissionID = node.PermissionID; for (int i = 0; i < this.imgsel.Items.Count; i++) { if (this.imgsel.Items[i].Value == node.ImageUrl) { this.imgsel.Items[i].Selected = true; this.hideimgurl.Value = node.ImageUrl; } } this.drpTreeType.SelectedValue = node.TreeType.ToString(); this.chkEnable.Checked = node.Enabled; }
protected void btnSave_Click(object sender, EventArgs e) { string text = PageValidate.InputText(this.lblID.Text, 10); string s = PageValidate.InputText(this.txtOrderid.Text, 5); string str3 = this.txtTreeText.Text; string str4 = PageValidate.InputText(this.txtUrl.Text, 100); string str5 = this.hideimgurl.Value; int num = int.Parse(this.listTarget.SelectedValue); string msg = ""; if (s.Trim() == "") { msg = msg + SysManage.ErrorIDNotNull + @"\n"; } try { int.Parse(s); } catch { msg = msg + SysManage.ErrorIDFormalError + @"\n"; } if (str3.Trim() == "") { msg = msg + SysManage.ErrorNameNotNull + @"\n"; } if (msg != "") { MessageBox.ShowFailTip(this, msg); } else { int permissionID = -1; if (this.UCDroplistPermission1.PermissionID > 0) { permissionID = this.UCDroplistPermission1.PermissionID; } int num3 = -1; int num4 = -1; string str8 = "false"; string str9 = PageValidate.InputText(this.txtDescription.Text, 100); SysTree tree = new SysTree(); SysNode node = tree.GetNode(Globals.SafeInt(text, 0)); node.OrderID = new int?(int.Parse(s)); node.TreeText = str3; node.ParentID = num; node.Location = num + "." + s; node.Comment = str9; node.Url = str4.Replace(@"\", "/"); node.PermissionID = permissionID; node.ImageUrl = str5; node.ModuleID = new int?(num3); node.KeShiDM = new int?(num4); node.KeshiPublic = str8; node.TreeType = Globals.SafeInt(this.drpTreeType.SelectedValue, 0); node.Enabled = this.chkEnable.Checked; tree.UpdateNode(node); LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, string.Format("编辑菜单:【{0}】", this.txtTreeText.Text), this); base.Response.Redirect(string.Concat(new object[] { "show.aspx?id=", text, "&TreeType=", this.TreeType })); } }