/// <summary> /// 绑定屏幕数据 /// </summary> /// <param name="reloadTree">重新加部门载树</param> private void BindData(bool reloadTree) { // 加载树 if (reloadTree) { // 获取客户分类数据 this.dtCustomerClass = customerClassService.GetDataTable(UserInfo); if (!this.UserInfo.IsAdministrator) { BasePageLogic.CheckTreeParentId(this.dtCustomerClass, CustomerClassTable.FieldId, CustomerClassTable.FieldParentId); } this.LoadTree(); if (this.tvCustomerClass.SelectedNode == null) { if (this.tvCustomerClass.Nodes.Count > 0) { if (this.parentEntityId.Length == 0) { this.tvCustomerClass.SelectedNode = this.tvCustomerClass.Nodes[0]; } else { BasePageLogic.FindTreeNode(this.tvCustomerClass, this.parentEntityId); if (BasePageLogic.TargetNode != null) { this.tvCustomerClass.SelectedNode = BasePageLogic.TargetNode; // 展开当前选中节点的所有父节点 BasePageLogic.ExpandTreeNode(this.tvCustomerClass); } } if (this.tvCustomerClass.SelectedNode != null) { // 让选中的节点可视,并用展开方式 this.tvCustomerClass.SelectedNode.Expand(); this.tvCustomerClass.SelectedNode.EnsureVisible(); } } } } if (this.ParentEntityId.Length > 0) { if (reloadTree) { // 获得得到分类下的客户列表 this.GetCustomerList(); } } // 设置按钮状态 this.SetCustomerControlState(); }