<!--#include file="../include/hf_conn.asp"-->
<!--#include file="checkadmin.asp"-->
<!--#include file="Inc/Function.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%
call checkmanage("03")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<BODY background="../images/admin/back.gif">

<%
dim BigClassID,Action,rs,NewBigClassName,OldBigClassName,FoundErr,ErrMsg,border
BigClassID=trim(Request("BigClassID"))
NewBigClassName=trim(Request("NewBigClassName"))
OldBigClassName=trim(Request("OldBigClassName"))
NewBigClassName_en=trim(Request("NewBigClassName_en"))
OldBigClassName_en=trim(Request("OldBigClassName_en"))
border=trim(Request("border"))
if BigClassID="" then
  response.Redirect("ClassManage_sbzs.asp")
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from BigClass_sbzs where BigclassName<>'"&Oldbigclassname&"'",conn,1,1
do while not rs.eof
if (rs("BigclassName")=NewBigClassName) or (rs("BigclassName_en")=NewBigClassName_en) then
response.Write "<script>confirm('分类名称重定义，请检查');window.location='ClassManage_sbzs.asp';</script>"
response.End()
end if
rs.movenext
loop
rs.close
rs.Open "Select * from BigClass_sbzs where BigClassID=" & cstr(BigClassID),conn,1,3
if rs.Bof and rs.EOF then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>此产品分类不存在！</li>"
else
		if NewBigClassName="" then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>产品分类名不能为空！</li>"
		end if
		if FoundErr<>True then
			rs("BigClassName")=NewBigClassName
			rs("BigClassName_en")=NewBigClassName_en
			rs("orderid")=border
			rs("Admin")=Admin
    	 	rs.update
			rs.Close
	     	set rs=Nothing
			call CloseConn()
     		Response.Redirect "ClassManage_sbzs.asp" 
		end if
	end if
	if FoundErr=True then
		call WriteErrMsg()
	else
end if
rs.close
set rs=nothing
call CloseConn()
%>