<% Option Explicit %>
<!--#include file="inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="inc/PublicFun.asp" -->
<%
'==============================================================================
'软件名称：风讯新闻采集系统V1.0
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
Dim DBC,UpdateConn,Conn
Set DBC = New DataBaseClass
DBC.ConnStr = "DBQ=" + Server.Mappath("FooSunData/Update.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set UpdateConn = DBC.OpenConnection()
DBC.ConnStr = "DBQ=" + Server.MapPath(DataBaseConnectStr) + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'判断权限
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P1405") then Call ReturnError1()
'判断权限结束
Dim Action,MainID,DelSql
Action = Request("Action")
if Action = "Del" then
	MainID = Request("MainID")
	DelSql = "Delete from FieldSO where TableSOID in (Select TableSO.ID from DBSO,TableSO where DBSO.MainID=TableSO.DBSOID and DBSO.MainID='" & MainID & "')"
	UpdateConn.Execute(DelSql) '删除字段表中FieldSO的数据
	DelSql = "Delete from TableSO where DBSOID='" & MainID & "'"
	UpdateConn.Execute(DelSql) '删除数据库表中TableSO的数据
	DelSql = "Delete from RelateInfo where DBSOID='" & MainID & "'"
	UpdateConn.Execute(DelSql) '删除数据库中RelateInfo的数据
	DelSql = "Delete from FlushTable where DBSOID='" & MainID & "'"
	UpdateConn.Execute(DelSql) '删除数据库中FlushTable的数据
	DelSql = "Delete from DBSO where MainID='" & MainID & "'"
	UpdateConn.Execute(DelSql) '删除数据库中DBSO的数据
end if

Dim RSUpdateObj
Set RSUpdateObj = UpdateConn.Execute("Select * from DBSO")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据转移规则</title>
</head>
<link href="inc/Collect.css" rel="stylesheet">
<body topmargin="0" leftmargin="0">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
  <tr> 
    <td width="10%" height="30" class="ButtonList"> 
      <div align="center">序号</div></td>
    <td nowrap class="ButtonList"> <div align="center">描述</div></td>
    <td width="10%" class="ButtonList">
<div align="center">操作</div></td>
  </tr>
  <%
if Not RSUpdateObj.Eof then
	Dim ShowIndex
	ShowIndex = 0
	do while Not RSUpdateObj.Eof
		ShowIndex = ShowIndex + 1
%>
  <tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#EFEFEF'" onMouseOut="this.style.backgroundColor=''"> 
    <td height="26"> <div align="center" title="<% = RSUpdateObj("SServer") %>"> 
        <% = ShowIndex %>
      </div></td>
    <td><div align="center"> 
        <% = RSUpdateObj("Description") %>
      </div></td>
    <td> <div align="center"><span class="SpanStyle" title="修改属性" onClick="window.location='UpdateAdd.asp?MainID=<% = RSUpdateObj("MainID") %>';">属性</span> 
        | <span class="SpanStyle" title="删除" onClick="if (confirm('确定要删除吗？')==true) window.location='?Action=Del&MainId=<% = RSUpdateObj("MainID") %>';"> 
        删除 </span></div></td>
  </tr>
  <%
		RSUpdateObj.MoveNext
	loop
%>
  <tr bgcolor="#FFFFFF"> 
    <td height="26" colspan="5"><table width="100%" border="0" cellpadding="5" cellspacing="0" background="images/Collect_bg.gif">
        <tr> 
          <td width="17%" height="30"> <div align="left"><a href="UpdateAdd.asp?MainID=<% = GetRandomID18 %>"><strong><font color="#FF0000">添加规则</font></strong></a></div></td>
          <td width="83%" height="30"> <div align="right"> </div></td>
        </tr>
      </table></td>
  </tr>
  <%
else
%>
  <tr> 
    <td height="30" colspan="3" bgcolor="#FFFFFF"> <div align="center">没有数据库转换规则，<a href="UpdateAdd.asp?MainID=<% = GetRandomID18 %>">添加规则</a></div></td>
  </tr>
  <%
end if
%>
</table>
</body>
</html>
<%
Set RSUpdateObj = Nothing
Set UpdateConn = Nothing
%>