<!-- #include file="const.asp" -->
<!-- #include file="../public/public.asp" -->
<!-- #include file="admin_judge.asp" -->
<%
dim rs,sql
on error resume next			
conn.BeginTrans
if Request.Form("newstitle")="" then
  response.write "<script type='text/javascript'> alert('请完整填写您的新闻');history.go(-1);</script>"
Response.end
end if
if Request.Form("news_describe")="" then
  response.write "<script type='text/javascript'> alert('请完整填写您的新闻');history.go(-1);</script>"
	Response.end
end if
if Request.Form("online")="1" then
  online="true"
else
  online="false"
end if  
sql = "insert into T_news(newstitle,category,content,begindate,author,"
sql = sql & "origin,flag)values("
sql = sql & "'"&Request.Form("newstitle")&"',"
sql = sql & "'"&Request.Form("category")&"',"
sql = sql & "'"&Request.Form("news_describe")&"',"
sql = sql & "'"&Request.Form("begindate")&"',"
sql = sql & "'"&Request.Form("author")&"',"
sql = sql & "'"&Request.Form("origin")&"',"
sql = sql & ""&online&")"
conn.execute sql
response.write err.description
if err.number=0 then
conn.CommitTrans 
Response.Write"<script>alert('恭喜您,添加成功！');location.href='news_manage.asp'</SCRIPT>" 
else
conn.RollbackTrans '否则回滚
Response.Write"<script>alert('保存失败，请您仔细填写相关信息！');history.go(-1)</SCRIPT>"
end if
conn.close
set conn = nothing
%>