<% userPageRights="{info}" %>
<!--#include file="check.asp"-->
<%
dim BigClassID,Action,rs,NewBigClassName,OldBigClassName,FoundErr,ErrMsg
BigClassID=trim(Request("BigClassID"))
Action=trim(Request("Action"))
NewBigClassName=trim(Request("NewBigClassName"))
OldBigClassName=trim(Request("OldBigClassName"))

if BigClassID="" then
  response.Redirect("admin_infoclass.asp")
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from info_BigClass where f_ID=" & CLng(BigClassID),conn,1,3
if rs.Bof and rs.EOF then
	FoundErr=True
	response.write"<SCRIPT language=JavaScript>alert('此大类不存在！');"
    response.write"this.location.href='javascript:history.back();'</SCRIPT>"
    response.end 
else
	if Action="Modify" then
		if NewBigClassName="" then
			FoundErr=True
		response.write"<SCRIPT language=JavaScript>alert('产品大类名不能为空！');"
        response.write"this.location.href='javascript:history.back();'</SCRIPT>"
        response.end 
		end if
		if FoundErr<>True then
			rs("f_value")=NewBigClassName
			'rs("Admin")=Admin
    	 	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 "admin_infoclass.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>
<link href="Images/Style.css" rel="stylesheet" type="text/css">


<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="ClassModifyBig.asp">
        <table width="350" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
          <tr bgcolor="#CCCCCC" class="title"> 
            <td height="25" colspan="2" align="center"><strong>修改大类名称</strong></td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td width="126"><strong>大类ID：</strong></td>
            <td width="204"><%=rs("f_ID")%> <input name="BigClassID" type="hidden" id="BigClassID" value="<%=rs("f_ID")%>"> 
             </td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td width="126"><strong>大类名称：</strong></td>
            <td> 
              <input name="NewBigClassName" type="text" id="NewBigClassName" value="<%=rs("f_value")%>" size="20" maxlength="30"></td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td align="center">&nbsp;</td>
            <td align="center"> 
              <div align="left"> 
                <input name="Action" type="hidden" id="Action" value="Modify">
                <input name="Save" type="submit" id="Save" value=" 修 改 ">
              </div></td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>

<%
	end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>