?? ?
字號(hào):
VERSION 5.00
Begin VB.Form 圖書歸還
BorderStyle = 1 'Fixed Single
Caption = "還書處理"
ClientHeight = 4335
ClientLeft = 45
ClientTop = 435
ClientWidth = 3990
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4335
ScaleWidth = 3990
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "返回"
Height = 375
Left = 2160
TabIndex = 10
Top = 3600
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "列罰款單"
Height = 375
Left = 360
TabIndex = 9
Top = 3600
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 255
Left = 2520
TabIndex = 3
Top = 600
Width = 735
End
Begin VB.Frame Frame2
Caption = "還書人信息"
Height = 2055
Left = 360
TabIndex = 1
Top = 1440
Width = 3255
Begin VB.TextBox Text6
Height = 270
Left = 960
TabIndex = 8
Top = 1680
Width = 615
End
Begin VB.TextBox Text5
Height = 270
Left = 2400
TabIndex = 7
Top = 1320
Width = 615
End
Begin VB.TextBox Text4
Height = 270
Left = 960
TabIndex = 6
Top = 1320
Width = 615
End
Begin VB.TextBox Text3
Height = 270
Left = 960
TabIndex = 5
Top = 840
Width = 1455
End
Begin VB.TextBox Text2
Height = 270
Left = 960
TabIndex = 4
Top = 360
Width = 1455
End
Begin VB.Label Label5
Caption = "罰 金"
Height = 255
Left = 120
TabIndex = 15
Top = 1680
Width = 735
End
Begin VB.Label Label4
Caption = "可借書數(shù)"
Height = 255
Left = 1680
TabIndex = 14
Top = 1320
Width = 735
End
Begin VB.Label Label3
Caption = "已借書數(shù)"
Height = 255
Left = 120
TabIndex = 13
Top = 1320
Width = 735
End
Begin VB.Label Label2
Caption = "姓 名"
Height = 255
Left = 120
TabIndex = 12
Top = 840
Width = 735
End
Begin VB.Label Label1
Caption = "借書證號(hào)"
Height = 255
Left = 120
TabIndex = 11
Top = 360
Width = 735
End
End
Begin VB.Frame Frame1
Caption = "輸入圖書編號(hào)"
Height = 855
Left = 360
TabIndex = 0
Top = 240
Width = 3255
Begin VB.TextBox Text1
Height = 270
Left = 240
TabIndex = 2
Top = 360
Width = 1575
End
End
End
Attribute VB_Name = "圖書歸還"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rno As String
Public bno As String
Private Sub Command1_Click()
bno = Trim(Text1.Text)
If bno <> "" Then
Dim sqltxt As String
sqltxt = "select * from borrow where 圖書編號(hào)='" + bno + "'"
Set brs = exesql(sqltxt)
If brs.RecordCount = 0 Then
MsgBox "該書不是從本圖書館所借的,不能歸還!", vbOKOnly, "信息提示"
Else
If Trim(brs.Fields("借書證號(hào)")) <> rno Then
If rno <> " " Then
dstr = "罰款單" + Chr(10) + Chr(13)
dstr = dstr & "姓名:" & Trim(Text3.Text) + "(" + rno + ")罰款總數(shù):" & Trim(Text6.Text) & "元"
MsgBox dstr, vbOKOnly, "列罰款單"
End If
rno = Trim(brs.Fields("借書證號(hào)"))
sqltxt = "select *from book where 圖書編號(hào)='" + bno + "'"
Set bs = exesql(sqltxt)
bs.Fields("借否") = "否"
bs.Update
sqltxt = "select * from reader where 借書證號(hào)='" + rno + "'"
Set rs = exesql(sqltxt)
rs.Fields("已借書數(shù)") = rs.Fields("已借書數(shù)") - 1
rs.Update
Text2.Text = rno
Text3.Text = rs.Fields("姓名")
Text4.Text = rs.Fields("已借書數(shù)")
Text5.Text = rs.Fields("借書總數(shù)") - rs.Fields("已借書數(shù)")
If (Date - brs.Fields("借書日期") < rs.Fields("借書天數(shù)")) Then
Text6.Text = 0
Else
Text6.Text = (Date - brs.Fields("借書日期") - rs.Fields("借書天數(shù)")) * rs.Fields("過期罰款")
End If
MsgBox "過期罰款:" + Str(rs.Fields("過期罰款"))
Else
rno = Trim(brs.Fields("借書證號(hào)"))
sqltxt = "select *from book where 圖書編號(hào)='" + bno + "'"
Set bs = exesql(sqltxt)
bs.Fields("借否") = "否"
bs.Update
sqltxt = "select *from reader where 圖書編號(hào)='" + rno + "'"
Set bs = exesql(sqltxt)
rs.Fields("已借書數(shù)") = rs.Fields("已借書數(shù)") - 1
rs.Update
If (Date - brs.Fields("借書日期") > rs.Fields("借書天數(shù)")) Then
Text6.Text = Val(Text6.Text) + (Date - brs.Fields("借書日期") - rs.Fields("借書天數(shù)")) * rs.Fields("過期罰款")
End If
End If
brs.Delete
brs.Update
End If
Else
MsgBox "圖書編號(hào)不能為空", vbOKOnly, "信息提示"
End If
End Sub
Private Sub Command2_Click()
Dim dstr As String
dstr = "罰款單" + Chr(10) + Chr(13)
dstr = dstr & "姓名:" & Trim(Text3.Text) + "(" + Trim(Text2.Text) _
+ ")罰款總額:" & Trim(Text6.Text) & "元"
MsgBox dstr, vbOKOnly, "列罰款單"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
rno = ""
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -