⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookclass.asp

📁 在线图书管理 在线图书管理在线图书管理在线图书管理在线图书管理在线图书管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:
		<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 + -