<!--#include virtual="inc/General.inc.asp"-->
<%
MenuCode = replace(Request("MenuCode"),"'","''")
AddressCode = replace(Request("AddressCode"),"'","''")
AddressName = replace(Request("AddressName"),"'","''")
NewsID = clng("0"&Request("NewsID"))
if NewsID&""="" then NewsID="0"
msg = ""
if AddressCode="" or AddressName="" then ErrorInfo "编号或名称不能为空！"
set rs = server.createobject("adodb.recordset")
rs.open "select * from [index] where AddressCode='" & AddressCode & "'",conn,1,1
if rs.eof then
	conn.execute "insert into [index](AddressCode,AddressName,MenuCode,NewsID) Values('" & AddressCode & "','" & AddressName & "','" & MenuCode & "'," & NewsID & ")"
	msg = "添加成功！"
else
	conn.execute "update [index] set MenuCode='" & MenuCode & "',AddressName='" & AddressName & "',NewsID=" & NewsID & " where AddressCode='" & AddressCode & "'"
	msg = "修改成功！"
end if
rs.close
set rs = nothing
CloseConnection()
ErrorInfos msg,"Index.asp"
%>