<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005－2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************

'**************************************************
'函数名：GetClientName
'作  用：获得客户名称
'参  数：ClientID ---- 客户ID
'返回值：得到客户名称
'**************************************************
Function GetClientName(ClientID)
    If ClientID <= 0 Then
        GetClientName = ""
        Exit Function
    End If
    Dim rsClient
    Set rsClient = Conn.Execute("select ClientName from PE_Client where ClientID=" & ClientID & "")
    If rsClient.BOF And rsClient.EOF Then
        GetClientName = ""
    Else
        GetClientName = rsClient(0)
    End If
    rsClient.Close
    Set rsClient = Nothing
End Function

'**************************************************
'函数名：GetContacterName
'作  用：获取用户真实姓名
'参  数：ContacterID ---- 用户详细信息ID
'返回值：得到真实姓名
'**************************************************
Function GetContacterName(ContacterID)
    If ContacterID <= 0 Then
        GetContacterName = ""
        Exit Function
    End If
    Dim rsContacter
    Set rsContacter = Conn.Execute("select TrueName from PE_Contacter where ContacterID=" & ContacterID & "")
    If rsContacter.BOF And rsContacter.EOF Then
        GetContacterName = ""
    Else
        GetContacterName = rsContacter(0)
    End If
    rsContacter.Close
    Set rsContacter = Nothing
End Function


'**************************************************
'函数名：GetContacterOption
'作  用：获取用户下拉列表
'参  数：iClientID ---- 客户ID
'        iContacterID ---- 用户详细信息ID
'返回值：用户下拉列表
'**************************************************
Function GetContacterOption(iClientID, iContacterID)
    If iClientID <= 0 Then
        GetContacterOption = ""
        Exit Function
    End If

    Dim rsContacter, strContacter
    Set rsContacter = Conn.Execute("select ContacterID,TrueName from PE_Contacter where ClientID=" & iClientID & "")
    Do While Not rsContacter.EOF
        If rsContacter(0) = iContacterID Then
            strContacter = strContacter & "<option value='" & rsContacter(0) & "' selected>" & rsContacter(1) & "</option>"
        Else
            strContacter = strContacter & "<option value='" & rsContacter(0) & "'>" & rsContacter(1) & "</option>"
        End If
        rsContacter.MoveNext
    Loop
    rsContacter.Close
    Set rsContacter = Nothing
    GetContacterOption = strContacter
End Function
%>
