<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'****************************************************************
'**   版权所有：烈火工作室  演示网站http://www.strongfire.cn   **
'**   QQ:839225572   邮箱：strongfire2008@163.com              **
'**   非正版用户不得擅自非法修改用于商业用途！查出必究。       **
'****************************************************************
%>
<!--#include file="islogin.asp"-->
<!--#include file="Check_SqlIn.asp"-->
<!--#include file="admin_conn.asp"-->

<html>
<head>
<LINK href="admin_Css.css" type=text/css rel=stylesheet>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.ClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.ClassName.focus();
    return false;
  }
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加大类</title>
<style type="text/css">
<!--
.STYLE1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>
<%
dim Action,ClassName,rs
Action=trim(Request("Action"))
ClassName=trim(request("ClassName"))
if Action="Add" then
   		if ClassName="" then
			response.Write "<script language=javascript>alert( '大类名称不能为空！'  );location.href = 'javascript:history.back()'</script>"
		response.End
		end if
		Set rs=Server.CreateObject("Adodb.RecordSet")
		rs.open "Select * From Class Where ClassName='" & ClassName & "'",conn,1,3
		if not (rs.bof and rs.EOF) then
			response.Write "<script language=javascript>alert( '大类名称已经存在！'  );location.href = 'javascript:history.back()'</script>"
			response.End
		else
    	 	rs.addnew
     		rs("ClassName")=ClassName
    	 	rs.update
     		rs.Close
	     	set rs=Nothing
    	 	conn.close
			set conn=nothing
			Response.Redirect "ClassManage.asp"  
		end if
		
		
else
%>
<body>
<div align="center"><br>
    <a href="ClassManage.asp"><strong><font size="2" color="#FF0000"><u>类别管理</u></font></strong></a></p>
      <form name="form1" method="post" action="ClassAdd.asp" onSubmit="return checkBig()">
  <table border="0" cellspacing="1" align="center" class="list1">
    <tr>
      <th colspan="2" ><div align="center">添加大类</div></th>
    </tr>
    <tr>
      <td ><div align="right">大类名称：</div></td>
      <td ><input name="ClassName" type="text" size="20" maxlength="30"></td>
    </tr>
    <tr>
      <td >&nbsp;</td>
      <td height="22" align="center" ><div align="left">
          <input name="Action" type="hidden" id="Action" value="Add">
          <input name="Add" type="submit" value=" 添 加 ">
      </div></td>
    </tr>
  </table>
  
  </form>
  <p><br>
    <br>
  </p>
</div>
</body>
<%
end if
%>
</html>
