<%
response.write"<br>"
if request("action") ="add" then
call post()
end if
response.write"<br>"
%>
处理过程
<%
sub post()
if Replace_Text(request.form("title"))="" then
response.write "<li>没有填写展会名称</li>"
founderr=true
end if
if Replace_Text(request.form("title"))>"" then
title=Replace_Text(request.form("title"))
sql="select id from expo where title='"&title&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not (rs.Bof and rs.eof) then
response.write"<li>此展会名称已经存在,请重新设置</li>"
founderr=true
end if
end if
if Replace_Text(request.form("holdCountry"))="" then
response.write "<li>没有填写举办国家</li>"
founderr=true
end if
if Replace_Text(request.form("beginDate"))="" then
response.write "<li>没有填写参展开始日期</li>"
founderr=true
end if
if Replace_Text(request.form("endDate"))="" then
response.write "<li>没有填写参展结束日期</li>"
founderr=true
end if
if Replace_Text(request.form("expireDate"))="" then
response.write "<li>没有填写报名截止日期</li>"
founderr=true
end if
if Replace_Text(request.form("place"))="" then
response.write "<li>参展地(展馆)</li>"
founderr=true
end if
if Replace_Text(request.form("frontFor"))="" then
response.write "<li>没有填写主办单位</li>"
founderr=true
end if
if Replace_Text(request.form("brief"))="" then
response.write "<li>没有填写展会简介</li>"
founderr=true
end if
if Replace_Text(request.form("product"))="" then
response.write "<li>没有填写参展范围</li>"
founderr=true
end if
if Replace_Text(request.form("linkman"))="" then
response.write "<li>没有填写联系人</li>"
founderr=true
end if
if Replace_Text(request.form("country1"))="中国" then
if Replace_Text(request.form("province"))="" or Replace_Text(request.form("city"))="" then
response.write "<li>国家如果选择了中国,必须选择地级市和市、县</li>"
founderr=true
end if
end if
if Replace_Text(request.form("address"))="" then
response.write "<li>没有填写联系地址</li>"
founderr=true
end if
if Replace_Text(request.form("phone"))="" then
response.write "<li>没有填写固定电话</li>"
founderr=true
end if
if founderr=false then
'开始存储数据
title=Replace_Text(request.form("title"))
sql="select * from expo where title='"&title&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not (rs.Bof and rs.eof) then
response.write"<li>此展会名称已经存在,请重新设置</li>"
else
rs.addnew
rs("brief")=Replace_Text(request.form("brief"))
rs("city")=Replace_Text(request.form("city"))
rs("aidance")=Replace_Text(request.form("aidance"))
rs("province")=Replace_Text(request.form("province"))
rs("title")=Replace_Text(request.form("title"))
rs("company")=Replace_Text(request.form("company"))
rs("address")=Replace_Text(request.form("address"))
rs("beginDate")=Replace_Text(request.form("beginDate"))
rs("endDate")=Replace_Text(request.form("endDate"))
rs("activity")=Replace_Text(request.form("activity"))
rs("fax")=Replace_Text(request.form("fax"))
rs("mobile")=Replace_Text(request.form("mobile"))
rs("holdCountry")=Replace_Text(request.form("holdCountry"))
rs("undertake")=Replace_Text(request.form("undertake"))
rs("zip")=Replace_Text(request.form("zip"))
rs("expireDate")=Replace_Text(request.form("expireDate"))
rs("place")=Replace_Text(request.form("place"))
rs("linkman")=Replace_Text(request.form("linkman"))
rs("phone")=Replace_Text(request.form("phone"))
rs("homepage")=Replace_Text(request.form("homepage"))
rs("authorize")=Replace_Text(request.form("authorize"))
rs("charge")=Replace_Text(request.form("charge"))
rs("email")=Replace_Text(request.form("email"))
rs("frontFor")=Replace_Text(request.form("frontFor"))
rs("product")=Replace_Text(request.form("product"))
rs("country1")=Replace_Text(request.form("country1"))
rs("sh")=Replace_Text(request.form("sh"))
if Replace_Text(request.form("pic_on"))=1 then
rs("picture")=Replace_Text(request.form("picture"))
end if
rs("dateandtime")=now()
rs.update
response.redirect ("expo.jsp?pass=1")
end if
end if
end sub
%>