www.pudn.com > Zhwebcode.rar > ClassAddBig.asp, change:2008-10-30,size:3562b


<%@language=vbscript codepage=936 %> 
<!--#include file="Conn.asp"--> 
<!--#include file="Admin.asp"--> 
<!--#include file="Inc/Function.asp"--> 
<% 
dim Action,BigClassName,rs,FoundErr,ErrMsg 
Action=trim(Request("Action")) 
BigClassName=trim(request("BigClassName")) 
DefaultPicUrl=trim(request("DefaultPicUrl")) 
Content=trim(request("Content")) 
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 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("DefaultPicUrl")=DefaultPicUrl			 
     		rs("Content")=Content			 
    	 	rs.update 
     		rs.Close 
	     	set rs=Nothing 
    	 	call CloseConn() 
			Response.Redirect "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> 
<!-- #include file="Inc/Head.asp" --> 
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> 
  <tr>  
    <td align="center" valign="top"> <br> <br> 
      <strong>品 种 类 别 设 置</strong> <br> <br> <br> 
      <form name="form1" method="post" action="ClassAddBig.asp" onSubmit="return checkBig()"> 
        <table width="700" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666" class="border"> 
          <tr bgcolor="#EFEFEF" class="title">  
            <td height="30" colspan="3" align="center"><strong>添加品种</strong></td> 
          </tr> 
          <tr bgcolor="#E3E3E3">  
            <td width="30%" height="26" bgcolor="#EFEFEF">  <strong> 大类名称:</strong></td> 
            <td colspan="2" bgcolor="#FCFCFC"> <input name="BigClassName" type="text" size="30" maxlength="100">  
            </td> 
          </tr> 
                <tr>  
                  <td height="26" bgcolor="#EFEFEF">  <strong> 品种图片:</strong></td> 
                  <td width="35%" bgcolor="#FCFCFC"> <input name="DefaultPicUrl" type="text" id="DefaultPicUrl" size="30" maxlength="100"></td> 
                  <td width="35%" bgcolor="#FCFCFC"><iframe style="top:2px" ID="UploadFiles" src="upload_Photo.asp?PhotoUrlID=6" frameborder=0 scrolling=no width="300" height="26"></iframe>                  </td> 
                </tr> 
                <tr> 
                  <td bgcolor="#EFEFEF">  <strong> 简介:</strong></div></td> 
                  <td bgcolor="#FCFCFC" colspan="2"><input type="hidden" name="content" value=""> 
                  <iframe id="eWebEditor1" src="SouthidcEditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="550" height="300"></iframe></td> 
                </tr> 
          <tr> 
            <td height="26" colspan="3" align="center" bgcolor="#FCFCFC"> 
                <input name="Action" type="hidden" id="Action" value="Add"> 
                <input name="Add" type="submit" value=" 添 加 "> 
             </td> 
          </tr> 
        </table> 
      </form></td> 
  </tr> 
</table> 
<!-- #include file="Inc/Foot.asp" --> 
<% 
end if 
call CloseConn() 
%>