?? bookclass.asp
字號:
<tr>
<td class="lefttd" height="20" align="left"><FONT color=#ff9900>·</FONT><%=bookid%></td>
<td class="lefttd" height="20" align="left"><%=isbn%></td>
<td class="lefttd" height="20" align="left"><%=bookname%></td>
<td class="lefttd" height="20" align="center"><%=bookauthor%></td>
<td class="lefttd" height="20" align="left"><%=publishname%></td>
<td class="lefttd" height="20" align="left"><%=bookcount%></td>
<td class="lefttd" height="20" align="left"><%=languagetype%></td>
<td class="lefttd" height="20" align="left"><%=booktype%></td>
<td class="lefttd" height="20" align="left"><%=bookedition%></td>
<td class="lefttd" height="20" align="center">
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td class="td" align="center"><a title="" href="?action=modify&id=<%=ID%>">修改</a></td>
<td class="td" align="center"><input type="checkbox" class="checkbox" name="idd" value="<%=ID%>"></td>
</tr>
</table>
</td>
</tr>
<%
Rs.movenext
loop
Rs.Close
set Rs=nothing
%>
</table>
<BR>
</div>
</form>
<%
End Function
'# ----------------------------------------------------------------------------
'# 函數:RequestForm
'# 描述:取得傳遞信息
'# 參數: -
'# 返回:
'# 完成時間:2005-11-14
'#-----------------------------------------------------------------------------
Private Function RequestForm()
action=indb(Request.QueryString("action"))
'需要被刪除的記錄
idd=indb(Request.Form("idd"))
ID=indb(Request.QueryString("id"))
bookid=indb(Request.Form("bookid"))
isbn=indb(Request.Form("isbn"))
bookname=indb(Request.Form("bookname"))
bookauthor=indb(Request.Form("bookauthor"))
publishname=indb(Request.Form("publishname"))
bookcount=indb(Request.Form("bookcount"))
languageType=indb(Request.Form("languageType"))
booktype=indb(Request.Form("booktype"))
bookedition=indb(Request.Form("bookedition"))
End Function
'# ----------------------------------------------------------------------------
'# 函數:Addpage
'# 描述:添加書籍信息頁面
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Public Function AddPage()
If LCase(Request.ServerVariables("request_method"))="post" Then
RequestForm()
pagination()
Else
PageHtmlForm()
End If
End Function
'# ----------------------------------------------------------------------------
'# 函數:Pagination
'# 描述:內容分頁的實現--->添加書籍信息
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Private Function Pagination()
Add()
If Err Then
Call Go2_Error("書籍信息添加失敗")
Else
Call Go_Success("書籍信息添加成功","?action=list")
End If
End Function
'# ----------------------------------------------------------------------------
'# 函數:Modifypage
'# 描述:修改書籍信息頁面
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Public Function ModifyPage()
RequestForm()
If ID="" Then
Response.Write "錯誤的參數"
exit function
End If
If LCase(Request.ServerVariables("request_method"))="post" Then
RequestForm()
Modify()
Else
GetBook(ID)
PageHtmlForm()
End If
End Function
'# ----------------------------------------------------------------------------
'# 函數:listpage
'# 描述:書籍列表頁面
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Public Function ListPage()
PageHtmlList()
End Function
'# ----------------------------------------------------------------------------
'# 函數:Deletepage
'# 描述:刪除書籍信息頁面
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Public Function DeletePage()
If LCase(Request.ServerVariables("request_method"))="post" Then
RequestForm()
Delete()
Else
PageHtmlList()
End If
End Function
'# ----------------------------------------------------------------------------
'# 函數:Delete
'# 描述:刪除書籍
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Private Function Delete()
Dim Sql
If ID<>"" Then
Sql="Delete From BookInfo Where Id="&ID
Else
Sql="Delete From BookInfo where Id in ("&idd&")"
End If
Actionconn.Execute(Sql)
If Err Then
Call Go2_Error("書籍刪除失敗")
Else
Call Go_Success("書籍刪除成功","?action=list")
End If
End Function
'# ----------------------------------------------------------------------------
'# 函數:add
'# 描述:添加書籍信息
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Private Function Add()
if Trim(ID)="" then
Go2_Error("書籍號不能為空!")
End If
sSql="insert into BookInfo (bookid,ISBN,bookname,BookAuthor,publishname,bookscount,languageType,booktype,bookedition) Values "&_
"('"&bookid&"','"&isbn&"','"&bookname&"','"&bookauthor&"','"&publishname&"',"&bookcount&",'"&languageType&"','"&booktype&"','"&bookedition&"')"
Actionconn.Execute sSql
End Function
'# ----------------------------------------------------------------------------
'# 函數:Modify
'# 描述:修改書籍信息內容
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Private Function Modify()
if Trim(ID)="" then
Go2_Error("書籍信息不能為空!")
End If
Dim Rs,Sql
Set Rs=Server.Createobject("Adodb.Recordset")
Sql="Select * From BookInfo Where ID="&ID
Rs.Open Sql,Actionconn,3,2
Rs("bookid")=bookid
Rs("isbn")=isbn
Rs("bookname")=bookname
Rs("bookauthor")=bookauthor
Rs("publishname")=publishname
Rs("bookscount")=bookcount
Rs("languageType")=languageType
Rs("booktype")=booktype
Rs("bookedition")=bookedition
Rs.Update
Rs.Close
Set Rs=Nothing
If Err Then
Call Go_Error("書籍信息修改失敗")
Else
Call Go_Success("書籍信息修改成功","?action=list")
End If
End Function
'# ----------------------------------------------------------------------------
'# 函數:GetReader
'# 描述:取得單個書籍的屬性
'# 參數: -
'# 返回:
'# 日期:2005-11-14
'#-----------------------------------------------------------------------------
Public Function GetBook(Gid)
Dim Rs
Set Rs=Actionconn.Execute("Select * From BookInfo Where ID='"&Gid&"'")
if Not (Rs.eof and Rs.bof) then
bookid=Rs("bookid")
isbn=Rs("isbn")
bookname=Rs("bookname")
bookauthor=Rs("bookauthor")
publishname=Rs("publishname")
bookcount=Rs("bookscount")
languageType=Rs("languageType")
booktype=Rs("booktype")
bookedition=Rs("bookedition")
end if
Rs.Close
Set Rs=Nothing
End Function
End Class
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -