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

112 lines
4.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HWSB = SuperMap.RealEstate.HighWay.Storage.Business;
using SuperMap.RealEstate.CoreFrameWork.Dictionary.Business;
using Business = SuperMap.RealEstate.Personnel.Storage.Business;
using System.Data;
using SuperMap.RealEstate.FrameWork.Business;
using SuperMap.RealEstate.CoreFrameWork;
using System.Configuration;
using SuperMap.RealEstate.Personnel.Storage.Business;
namespace Personnel.WebSite.Modules.Leave
{
public partial class ObjectTree : SuperMap.RealEstate.Web.UI.PageValid
{
private Business.STAFF _STAFF = null;
private HWSB.SERVERPART _SERVERPART = null;
private string serverpartIds = "";
protected string _PROVINCE_CODE = ConfigurationManager.AppSettings["UmiformCommodity"].ToString().Split('|')[2];
string FieldExplain_ID
{
get
{
FieldExplain _FieldExplain = new FieldExplain(Transaction);
_FieldExplain.AddSearchParameter("FieldExplain_Field", "DIVISION_CODE");
if (_FieldExplain.Search())
{
return _FieldExplain.FieldExplain_ID.ToString();
}
else
{
throw new Exception("未配置对应的服务区数据!");
}
}
}
//定义薪资对象
//private Storage.Business.SALARY _SALARY = null;
#region ->
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
_SERVERPART = new HWSB.SERVERPART(this.Transaction);
serverpartIds = _SERVERPART.GetPassportServerPartID(PassportInfo.CityAuthority);
try
{
//设置树双击事件
this.FixTreeViewDoubleClick(MyTreeView, true);
//绑定部门树
TreeViewBinding(true);
//设置回车焦点按钮
SetControlClientAction(ButtonSearch);
}
catch (Exception ex)
{
throw ex;
}
finally
{
}
}
#endregion
#region ->
private void TreeViewBinding(bool withChildNodes)
{
MyTreeView.Nodes.Clear();
CommonHelper.BindingServerpartTreeView_Enum(this.Transaction, FieldExplain_ID, "-1", MyTreeView.Nodes, this.TextBoxSearch.Text,
true, "1234", " NVL(STATISTIC_TYPE,1000) IN (1000,3000)", null, null, false, "StaffLeaveList.aspx", "", "", false, "");
//MyTreeView.ExpandAll();
if (MyTreeView.Nodes.Count > 0)
MyTreeView.Nodes[0].Expand();//展开第一级
}
#endregion
#region ->
protected void MyTreeView_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
CommonHelper.BindingServerpartTreeView_Enum(this.Transaction, FieldExplain_ID, e.Node.Value, e.Node.ChildNodes, this.TextBoxSearch.Text,
true, "1234", " NVL(STATISTIC_TYPE,1000) IN (1000,3000)", null, null, false, "StaffLeaveList.aspx", "", "", false, "");
}
#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 = "收起↑";
}
}
}
}