Dim dwqx As String
If _UserRoles.Contains("系统主管") = False Then
Dim strs As String() = _UserRoles.split(",")
Dim rs As String
For Each ss As String In strs
rs = rs & ",'" & ss & "'"
Next
Dim drs As List(Of DataRow)
drs = DataTables("用户角色档案").Select("角色 in (" & rs.trim(",") & ")")
If drs.Count > 0 Then
For Each dr As DataRow In drs
dwqx = dr("核算单位权限") ‘核算单位权限列为多值字段
Next
End If
End If
Dim cmb As WinForm.CheckedComboBox = e.form.Controls("HSDW")
cmb.ComboList = DataTables("列表项目").GetComboListString("核算组织", "核算组织 In ( '" & dwqx.replace(",", "','") & "')")
提示以下错误,不知哪里有误
此主题相关图片如下:微信图片_20241021091124.png
Dim dwqx As String
If User.Type = UserTypeEnum.User Then
Dim strs As String() = _UserRoles.split(",")
For Each ss As String In strs
Dim dr As DataRow
dr = DataTables("用户角色档案").Find("角色 = '" & ss & "'")
If dr IsNot Nothing Then '如果找到的话
dwqx = dr("核算单位权限")
End If
Next
End If
核算单位权限是多值字段,假设这个用户有两个角色,角色1的核算单位权限是AA,BB,角色2的核算单位权限是BB,CC,如何将找到的这两个角色的核算单位权限合并且去重,结果要是AA,BB,CC
使用集合判断去重,类似:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=175348&page=1&star=13