📄 ad_softmove.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=3
Const PurviewLevel_Soft=2
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/ad_code_soft.asp"-->
<%
dim SoftID,ClassID,TargetClassID,SpecialID
dim Action,FoundErr,ErrMsg
dim strComeUrl
dim SkinID,LayoutID,SkinCount,LayoutCount,ClassMaster,BrowsePurview,AddPurview
if trim(request("strComeUrl"))="" then
strComeUrl=Request.ServerVariables("HTTP_REFERER")
else
strComeUrl=trim(request("strComeUrl"))
end if
SoftID=trim(request("SoftID"))
TargetClassID=trim(request("TargetClassID"))
SpecialID=trim(request("SpecialID"))
Action=Trim(Request("Action"))
if Action="MoveToClass" then
call MoveToClass()
elseif Action="MoveToSpecial" then
call MoveToSpecial()
elseif Action="Move" then
call MoveSoft()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
if SoftID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择要移动的软件!</li>"
exit sub
else
SoftID=CLng(SoftID)
end if
dim sqlSoft,rsSoft
dim SoftName,SoftVersion,ClassName,ParentPath,Depth
sqlSoft="select Soft.ClassID,Soft.SoftName,SoftClass.ClassName,SoftClass.ParentPath,SoftClass.Depth,Soft.SoftVersion from Soft"
sqlSoft=sqlSoft & " inner join SoftClass on Soft.ClassID=SoftClass.ClassID where Soft.SoftID=" & SoftID
set rsSoft=Server.CreateObject("ADODB.Recordset")
rsSoft.open sqlSoft,conn,1,1
if rsSoft.bof and rsSoft.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到要移到的软件</li>"
else
ClassID=rsSoft(0)
SoftName=rsSoft(1)
ClassName=rsSoft(2)
ParentPath=rsSoft(3)
Depth=rsSoft(4)
SoftVersion=rsSoft(5)
%>
<html>
<head>
<title>软件移动</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="ad_Style.css">
</head>
<body>
<form name="form1" method="post" action="ad_SoftMove.asp">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr class="title">
<td height="22" align="center"><strong>软 件 移 动</strong></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr class="tdbg">
<td width="200"><strong>所属栏目:</strong></td>
<td><%call Admin_ShowPath2(ParentPath,ClassName,Depth)%></td>
</tr>
<tr class="tdbg">
<td width="200"><strong>软件名称:</strong></td>
<td><%=SoftName%> <input name="SoftID" type="hidden" id="SoftID" value="<%=SoftID%>"></td>
</tr>
<tr class="tdbg">
<td width="200"><strong>软件版本:</strong></td>
<td><%=SoftVersion%></td>
</tr>
<tr class="tdbg">
<td width="200"><strong>移动到:</strong><br>
不能指定为含有子栏目的栏目<br>
不能指定为外部栏目 </td>
<td><select name="TargetClassID" size="2" style="height:300px;width:400px;">
<%call Admin_ShowClass_Option(3,ClassID)%>
</select> </td>
</tr>
</table></td>
</tr>
<tr class="tdbg">
<td align="center"><input name="strComeUrl" type="hidden" id="strComeUrl" value="<%=strComeUrl%>">
<input name="Action" type="hidden" id="Action" value="Move">
<input type="submit" name="Submit" value=" 确 定 ">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='ad_SoftManage.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
</body>
</html>
<%
end if
rsSoft.close
set rsSoft=nothing
end sub
sub MoveSoft()
dim tClass
if SoftID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择要移动的软件!</li>"
end if
if TargetClassID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定目标栏目!</li>"
else
TargetClassID=CLng(TargetClassID)
set tClass=conn.execute("select Child from SoftClass where ClassID=" & TargetClassID)
if tClass.bof and tClass.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的目标栏目!</li>"
else
if tClass(0)>0 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>不能将软件移到有子栏目的栏目中!</li>"
end if
end if
end if
if FoundErr=True then exit sub
if SpecialID="" then
SpecialID=0
else
SpecialID=Clng(SpecialID)
end if
SoftID=replace(SoftID," ","")
'conn.execute("update Soft set ClassID=" & TargetClassID & ",SpecialID=" & SpecialID & " where SoftId in (" & SoftID & ")")
conn.execute("update Soft set ClassID=" & TargetClassID & " where SoftId in (" & SoftID & ")")
conn.execute("update SoftComment set ClassID=" & TargetClassID & " where SoftId in (" & SoftID & ")")
call CloseConn()
response.Redirect strComeUrl
end sub
sub MoveToClass()
dim tClass
if SoftID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请选择要移动的软件!</li>"
end if
if TargetClassID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定目标栏目!</li>"
else
TargetClassID=CLng(TargetClassID)
set tClass=conn.execute("select Child from SoftClass where ClassID=" & TargetClassID)
if tClass.bof and tClass.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的目标栏目!</li>"
else
if tClass(0)>0 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>不能将软件移到有子栏目的栏目中!</li>"
end if
end if
end if
if FoundErr=True then exit sub
SoftID=replace(SoftID," ","")
conn.execute("update Soft set ClassID=" & TargetClassID & " where SoftId in (" & SoftID & ")")
conn.execute("update SoftComment set ClassID=" & TargetClassID & " where SoftId in (" & SoftID & ")")
call CloseConn()
response.Redirect strComeUrl
end sub
sub MoveToSpecial()
if SpecialID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定目标专题!</li>"
exit sub
else
SpecialID=CLng(SpecialID)
end if
SoftID=replace(SoftID," ","")
conn.execute("update Soft set SpecialID=" & SpecialID & " where SoftID in (" & SoftID & ")")
call CloseConn()
response.Redirect strComeUrl
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -