<!--#include file="conn.asp"-->
<%
id=request.QueryString("id")
action=request.querystring("action")
tid=request("tid")
select case action

'//添加新数据
case "add" 
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from com_class",conn,1,3
rs.AddNew
rs("ClassNamecn")=trim(request("ClassNamecn2"))
rs("ClassNameEn")=trim(request("ClassNameEn2"))
rs("ClassNameutf")=trim(request("ClassNameutf2"))
rs("pid")=int(request("pid2"))
rs("type")=tid
rs.Update
rs.Close
set rs=nothing
response.Redirect "book_anclass.asp?tid="&tid&""

'//修改数据
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from com_class where id="&id,conn,1,3
rs("ClassNamecn")=trim(request("ClassNamecn"))
rs("ClassNameEn")=trim(request("ClassNameEn"))
rs("ClassNameutf")=trim(request("ClassNameutf"))
rs("pid")=int(request("pid"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "book_anclass.asp?tid="&tid&""

'//删除数据
case "del"
conn.execute ("delete from com_class where id="&id)
conn.execute ("delete from com_class where cid="&id)
conn.execute ("delete from com_books where cid="&id)
response.Redirect "book_anclass.asp?tid="&tid&""
end select
%>