End Function
Public Function GetRowsNum(ByVal sqlstr As String) As Integer
If myConn.State = ConnectionState.Closed Then
myConn.Open()
End If
Fill(sqlstr)
myConn.Close()
Return ds.Tables(0).Rows.Count
End Function
Public Function GetBookState(ByVal BookID As String) As Integer
Dim sqlstr As String = "select * from BookInfo where BookState=1 and BookID=" + BookID
If GetRowsNum(sqlstr) = 0 Then
Return -2
End If
sqlstr = "select * from LendInfo where IsBack=0 and BookID =" + BookID
If GetRowsNum(sqlstr) <> 0 Then
Return -1
End If
sqlstr = "select * from BookingInfo where BookID=" + BookID
If GetRowsNum(sqlstr) <> 0 Then
Return 0
End If
Return 1
End Function
Public Function GetBookDate(ByVal UserID As String) As Integer
Dim sqlstr As String = "select BookDate from UserInfo where UserID='" + UserID + "'"
Dim myreader As SqlDataReader = ExecReaderSql(sqlstr)
Dim num As Integer = 0
If myreader.Read Then
num = myreader("BookDate")
End If
myConn.Close()
Return num
End Function
Public Function LendBook(ByVal UserID As String, ByVal BookID As String) As Boolean
Dim datenum As Integer = GetBookDate(UserID)
<< 上一页 [21] [22] [23] [24] [25] 下一页