using System; using System.Data; using System.Web.UI.WebControls; using SuperMap.RealEstate.CoreFrameWork; using SuperMap.RealEstate.CoreFrameWork.Dictionary.Business; using SuperMap.RealEstate.Web.Utility; using Business = SuperMap.RealEstate.HighWay.Storage.Business; namespace SuperMap.RealEstate.HighWay.Modules.MerchantsManage { public partial class MerchantsTreeView : BasePage { protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; try { SetControlClientAction(this.ButtonAddType, "parent.MerchantsObjectDetail", "MERCHANTSList.aspx?OpenState=1&DEFINETYPE=3000&DATASOURCE_TYPE=" + Request["DATASOURCE_TYPE"] + "&SENDREC_TYPE=" + Request["SENDREC_TYPE"], true); this.FixTreeViewDoubleClick(MyTreeView, true); TreeViewBinding(true); SetControlClientAction(ButtonSearch); } catch (Exception ex) { throw ex; } } /// /// 绑定商户类别树 /// /// 是否添加子节点 /// 查询字符 private void TreeViewBinding(bool withChildNodes, string obscureName = "") { Business.SERVERPART _SERVERPART = new Business.SERVERPART(this.Transaction); string _SERVERPART_IDS = ""; _SERVERPART_IDS = _SERVERPART.GetPassportServerPartID(PassportInfo.CityAuthority, "1000,1010,1001", "1000,4000"); MyTreeView.Nodes.Clear(); MyTreeView.Nodes.Add(new TreeNode("全部类型", "1=1")); MyTreeView.Nodes[0].NavigateUrl = "MerchantsList.aspx?DEFINETYPE=3000" + (string.IsNullOrWhiteSpace(Request["DATASOURCE_TYPE"]) ? "" : "&DATASOURCE_TYPE=" + Request["DATASOURCE_TYPE"]); //绑定服务区商户类型树 FieldExplain _FieldExplain = DictionaryHelper.GetFieldExplain("DIVISION_CODE", Transaction); //传参内容 string RequestStr = "&DEFINETYPE=3000&SENDREC_TYPE=" + Request["SENDREC_TYPE"] + (string.IsNullOrWhiteSpace(Request["DATASOURCE_TYPE"]) ? "" : "&DATASOURCE_TYPE=" + Request["DATASOURCE_TYPE"]); //获取商户标签数据源 DataTable DataSourceTypeTable = null; if (!string.IsNullOrWhiteSpace(Request["DATASOURCE_TYPE"])) { DataSourceTypeTable = new Business.AUTOTYPE(Transaction).FillDataTable( "WHERE AUTOTYPE_TYPEID = 3010 AND AUTOTYPE_ID IN (" + Request["DATASOURCE_TYPE"].ToDecrypt() + ")"); } //绑定商户类型树 _SERVERPART.BindingTreeView_Enum(_FieldExplain.FieldExplain_ID.ToString(), "-1", MyTreeView.Nodes[0].ChildNodes, obscureName, withChildNodes, false, "", "", null, null, true, "MERCHANTSList.aspx", true, " AND SERVERPART_ID IN (" + _SERVERPART_IDS + ")", RequestStr, false, "", null, "", true, "MERCHANTSList.aspx", DataSourceTypeTable, null); if (_SERVERPART_IDS.Split(',').Length < 5) { MyTreeView.ExpandAll(); } } protected void MyTreeView_TreeNodePopulate(object sender, TreeNodeEventArgs e) { string _SERVERPART_IDS = new Business.SERVERPART(Transaction).GetPassportServerPartID(PassportInfo.CityAuthority); Business.AUTOTYPE _AUTOTYPE = new Business.AUTOTYPE(this.Transaction); _AUTOTYPE.BindingTreeView(e.Node.ChildNodes, 3000, "", e.Node.Value, this.TextBoxSearch.Text, true, "MERCHANTSList.aspx", false, null, _SERVERPART_IDS); } protected void ButtonSearch_Click(object sender, EventArgs e) { TreeViewBinding(true, this.TextBoxSearch.Text); } protected void SERVERPART_ID_SelectedIndexChanged(object sender, EventArgs e) { TreeViewBinding(true); } } }