2025-03-27 15:05:14 +08:00

74 lines
2.5 KiB
C#

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.Staff
{
public partial class ObjectTree : SuperMap.RealEstate.Web.UI.PageValid
{
private Storage.Business.DEPARTMENT _DEPARTMENT = null;
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
try
{
ButtonAddType.OnClientClick = GetOpenPopDialogClientScript("StaffPage.aspx", "StaffPage", 950, 800, true, false, true);
ButtonBatchAdd.OnClientClick = GetOpenPopDialogClientScript("ImportStaff.aspx", "ImportStaff", 1200, 800, true, false, true);
this.FixTreeViewDoubleClick(MyTreeView, true);
SetControlClientAction(ButtonSearch);
TreeViewBinding(false);
}
catch (Exception ex)
{
throw ex;
}
finally
{
}
}
private void TreeViewBinding(bool withChildNodes)
{
_DEPARTMENT = new Storage.Business.DEPARTMENT(this.Transaction);
MyTreeView.Nodes.Clear();
_DEPARTMENT.BindingTreeView("-1", this.MyTreeView.Nodes, this.TextBoxSearch.Text, false, "1234",
"StaffList.aspx", "", 0, "", false, false);
}
protected void MyTreeView_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (_DEPARTMENT == null)
_DEPARTMENT = new Storage.Business.DEPARTMENT(this.Transaction);
_DEPARTMENT.BindingTreeView(e.Node.Value, e.Node.ChildNodes, this.TextBoxSearch.Text, false, "1234",
"StaffList.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;
//}
MyTreeView.CollapseAll();
Expand.Text = "展开↓";
}
else if (Expand.Text == "展开↓")
{
MyTreeView.ExpandAll();
Expand.Text = "收起↑";
}
}
}
}