
<!--#include file="../inc/Conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!-- #include file="Inc/Head.asp" -->
<%

dim SmallClassID,Action,BigClassName, SmallClassName, OldSmallClassName,rs
SmallClassID=trim(Request("SmallClassID"))
Action=trim(Request("Action"))
BigClassName=trim(Request.form("BigClassName"))
SmallClassName=trim(Request.form("SmallClassName"))
OldSmallClassName=trim(request.form("OldSmallClassName"))
if SmallClassID="" then
	response.Redirect("News_ClassManage.asp")
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from SmallClass_New where SmallClassID="&SmallClassID&"",conn,1,3
if rs.Bof or rs.EOF then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>此文章小类不存在！</li>"
else
	if Action="Modify" then
		if SmallClassName="" then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>文章小类名不能为空！</li>"
		end if
		if FoundErr<>True then
			rs("SmallClassName")=SmallClassName
     		rs.update
			rs.Close
    	 	set rs=Nothing
			if SmallClassName<>OldSmallClassName then
				conn.execute "Update NEWS set SmallClassName='" & SmallClassName & "' where BigClassName='" & BigClassName & "' and SmallClassName='" & OldSmallClassName & "'"
	     	end if	
			call CloseConn()
    	 	Response.Redirect "News_ClassManage.asp"
		end if
	end if
	if FoundErr=True then
		call WriteErrMsg()
	else
%>
<table width="80%" border="0" cellpadding="2" cellspacing="1" class="border">
  <tr>
    <td align="center" valign="top" class="topbg"><strong>新 闻 类 别 设 置</strong></td>
  </tr>
  <tr>
    <td align="center" valign="top"><form name="form1" method="post" action="News_ClassModifySmall.asp">
          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
            <tr>
              <td height="25" colspan="2" align="center" class="Title"><strong>修改小类名称</strong></td>
            </tr>
            <tr class="tdbg">
              <td height="22" bgcolor="#C0C0C0" class="tdbgl"><strong>所属大类：</strong></td>
              <td class=tdbg><%=rs("BigClassName")%>
                  <input name="SmallClassID" type="hidden" id="SmallClassID" value="<%=rs("SmallClassID")%>">
                  <input name="OldSmallClassName" type="hidden" id="OldSmallClassName" value="<%=rs("SmallClassName")%>">
              <input name="BigClassName" type="hidden" id="BigClassName" value="<%=rs("BigClassName")%>"></td>
            </tr>
            <tr class="tdbg">
              <td height="22" bgcolor="#C0C0C0" class="tdbgl"><strong>小类名称：</strong></td>
              <td class=tdbg><input name="SmallClassName" type="text" id="SmallClassName" value="<%=rs("SmallClassName")%>" size="20" maxlength="30"></td>
            </tr>
            <tr class="tdbg">
              <td height="22" align="center" bgcolor="#C0C0C0" class="tdbgl">　</td>
              <td align="center" class=tdbg><div align="left">
                  <input name="Action" type="hidden" id="Action4" 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
%><!-- #include file="Inc/Foot.asp" -->