<%
Class NewsClass
	Private Conn         
	Private IForm  
	Public Property Let TForm(ByRef ExteriorForm)
		if IsObject(ExteriorForm) then
			Set IForm = ExteriorForm
			GetFormValue()
		else
			Class_Terminate()
		end if
	End Property

	Private Sub Class_initialize() 
		Dim DBC
		Dim SCC
		Set DBC = New DataBaseClass
		Set Conn = DBC.OpenConnection()
		Set DBC = Nothing
	End Sub 

	Private Sub Class_Terminate()
		Set Conn=Nothing
	End Sub 

	Public Function MoveNews(SourceNewsArray,ObjectClassID)
		Dim i 
		for i=LBound(SourceNewsArray) to UBound(SourceNewsArray)
			if SourceNewsArray(i) <> "" then
				Conn.Execute("Update PicList set PicClassID='" & ObjectClassID & "' Where PicID='" & SourceNewsArray(i) & "'")
			end if
		next
	End Function

	Public Function CopyNews(SourceNewsArray,ObjectClassID)
		Dim i,j,RsNewsObj,CopyNewsObj,SqlNews,FiledObj
		for i = LBound(SourceNewsArray) to UBound(SourceNewsArray)
			Set RsNewsObj = Conn.Execute("Select * from PicList where PicID='" & SourceNewsArray(i) & "'")
			SqlNews = "Select * from PicList where 1=0"
			Set CopyNewsObj = Server.CreateObject("ADODB.RecordSet")
			CopyNewsObj.Open SqlNews,Conn,3,3
			CopyNewsObj.AddNew
			For Each FiledObj In CopyNewsObj.Fields
				if LCase(FiledObj.name) <> "id" then
					if LCase(FiledObj.name) = "Picid" then
						CopyNewsObj("Picid") = GetRandomID18()
					elseif LCase(FiledObj.name) = "Picclassid" then
						CopyNewsObj("Picclassid") = ObjectClassID
					elseif LCase(FiledObj.name) = "FileName" then
						CopyNewsObj("FileName") = GetRandomID18()
					else
						CopyNewsObj(FiledObj.name) = RsNewsObj(FiledObj.name)
					end if
				end if
			Next
			CopyNewsObj.UpDate
			CopyNewsObj.Close
		next
		Set RsNewsObj = Nothing
		Set CopyNewsObj = Nothing
	End Function

	Function ChildClassIDList(PicClassID)
		Dim TempRs,TempStr
		Set TempRs = Conn.Execute("Select * from PicClass where ParentID = " & PicClassID & "  order by orders desc")
		do while Not TempRs.Eof
			ChildClassIDList = ChildClassIDList & "," & TempRs("PicClassID")
			ChildClassIDList = ChildClassIDList & ChildClassIDList(TempRs("PicClassID"))
			TempRs.MoveNext
		loop
		TempRs.Close
		Set TempRs = Nothing
	End Function

	Private Function GetVisionStr()
		GetVisionStr = "<!--Published Date:"&Now&"   Powered by www.Foosun.net,Products:Foosun Content Manage system-->" & Chr(13) & Chr(10)
	End Function
End Class
%>
