138 lines
6.0 KiB
C#
138 lines
6.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 SuperMap.RealEstate.CoreFrameWork.Modules;
|
|
using System.Data;
|
|
using SuperMap.RealEstate.Web.UI;
|
|
using SuperMap.RealEstate.Web.UI.WebControls;
|
|
using SuperMap.RealEstate.Web.Utility;
|
|
using SuperMap.RealEstate.HighWay.Storage;
|
|
using SuperMap.RealEstate.CoreFrameWork.Dictionary.Business;
|
|
using SuperMap.RealEstate.CoreFrameWork;
|
|
using HWSB = SuperMap.RealEstate.HighWay.Storage.Business;
|
|
|
|
namespace SuperMap.RealEstate.MainTenance.Storage.Modules.ServerPartMaterial.ServerPartInfo
|
|
{
|
|
public partial class ServerPartTreeView : SuperMap.RealEstate.HighWay.Storage.UI.BasePage
|
|
{
|
|
string FieldExplain_ID
|
|
{
|
|
get
|
|
{
|
|
FieldExplain _FieldExplain = new FieldExplain();
|
|
_FieldExplain.AddSearchParameter("FieldExplain_Field", "DIVISION_CODE");
|
|
if (_FieldExplain.Search())
|
|
{
|
|
return _FieldExplain.FieldExplain_ID.ToString();
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("未配置对应的服务区数据!");
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (IsPostBack) return;
|
|
|
|
try
|
|
{
|
|
this.FixTreeViewDoubleClick(MyTreeView, true);
|
|
//SetControlClientAction(ButtonSearch);
|
|
BindServerPartData();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
}
|
|
}
|
|
|
|
#region BindServerPartData -> 绑定服务区、门店列表
|
|
private void BindServerPartData()
|
|
{
|
|
MyTreeView.Nodes.Clear();
|
|
string PartString = string.Empty;
|
|
string ProwerString = string.Empty;
|
|
//获得服务区信息
|
|
foreach (string _str in PassportInfo.CityAuthority.Split(','))
|
|
{
|
|
PartString += PartString == string.Empty ? "'" + _str + "'" : ",'" + _str + "'";
|
|
}
|
|
foreach (FieldEnum _FieldEnum in (new FieldEnum(this.Transaction)).FillCollection("WHERE FIELDENUM_VALUE IN(" + PartString + ")"))
|
|
{
|
|
ProwerString += ProwerString == "" ? _FieldEnum.FieldEnum_ID.ToString() : "," + _FieldEnum.FieldEnum_ID;
|
|
}
|
|
|
|
//HWSB.CommonHelper.BindingServerpartTreeView_Enum(this.Transaction, FieldExplain_ID, "-1", MyTreeView.Nodes, "",
|
|
// true, "1234", " NVL(STATISTIC_TYPE,1000) = 1000 ", null, null, false, "MATERIALList.aspx", "", "", "SHOPREGION", "");
|
|
////MyTreeView.ExpandAll();
|
|
//if (MyTreeView.Nodes.Count > 0)
|
|
// MyTreeView.Nodes[0].Expand();//展开第一级
|
|
|
|
TreeNode _TreeNode = new TreeNode();
|
|
_TreeNode.NavigateUrl = UriHelper.AddRequestToUrl("MATERIALList.aspx", null);
|
|
_TreeNode.Text = "全部";
|
|
_TreeNode.Value = "1=1";
|
|
string UserProvinceCode = PassportInfo.ProvinceCode;
|
|
if (!string.IsNullOrEmpty(UserProvinceCode))//云平台需要根据登陆账号的省份去查询省份名称
|
|
{
|
|
FieldEnum _FieldEnumModel = new FieldEnum();
|
|
_FieldEnumModel.AddSearchParameter("FIELDEXPLAIN_ID", FieldExplain_ID);
|
|
_FieldEnumModel.AddSearchParameter("FIELDENUM_PID", "-1");
|
|
_FieldEnumModel.AddSearchParameter("FIELDENUM_VALUE", UserProvinceCode);
|
|
if (_FieldEnumModel.Search())
|
|
{
|
|
_TreeNode.Text = _FieldEnumModel.FieldEnum_Name;
|
|
_TreeNode.Value = "1=1";
|
|
}
|
|
}
|
|
MyTreeView.Nodes.Add(_TreeNode);
|
|
foreach (HighWay.Storage.Business.SERVERPART _SERVERPART in (new HighWay.Storage.Business.SERVERPART(this.Transaction)).FillCollection(
|
|
"WHERE FIELDENUM_ID in(" + ProwerString + ") AND NVL(STATISTIC_TYPE,1000) = 1000 ORDER BY SERVERPART_INDEX,SERVERPART_CODE"))
|
|
{
|
|
TreeNode _ChildNode = new TreeNode();
|
|
_ChildNode.NavigateUrl = UriHelper.AddRequestToUrl("MATERIALList.aspx?SERVERPART_ID=" + _SERVERPART.SERVERPART_ID_Encrypt, null);
|
|
_ChildNode.Text = _SERVERPART.SERVERPART_NAME;
|
|
_ChildNode.Value = _SERVERPART.SERVERPART_ID_Encrypt;
|
|
_TreeNode.ChildNodes.Add(_ChildNode);
|
|
foreach (DataRow _DataRow in (new HighWay.Storage.Business.SERVERPARTSHOP(this.Transaction)).ExecuteDataTable(
|
|
"SELECT DISTINCT SHOPREGION FROM HIGHWAY_STORAGE.T_SERVERPARTSHOP WHERE SERVERPART_ID = " +
|
|
_SERVERPART.SERVERPART_ID + " AND ISVALID = 1 ORDER BY SHOPREGION").Rows)
|
|
{
|
|
TreeNode _ChildTreeNode = new TreeNode();
|
|
_ChildTreeNode.NavigateUrl = UriHelper.AddRequestToUrl("MATERIALList.aspx?SERVERPART_ID=" +
|
|
_SERVERPART.SERVERPART_ID_Encrypt + "&SHOPREGION=" + _DataRow[0].ToString().ToEncrypt(), null);
|
|
_ChildTreeNode.Text = DictionaryHelper.GetFieldEnumName("SHOPREGION", _DataRow[0].ToString(), this.Transaction);
|
|
_ChildTreeNode.Value = _DataRow[0].ToString();
|
|
_ChildNode.ChildNodes.Add(_ChildTreeNode);
|
|
}
|
|
}
|
|
MyTreeView.ExpandAll();
|
|
}
|
|
#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 = "收起↑";
|
|
}
|
|
}
|
|
}
|
|
} |