Ejemplo n.º 1
0
        /// <summary>
        /// 绑定屏幕数据
        /// </summary>
        /// <param name="reloadTree">重新加部门载树</param>
        private void BindData(bool reloadTree)
        {
            // 加载树
            if (reloadTree)
            {
                this.LoadTree();
            }

            if (this.tvModule.SelectedNode == null && this.tvModule.Nodes.Count > 0)
            {
                if (this.CurrentEntityId.Length == 0)
                {
                    this.tvModule.SelectedNode = this.tvModule.Nodes[0];
                }
                else
                {
                    BasePageLogic.FindTreeNode(this.tvModule, this.CurrentEntityId);
                    if (BasePageLogic.TargetNode != null)
                    {
                        this.tvModule.SelectedNode = BasePageLogic.TargetNode;
                        // 展开当前选中节点的所有父节点
                        BasePageLogic.ExpandTreeNode(this.tvModule);
                    }
                }

                if (this.tvModule.SelectedNode != null)
                {
                    // 让选中的节点可视,并用展开方式
                    this.tvModule.SelectedNode.Expand();
                    this.tvModule.SelectedNode.EnsureVisible();
                }
            }
        }
Ejemplo n.º 2
0
 private void GetOrganizeList()
 {
     // 获取部门数据,这里是按权限范围进行获取
     this.DTOrganize = this.GetOrganizeScope(this.PermissionItemScopeCode, true);//organizationService.GetDT(this.UserInfo);
     if (!this.UserInfo.IsAdministrator)
     {
         BasePageLogic.CheckTreeParentId(this.DTOrganize, PiOrganizeTable.FieldId, PiOrganizeTable.FieldParentId);
     }
     this.LoadTree();
     if (this.tvOrganize.SelectedNode == null && this.tvOrganize.Nodes.Count > 0)
     {
         if (this.TargetOrganizeId.Length == 0)
         {
             this.tvOrganize.SelectedNode = this.tvOrganize.Nodes[0];
         }
         else
         {
             BasePageLogic.FindTreeNode(this.tvOrganize, this.TargetOrganizeId);
             if (BasePageLogic.TargetNode != null)
             {
                 this.tvOrganize.SelectedNode = BasePageLogic.TargetNode;
                 // 展开当前选中节点的所有父节点
                 BasePageLogic.ExpandTreeNode(this.tvOrganize);
             }
         }
         if (this.tvOrganize.SelectedNode != null)
         {
             // 让选中的节点可视,并用展开方式
             this.tvOrganize.SelectedNode.Expand();
             this.tvOrganize.SelectedNode.EnsureVisible();
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 绑定屏幕数据
 /// </summary>
 /// <param name="reloadTree">重新加模块载树</param>
 private void BindData(bool reloadTree)
 {
     // 加载模块树的主键
     if (reloadTree)
     {
         // 加载模块树
         this.LoadTree();
         if (this.tvModule.SelectedNode == null)
         {
             if (this.tvModule.Nodes.Count > 0)
             {
                 if (this.parentEntityId.Length == 0)
                 {
                     this.tvModule.SelectedNode = this.tvModule.Nodes[0];
                 }
                 else
                 {
                     BasePageLogic.FindTreeNode(this.tvModule, this.parentEntityId);
                     if (BasePageLogic.TargetNode != null)
                     {
                         this.tvModule.SelectedNode = BasePageLogic.TargetNode;
                         // 展开当前选中节点的所有父节点
                         BasePageLogic.ExpandTreeNode(this.tvModule);
                     }
                 }
                 if (this.tvModule.SelectedNode != null)
                 {
                     // 让选中的节点可视,并用展开方式
                     this.tvModule.SelectedNode.Expand();
                     this.tvModule.SelectedNode.EnsureVisible();
                 }
             }
         }
     }
     if (this.ParentEntityId.Length > 0)
     {
         if (reloadTree)
         {
             this.GetModuleList();
         }
     }
     // 判断编辑权限
     if (!this.permissionEdit)
     {
         // 只读属性设置
         this.dgvInfo.Columns["colSelected"].ReadOnly    = !this.permissionEdit;
         this.dgvInfo.Columns["colFullName"].ReadOnly    = !this.permissionEdit;
         this.dgvInfo.Columns["colDescription"].ReadOnly = !this.permissionEdit;
         // 修改背景颜色
         //this.dgvInfo.Columns["colFullName"].DefaultCellStyle.BackColor = Color.White;
         //this.dgvInfo.Columns["colDescription"].DefaultCellStyle.BackColor = Color.White;
     }
     // 设置按钮状态
     this.SetControlState();
 }
        /// <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();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 绑定屏幕数据
        /// </summary>
        /// <param name="reloadTree">重新加部门载树</param>
        private void BindData(bool reloadTree)
        {
            // 加载树
            if (reloadTree)
            {
                // 获取部门数据,这里是按权限范围进行获取
                this.DTOrganize = this.GetOrganizeScope(this.PermissionItemScopeCode, this.chkInnerOrganize.Checked);//organizationService.GetDT(this.UserInfo);
                if (!this.UserInfo.IsAdministrator || this.chkInnerOrganize.Checked)
                {
                    BasePageLogic.CheckTreeParentId(this.DTOrganize, PiOrganizeTable.FieldId, PiOrganizeTable.FieldParentId);
                }
                this.LoadTree();
                if (this.tvOrganize.SelectedNode == null && this.tvOrganize.Nodes.Count > 0)
                {
                    if (this.parentEntityId.Length == 0)
                    {
                        this.tvOrganize.SelectedNode = this.tvOrganize.Nodes[0];
                    }
                    else
                    {
                        BasePageLogic.FindTreeNode(this.tvOrganize, this.parentEntityId);
                        if (BasePageLogic.TargetNode != null)
                        {
                            this.tvOrganize.SelectedNode = BasePageLogic.TargetNode;
                            // 展开当前选中节点的所有父节点
                            BasePageLogic.ExpandTreeNode(this.tvOrganize);
                        }
                    }
                    if (this.tvOrganize.SelectedNode != null)
                    {
                        // 让选中的节点可视,并用展开方式
                        this.tvOrganize.SelectedNode.Expand();
                        this.tvOrganize.SelectedNode.EnsureVisible();
                    }
                }
            }

            if (this.ParentEntityId.Length > 0 && reloadTree)
            {
                // 获得子部门列表
                this.GetOrganizeList();
            }
            // 设置按钮状态
            this.SetControlState();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 绑定屏幕数据
 /// </summary>
 /// <param name="reloadTree">重新加模块载树</param>
 private void BindData(bool reloadTree)
 {
     // 加载模块树的主键
     if (reloadTree)
     {
         // 加载模块树
         this.LoadTree();
         if (this.tvItems.SelectedNode == null)
         {
             if (this.tvItems.Nodes.Count > 0)
             {
                 if (this.treeEntityId.Length == 0)
                 {
                     this.tvItems.SelectedNode = this.tvItems.Nodes[0];
                 }
                 else
                 {
                     BasePageLogic.FindTreeNode(this.tvItems, this.treeEntityId);
                     if (BasePageLogic.TargetNode != null)
                     {
                         this.tvItems.SelectedNode = BasePageLogic.TargetNode;
                         // 展开当前选中节点的所有父节点
                         BasePageLogic.ExpandTreeNode(this.tvItems);
                     }
                 }
                 if (this.tvItems.SelectedNode != null)
                 {
                     // 让选中的节点可视,并用展开方式
                     this.tvItems.SelectedNode.Expand();
                     this.tvItems.SelectedNode.EnsureVisible();
                 }
             }
         }
     }
     if (this.TreeEntityId.Length > 0)
     {
         if (reloadTree)
         {
             this.GetItemsDetailList();
         }
     }
     // 设置按钮状态
     this.SetControlState();
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 加载树
        /// </summary>
        private void LoadTree()
        {
            // 开始更新控件,屏幕不刷新,提高效率。
            this.tvItems.BeginUpdate();
            this.tvItems.Nodes.Clear();
            var treeNode = new TreeNode();

            this.LoadTreeItems(treeNode);
            BasePageLogic.FindTreeNode(this.tvItems, this.OpenId);
            if (BasePageLogic.TargetNode != null)
            {
                this.tvItems.SelectedNode = BasePageLogic.TargetNode;
                BasePageLogic.ExpandTreeNode(this.tvItems);
                this.tvItems.SelectedNode.EnsureVisible();
                this.tvItems.SelectedNode.Expand();
            }
            // 更新控件,屏幕一次性刷新,提高效率。
            this.tvItems.EndUpdate();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 加载树形结构数据
        /// </summary>
        private void LoadTree()
        {
            // 开始更新控件,屏幕不刷新,提高效率。
            this.tvModuleList.BeginUpdate();
            this.tvModuleList.Nodes.Clear();
            TreeNode treeNode = new TreeNode();

            this.LoadTreeModule(treeNode);
            BasePageLogic.FindTreeNode(this.tvModuleList, this.OldEntityId);
            if (BasePageLogic.TargetNode != null)
            {
                this.tvModuleList.SelectedNode = BasePageLogic.TargetNode;
                BasePageLogic.ExpandTreeNode(this.tvModuleList);
                this.tvModuleList.SelectedNode.EnsureVisible();
                this.tvModuleList.SelectedNode.Expand();
            }
            // 更新控件,屏幕一次性刷新,提高效率。
            this.tvModuleList.EndUpdate();
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 绑定屏幕数据
 /// </summary>
 /// <param name="reloadTree">重新加部门载树</param>
 private void BindData(bool reloadTree)
 {
     // 加载树
     if (reloadTree)
     {
         this.LoadTree();
     }
     if (this.tvPermission.SelectedNode != null)
     {
         return;
     }
     if (this.tvPermission.Nodes.Count > 0)
     {
         if (this.CurrentEntityId.Length == 0)
         {
             this.tvPermission.SelectedNode = this.tvPermission.Nodes[0];
         }
         else
         {
             BasePageLogic.FindTreeNode(this.tvPermission, this.CurrentEntityId);
             if (BasePageLogic.TargetNode != null)
             {
                 this.tvPermission.SelectedNode = BasePageLogic.TargetNode;
                 // 展开当前选中节点的所有父节点
                 BasePageLogic.ExpandTreeNode(this.tvPermission);
             }
         }
         if (this.tvPermission.SelectedNode != null)
         {
             // 让选中的节点可视,并用展开方式
             this.tvPermission.SelectedNode.Expand();
             this.tvPermission.SelectedNode.EnsureVisible();
         }
     }
     if (this.tvPermission.SelectedNode != null)
     {
         // 让选中的节点可视,并用展开方式
         this.tvPermission.SelectedNode.Expand();
         this.tvPermission.SelectedNode.EnsureVisible();
         // 防止只有一个父节点的情况下,无法展开情况发生
         // this.GetPermissionList();
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 绑定屏幕数据
        /// </summary>
        /// <param name="reloadTree">重新加载树</param>
        private void BindData(bool reloadTree)
        {
            // 加载树的主键
            if (reloadTree)
            {
                this.LoadTree();
                if (this.tvList.SelectedNode == null && this.tvList.Nodes.Count > 0)
                {
                    if (this.parentEntityId.Length == 0)
                    {
                        this.tvList.SelectedNode = this.tvList.Nodes[0];
                    }
                    else
                    {
                        BasePageLogic.FindTreeNode(this.tvList, this.parentEntityId);
                        if (BasePageLogic.TargetNode != null)
                        {
                            this.tvList.SelectedNode = BasePageLogic.TargetNode;
                            // 展开当前选中节点的所有父节点
                            BasePageLogic.ExpandTreeNode(this.tvList);
                        }
                    }
                    if (this.tvList.SelectedNode != null)
                    {
                        // 让选中的节点可视,并用展开方式
                        this.tvList.SelectedNode.Expand();
                        this.tvList.SelectedNode.EnsureVisible();
                    }
                }
            }
            if (this.ParentEntityId.Length > 0 && reloadTree)
            {
                this.GetQueryEngineList();
            }

            this.SetControlState();
        }