/// <summary>
    /// 按权限范围获取部门列表
    /// </summary>
    /// <param name="userDepartment">若没数据库至少显示用户自己的部门</param>
    /// <param name="permissionItemCode">操作权限项</param>
    protected System.Data.DataTable GetDepartmentByPermissionScope(bool userDepartment = false, string permissionItemCode = "Resource.ManagePermission")
    {
        DataTable dtDepartment = null;

        var manager = new PiOrganizeManager(this.RDIFrameworkDbProvider, this.UserInfo);

        dtDepartment = this.UserInfo.IsAdministrator ? manager.GetDT(PiOrganizeTable.FieldDeleteMark, 0) : RDIFrameworkService.Instance.PermissionService.GetOrganizeDTByPermissionScope(userInfo, userInfo.Id, permissionItemCode);
        // 至少要列出自己的部门的
        if (!userDepartment)
        {
            return(dtDepartment);
        }
        if (!string.IsNullOrEmpty(this.UserInfo.DepartmentId.ToString()) && !BusinessLogic.Exists(dtDepartment, PiOrganizeTable.FieldId, this.UserInfo.DepartmentId.ToString()))
        {
            dtDepartment.Merge(manager.GetDTById(this.UserInfo.DepartmentId.ToString()));
        }
        return(dtDepartment);
    }
    // 获得部门列表(按权限范围)

    #region protected void GetDepartment()
    /// <summary>
    /// 获取部门列表
    /// </summary>
    protected System.Data.DataTable GetDepartment()
    {
        var manager = new PiOrganizeManager(this.RDIFrameworkDbProvider, this.UserInfo);

        return(manager.GetDepartmentDT());
    }