using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using SuperMap.RealEstate.Web.Utility; using Business = SuperMap.RealEstate.Personnel.Storage.Business; namespace SuperMap.RealEstate.Personnel.Modules.StaffRank { public partial class ObjectTree : SuperMap.RealEstate.Web.UI.PageValid { private Storage.Business.RANK _RANK = null; protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; try { SetControlClientAction(this.ButtonAddType, "parent.ObjectDetail_StaffRank", "StaffRankPage.aspx", true); this.FixTreeViewDoubleClick(MyTreeView, true); SetControlClientAction(ButtonSearch); TreeViewBinding(false); } catch (Exception ex) { throw ex; } finally { } } private void TreeViewBinding(bool withChildNodes) { _RANK = new Storage.Business.RANK(this.Transaction); MyTreeView.Nodes.Clear(); _RANK.BindingTreeView("-1", this.MyTreeView.Nodes, this.TextBoxSearch.Text, false, "1234", "StaffRankPage.aspx", "", 0, "", false, false); } protected void MyTreeView_TreeNodePopulate(object sender, TreeNodeEventArgs e) { if (_RANK == null) _RANK = new Storage.Business.RANK(this.Transaction); _RANK.BindingTreeView(e.Node.Value, e.Node.ChildNodes, this.TextBoxSearch.Text, false, "1234", "StaffRankPage.aspx", "", 0, "", false, false); } protected void ButtonSearch_Click(object sender, EventArgs e) { TreeViewBinding(false); } protected void Expand_Click(object sender, EventArgs e) { if (Expand.Text == "收起↑") { foreach (TreeNode _TreeNode in MyTreeView.Nodes) { _TreeNode.Expanded = false; } Expand.Text = "展开↓"; } else if (Expand.Text == "展开↓") { MyTreeView.ExpandAll(); Expand.Text = "收起↑"; } } } }