<!--#include file="../../Include/Const.asp" -->
<!--#include file="../../Include/Conn1.asp" -->
<!--#include file="../CheckAdmin.asp"-->
<%
Result=request.QueryString("Result")
SelectID=request.Form("SelectID")
select Case Result
 	Case "Product"
		if SelectID<>"" then
		
			'删除文件
			On error resume next
			set delRs=server.CreateObject("ADODB.RecordSet")
			delSql="select * from Angel_Case where id in ("&SelectID&")"
			delRs.open delSql,conn,3,3
			if delRs.EOF and delRs.BOF then
						response.Write("查询数据库出错！")
						response.End()
			else
				do while not delRs.eof
'					DelfilePath=delRs("fUrl")
'					call deleteFile(DelfilePath) '调用删除静态页面
					
					DelSmallPicPath=webpath&delRs("SmallPic")
					call deleteFile(DelSmallPicPath) '调用删除小图
				
					DelBigPicPath=webpath&delRs("BigPic")
					call deleteFile(DelBigPicPath) '调用删除静大图
					
				delRs.movenext
				loop
				set delRs=nothing
			end if
			'删除文件 end
			
			conn.execute "delete from Angel_Case where id in ("&SelectID&")"
			response.redirect request.servervariables("http_referer")
		end if
	Case "CaseSort"
		if SelectID<>"" then  conn.execute "delete from Angel_CaseSort where id in ("&SelectID&")"
    	response.redirect request.servervariables("http_referer")
		
	
	
	Case "DelPic"
		'删除文件
		delID=request("delID")
		pic=request.QueryString("pic")
			On error resume next
			set delRs=server.CreateObject("ADODB.RecordSet")
			delSql="select * from Angel_Case where id ="&delID
			delRs.open delSql,conn,3,3
			if delRs.EOF and delRs.BOF then
						response.Write("查询数据库出错！")
						response.End()
			else	
				if pic="smallpic" then
					DelSmallPicPath=webpath&delRs("SmallPic")
					call deleteFile(DelSmallPicPath) '调用删除小图
				elseif pic="bigpic" then
					DelBigPicPath=webpath&delRs("BigPic")
					call deleteFile(DelBigPicPath) '调用删除静大图
				end if
				set delRs=nothing
			end if
			 response.redirect request.servervariables("http_referer")
			'删除文件 end
    Case else
end select
%>