コード例 #1
0
        /// <summary>
        ///  加载组织结构
        /// </summary>
        ///
        //private void LoadOrg()
        //{
        //    try
        //    {
        //        PrivilegeService _proxy = Common.Util.CreateProxy();
        //        using (_proxy as IDisposable)
        //        {
        //            organizations = _proxy.QueryUnit("HIS");
        //        }
        //    }
        //    catch (Exception e)
        //    {
        //        MessageBox.Show(e.Message, "提示");
        //        return;
        //    }
        //}

        private void LoadRole()
        {
            try
            {
                PrivilegeService _proxy = Common.Util.CreateProxy();
                using (_proxy as IDisposable)
                {
                    //roles = _proxy.QueryChildRole(((Role)((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).CurrentGroup).ID);
                    roles = _proxy.QueryChildRole(currentRole.ID);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "提示");
                return;
            }

            //TreeNode _root = NewNode((Role)((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).CurrentGroup);
            //roles.Add((Role)((Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator).CurrentGroup);
            //roleTreeDictionary.Add(Neusoft.FrameWork.Management.Connection.Operator.ID, _root);
            //tvRole.Nodes.Add(_root);

            TreeNode _root = NewNode(currentRole);

            roles.Add(currentRole);
            roleTreeDictionary.Add(currentRole.ID, _root);
            tvRole.Nodes.Add(_root);
            AddSubRoleNode((_root.Tag as Role), _root);
            _root.Expand();
        }