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

64 lines
2.7 KiB
C#

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.CoreFrameWork.Dictionary.Business;
namespace SuperMap.RealEstate.Personnel.Modules.Dictionary
{
public partial class ObjectTree : SuperMap.RealEstate.Web.UI.PageValid
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
try
{
SetControlClientAction(this.ButtonAddType, "parent.ObjectDetail_Dictionary", "PostPage.aspx", true);
this.FixTreeViewDoubleClick(MyTreeView, true);
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);
MyTreeView.Nodes.Clear();
DataTable DT = new Business.FieldEnum(Transaction).ExecuteDataTable(
@"SELECT FIELDENUM_ID,FIELDENUM_NAME,FIELDENUM_VALUE FROM PLATFORM_DICTIONARY.T_FIELDENUM WHERE FIELDEXPLAIN_ID IN
(SELECT FIELDEXPLAIN_ID FROM PLATFORM_DICTIONARY.T_FIELDEXPLAIN WHERE FIELDEXPLAIN_FIELD = 'POST') ORDER BY TO_NUMBER(FIELDENUM_INDEX)");
for (int i = DT.Rows.Count - 1; i >= 0; i--)
{
TreeNode treeNode = new TreeNode();
treeNode.Value = DT.Rows[i]["FIELDENUM_VALUE"].ToString();
treeNode.Text = DT.Rows[i]["FIELDENUM_NAME"].ToString();
treeNode.NavigateUrl = "PostPage.aspx?ID=" + DT.Rows[i]["FIELDENUM_ID"].ToEncrypt();
treeNode.ImageToolTip = "DEPARTMENT_NAME";
treeNode.ImageUrl = "/Portal/Icons/16/post.png";
treeNode.Expanded = true;
this.MyTreeView.Nodes.AddAt(0, treeNode);
}
}
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);
}
}
}