
<!--#include file="../inc/Conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!-- #include file="Inc/Head.asp" -->
<%

dim Action,BigClassName,rs
Action=trim(Request("Action"))
BigClassName=trim(request("BigClassName"))
if Action="Add" then
	if BigClassName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>文章大类名不能为空！</li>"
	end if
	if FoundErr<>True then
		Set rs=Server.CreateObject("Adodb.RecordSet")
		rs.open "Select * From BigClass_New Where BigClassName='" & BigClassName & "'",conn,1,3
		if not (rs.bof and rs.EOF) then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>文章大类“" & BigClassName & "”已经存在！</li>"
		else
    	 	rs.addnew
     		rs("BigClassName")=BigClassName
    	 	rs.update
     		rs.Close
	     	set rs=Nothing
    	 	call CloseConn()
			Response.Redirect "News_ClassManage.asp"  
		end if
	end if
end if
if FoundErr=True then
	call WriteErrMsg()
else
%>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}
</script>
<table width="80%" border="0" cellpadding="0" cellspacing="0" class="border">
  <tr>
    <td height="12" align="center" valign="top" class="topbg"><strong>新 闻 类 别 设 置</strong></td>
  </tr>
  <tr>
    <td height="13" align="center" valign="top"> 
          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="2"><form name="form1" method="post" action="News_ClassAddBig.asp" onSubmit="return checkBig()">
            <tr>
              <td height="25" colspan="2" align="center" class="Title"><strong>添加大类</strong></td>
            </tr>
            <tr class="tdbg">
              <td width="155" height="22" bgcolor="#C0C0C0" class="tdbgl"><div align="right"><strong>大类名称：</strong></div></td>
              <td class=tdbg><input name="BigClassName" type="text" size="20" maxlength="30"></td>
            </tr>
            <tr bgcolor="#C0C0C0" class="tdbg">
              <td width="155" height="22" align="center" bgcolor="#C0C0C0" class="tdbgl">　</td>
              <td height="22" align="center" class=tdbg><div align="left">
                  <input name="Action" type="hidden" id="Action" value="Add">
                  <input name="Add" type="submit" value=" 添 加 ">
              </div></td>
            </tr></form>
        </table>
        </td>
  </tr>
</table>
<%
end if
%><!-- #include file="Inc/Foot.asp" -->