<%
Function Company_Name(ComId)
	Dim Rs
	If ComId = "" Or IsNull(ComId) Or Not IsNumeric(ComId) Then ComId = 0
	
	Set Rs = Conn.Execute("select CompanyName from CompanyTbl where ComId = "& ComId)
	If Rs.Eof Then
		Company_Name = ""
	Else
		Company_Name = Rs("CompanyName")
	End If
	Set Rs = Nothing
End Function

Function Recruit_Name(RecruitId)
	Dim Rs
	If RecruitId = "" Or IsNull(RecruitId) Or Not IsNumeric(RecruitId) Then RecruitId = 0
	
	Set Rs = Conn.Execute("select JobName from RecruitTbl where RecruitId = "& RecruitId)
	If Rs.Eof Then
		Recruit_Name = ""
	Else
		Recruit_Name = Rs("JobName")
	End If
	Set Rs = Nothing
End Function

Function Person_Name(PerId)
	Dim Rs
	If PerId = "" Or IsNull(PerId) Or Not IsNumeric(PerId) Then PerId = 0
	
	Set Rs = Conn.Execute("select RealName from PersonTbl where PerId = "& PerId)
	If Rs.Eof Then
		Person_Name = ""
	Else
		Person_Name = Rs("RealName")
	End If
	Set Rs = Nothing
End Function

Function Member_Name(MemberId)
	Dim Rs
	If MemberId = "" Or IsNull(MemberId) Or Not IsNumeric(MemberId) Then MemberId = 0
	Set Rs = Conn.Execute("select MemberName from MemberConfigTbl where MemberId = "& MemberId)
	If Rs.Eof Then
		Member_Name = ""
	Else
		Member_Name = Rs("MemberName")
	End If
	Set Rs = Nothing
End Function

Function NewsType_Name(NewsTypeId)
	Dim Rs
	If NewsTypeId = "" Or IsNull(NewsTypeId) Or Not IsNumeric(NewsTypeId) Then NewsTypeId = 0
	
	Set Rs = Conn.Execute("select NewsTypeName from NewsTypeTbl where NewsTypeId = "& NewsTypeId)
	If Rs.Eof Then
		NewsType_Name = ""
	Else
		NewsType_Name = Rs("NewsTypeName")
	End If
	Set Rs = Nothing
End Function

Function FriendLinkType_Name(FriendLinkTypeId)
	Dim Rs
	If FriendLinkTypeId = "" Or IsNull(FriendLinkTypeId) Or Not IsNumeric(FriendLinkTypeId) Then FriendLinkTypeId = 0
	
	Set Rs = Conn.Execute("select FriendLinkTypeName from FriendLinkTypeTbl where FriendLinkTypeId = "& FriendLinkTypeId)
	If Rs.Eof Then
		FriendLinkType_Name = ""
	Else
		FriendLinkType_Name = Rs("FriendLinkTypeName")
	End If
	Set Rs = Nothing
End Function

Function IsLockId(UserType)
	Dim Rs
	Set Rs = server.createobject("ADODB.Recordset")
	
	IsLockId = "0"
	
	If UserType = "Company" Then
		Rs.Open "select ComId from CompanyTbl where IsLock = '1' order by ComId asc" , Conn , 1 , 1
		Do While Not Rs.Eof
			IsLockId = IsLockId & "," & Rs("ComId")
		Rs.MoveNext
		Loop
		Rs.Close
	ElseIf UserType = "Person" Then
		Rs.Open "select PerId from PersonTbl where IsLock = '1' order by PerId asc" , Conn , 1 , 1
		Do While Not Rs.Eof
			IsLockId = IsLockId & "," & Rs("PerId")
		Rs.MoveNext
		Loop
		Rs.Close
	Else
		IsLockId = "0"
	End If
End Function

Function selComId(strKeyword)
	Dim Rs
	Set Rs = server.createobject("ADODB.Recordset")
	
	selComId = "0"
	
	If strKeyword <> "" And strKeyword <> "请输入要查询的关键字" Then
		Rs.Open "select ComId from CompanyTbl where CompanyName like '%"& strKeyword &"%' order by ComId asc" , Conn , 1 , 1
		Do While Not Rs.Eof
			selComId = selComId & "," & Rs("ComId")
		Rs.MoveNext
		Loop
		Rs.Close
	Else
		selComId = "0"
	End If
End Function

Function AdWz_Name(AdWz)
	Dim Rs,i
	AdWz_Name = ""
	If Len(AdWz) < 3 Then Exit Function
	
	AdWz = Left(AdWz , Len(AdWz) - 1)
	AdWz = Right(AdWz , Len(AdWz) - 1)
	
	If InStr(AdWz , "|") > 0 Then
		AdWz = Split(AdWz , "|")
		For i = 0 To Ubound(AdWz)
			Set Rs = Conn.Execute("select AdName from AdTypeTbl where AdTypeId = "& AdWz(i))
			If Not Rs.Eof Then
				If AdWz_Name = "" Then
					AdWz_Name = Rs("AdName")
				Else
					AdWz_Name = AdWz_Name & "," & Rs("AdName")
				End If
			End If
			Set Rs = Nothing
		Next
	Else
		Set Rs = Conn.Execute("select AdName from AdTypeTbl where AdTypeId = "& AdWz)
		If Not Rs.Eof Then
			AdWz_Name = Rs("AdName")
		End If
		Set Rs = Nothing
	End If
End Function
%>