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


<%@language=vbscript codepage=936 %> 
<!--#include file="Conn.asp"--> 
<!--#include file="Admin.asp"--> 
<!--#include file="Inc/Function.asp"--> 
<% 
dim BigClassID,Action,rs,NewBigClassName,OldBigClassName,DefaultPicUrl,Content,FoundErr,ErrMsg 
BigClassID=trim(Request("BigClassID")) 
Action=trim(Request("Action")) 
NewBigClassName=trim(Request("NewBigClassName")) 
OldBigClassName=trim(Request("OldBigClassName")) 
DefaultPicUrl=trim(Request("DefaultPicUrl")) 
Content=trim(Request("Content")) 
 
if BigClassID="" then 
  response.Redirect("ClassManage.asp") 
end if 
Set rs=Server.CreateObject("Adodb.RecordSet") 
rs.Open "Select * from BigClass where BigClassID=" & CLng(BigClassID),conn,1,3 
if rs.Bof and rs.EOF then 
	FoundErr=True 
	ErrMsg=ErrMsg & "<br><li>此品种不存在!</li>" 
else 
	if Action="Modify" then 
		if NewBigClassName="" then 
			FoundErr=True 
			ErrMsg=ErrMsg & "<br><li>品种名不能为空!</li>" 
		end if 
		if FoundErr<>True then 
			rs("BigClassName")=NewBigClassName	 
			rs("DefaultPicUrl")=DefaultPicUrl		 
			rs("Content")=Content	 
    	 	rs.update 
			rs.Close 
	     	set rs=Nothing 
			if NewBigClassName<>OldBigClassName then 
				conn.execute "Update SmallClass set BigClassName='" & NewBigClassName & "' where BigClassName='" & OldBigClassName & "'" 
				conn.execute "Update Product set BigClassName='" & NewBigClassName & "' where BigClassName='" & OldBigClassName & "'" 
     		end if		 
			call CloseConn() 
     		Response.Redirect "ClassManage.asp"  
		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="myform" method="post" action="ClassModifyBig.asp"> 
        <table width="700" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666" class="border"> 
          <tr class="title">  
            <td height="30" colspan="3" align="center" bgcolor="#EFEFEF"><strong>修改品种名称</strong></td> 
          </tr> 
          <tr>  
            <td width="30%" height="26" bgcolor="#EFEFEF">  <strong>品种ID:</strong></td> 
            <td colspan="2" bgcolor="#FCFCFC"><%=rs("BigClassID")%> <input name="BigClassID" type="hidden" id="BigClassID" value="<%=rs("BigClassID")%>">  
              <input name="OldBigClassName" type="hidden" id="OldBigClassName" value='<%=rs("BigClassName")%>'> 
            </td> 
          </tr> 
          <tr>  
            <td height="26" bgcolor="#EFEFEF">  <strong>品种名称:</strong></td> 
            <td bgcolor="#FCFCFC" colspan="2">  
              <input name="NewBigClassName" type="text" id="NewBigClassName" value='<%=rs("BigClassName")%>' 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" value="<%=rs("DefaultPicUrl")%>"></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"><div align="right">  <strong>简介:</strong>:</div></td> 
                  <td bgcolor="#FCFCFC" colspan="2"><input type="hidden" name="content" value="<%=Server.HTMLEncode(rs("Content"))%>"> 
                  <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="Modify"> 
                <input name="Save" type="submit" id="Save" value=" 修 改 "> 
             </td> 
          </tr> 
        </table> 
      </form></td> 
  </tr> 
</table> 
<!-- #include file="Inc/Foot.asp" --> 
<% 
	end if 
end if 
rs.close 
set rs=nothing 
call CloseConn() 
%>