<!-- #include file="Conn.asp" -->
<!--#include file="Comm/Site_Class.asp" -->
<%
Response.Expires = -1 
Response.ExpiresAbsolute = Now() - 1 
Response.cachecontrol = "no-cache"

Set Qsite = New Site_Class

Qsite.SiteConfig()
Qsite.GotoErrPage()

If Session("PerId") = "" Or Session("UserType") <> "Person" Then
	strMsg = "只有个人用户才能进行此操作，请先登录"
Else
	Dim Rs,ComId,strMsg

	ComId = Trim(Request.QueryString("ComId"))

	If ComId = "" Or IsNull(ComId) Or Not IsNumeric(ComId) Then
		strMsg = "请先选择要加入公司库的公司"
	Else
		Set Rs = Conn.Execute("select * from PersonComPoolTbl where ComId = "& ComId &" and PerId = "& Session("PerId"))
		If Not Rs.Eof Then
			strMsg = "公司库中此公司已存在"
		Else
			Conn.Execute("insert into PersonComPoolTbl (PerId , ComId , AddDate) values ("& Session("PerId") &" , "& ComId &" , '"& Qsite.FormatDate(Now()) &"')")
			strMsg = "操作成功，已成功加入公司库"
		End If
		Set Rs = Nothing
	End If
End If
%>
<script language="javascript">
	alert("<%=strMsg%>");
	window.close();
</script>