示例#1
0
        private void InitialAll(ReasonCodeNode node)
        {
            if (node != null)
            {
                if (node.ParentSysNo == 0)
                {
                    node.IsExpanded = true;
                }
                else
                {
                    node.IsExpanded = false;
                }

                if (node.Status == 0)
                {
                    node.NodeFontColor = new SolidColorBrush(Colors.Gray);
                }
                else
                {
                    node.NodeFontColor = new SolidColorBrush(Colors.Blue);
                }



                if (node.SonNodes != null)
                {
                    foreach (ReasonCodeNode son in node.SonNodes)
                    {
                        InitialAll(son);
                    }
                }
            }
        }
示例#2
0
        //添加
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Common_ReasonCode_Add))
            {
                Window.Alert("您没有此功能的操作权限");
                return;
            }
            ReasonCodeNode node = this.tvReasonCode.SelectedNode;

            if (node == null)
            {
                Window.Alert("请选择一个节点");
                return;
            }

            string path = this.tvReasonCode.ReasonCodePath;

            UCReasonCodeEdit reasonCodeCtrl = new UCReasonCodeEdit(node.SysNo, node.ParentSysNo, node.Description, path, false);

            reasonCodeCtrl.Dialog = Window.ShowDialog(
                "添加节点"
                , reasonCodeCtrl
                , (s, args) =>
            {
                if (args.DialogResult == DialogResultType.OK)
                {
                    BindDataFromDB();
                }
            }
                , new Size(550, 300)
                );
        }
示例#3
0
        private void ExpandFather(ReasonCodeNode node)
        {
            if (node != null && node.ParentNode != null)
            {
                if (node.ParentNode.IsExpanded == false)
                {
                    node.ParentNode.IsExpanded = true;
                }

                ExpandFather(node.ParentNode);
            }
        }