using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SuperMap.RealEstate.Web.Utility; namespace SuperMap.RealEstate.Personnel.Modules.Salary { public partial class ObjectTree : SuperMap.RealEstate.Web.UI.PageValid { //定义薪资对象 private Storage.Business.SALARY _SALARY = null; #region 方法 -> 页面加载 protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; try { //设置树双击事件 this.FixTreeViewDoubleClick(MyTreeView, true); //绑定部门树 TreeViewBinding(true); //设置回车焦点按钮 SetControlClientAction(ButtonSearch); //管理工资标识按钮点击事件 SalaryTemplate.OnClientClick = GetOpenPopDialogClientScript("WageMark/WageMarkList.aspx", "WageMarkList", 800, 400); } catch (Exception ex) { throw ex; } finally { } } #endregion #region 方法 -> 部门树绑定事件 /// /// 部门树绑定事件 /// /// 是否展示子节点 private void TreeViewBinding(bool withChildNodes) { //实例化薪资对象 _SALARY = new Storage.Business.SALARY(this.Transaction); MyTreeView.Nodes.Clear(); //绑定部门树 _SALARY.BindingTreeView("-1", this.MyTreeView.Nodes, this.TextBoxSearch.Text, true, "1234", "SalaryList.aspx"); } #endregion #region 方法 -> 树节点点击事件 protected void MyTreeView_TreeNodePopulate(object sender, TreeNodeEventArgs e) { //实例化薪资对象 if (_SALARY == null) { _SALARY = new Storage.Business.SALARY(this.Transaction); } _SALARY.BindingTreeView(e.Node.Value, e.Node.ChildNodes, this.TextBoxSearch.Text, true, "1234", "SalaryList.aspx"); } #endregion #region 方法 -> 查询按钮事件 protected void ButtonSearch_Click(object sender, EventArgs e) { TreeViewBinding(true); } #endregion 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 = "收起↑"; } } } }