<%
Function GetRoleSysChk(ByVal RoleId, ByVal ChannelName, ByVal ValType)
    GetRoleSysChk = Easp.IIf(GetRoleSysName(RoleId, ChannelName, ValType), " checked=""checked""", "")
End Function

Function GetRoleChannelChk(ByVal RoleId, ByVal ChannelId, ByVal ValType)
    GetRoleChannelChk = Easp.IIf(GetRoleChannel(RoleId, ChannelId, ValType), " checked=""checked""", "")
End Function

Function GetRoleTypeName(ByVal id)
    Dim strTemp
    Select Case CmsFun.ChkNumEric(id)
        Case 1
            strTemp = "超级用户"
        Case 2
            strTemp = "系统用户"
        Case Else
            strTemp = "角色类型错误"
    End Select
    GetRoleTypeName = strTemp
End Function

Function GetRoleType(ByVal RoleType, ByVal Val)
    Dim strTemp, ArrayList, ii
    ArrayList = Array("请选择角色类型", "超级用户(拥有所有权限,权限区域可以不用设置)", "系统用户")
    strTemp = "<select name=""RoleType"" id=""RoleType"" class=""select2"">" & vbCrLf
    strTemp = strTemp & "<option value=""0"""& Easp.IIf(Trim(Val) = Trim(0), " selected=""selected""", "") &">请选择角色类型</option>" & vbCrLf
    If RoleType < 2 Then
        strTemp = strTemp & "<option value=""1"""& Easp.IIf(Trim(Val) = Trim(1), " selected=""selected""", "") &">超级用户(拥有所有权限,权限区域可以不用设置)</option>" & vbCrLf
    End If
    strTemp = strTemp & "<option value=""2"""& Easp.IIf(Trim(Val) = Trim(2), " selected=""selected""", "") &">系统用户</option>" & vbCrLf
    strTemp = strTemp & "</select>"
    GetRoleType = strTemp
End Function

Function GetRoleList(ByVal Val, ByVal RoleType)
    Dim strTemp, oRs, ArrayList, ii
    strTemp = "<select name=""RoleId"" id=""RoleId"" class=""select2"">" & vbCrLf
    strTemp = strTemp & "<option value=""0"">请选择角色</option>" & vbCrLf
    Set oRs = Easp.db.GR(TablePrefix & "Admin_Role:Id,RoleName,RoleType", "", " Id Asc")
    If Not Easp.IsN(oRs) Then
        ArrayList = oRs.GetRows()
    End If
    Easp.C oRs
    If IsArray(ArrayList) Then
        For ii = 0 To UBound(ArrayList, 2)
            If CmsFun.ChkNumEric(ArrayList(2, ii)) >= CmsFun.ChkNumEric(RoleType) Then
                strTemp = strTemp & "<option value="""& ArrayList(0, ii) &""""& Easp.IIf(Trim(Val) = Trim(ArrayList(0, ii)), " selected=""selected""", "") &">"& ArrayList(1, ii) &"</option>" & vbCrLf
            End If
        Next
    End If
    strTemp = strTemp & "</select>"
    GetRoleList = strTemp
End Function
%>