📄 retbook.frm
字号:
VERSION 5.00
Begin VB.Form retbook
Caption = "读者还书"
ClientHeight = 5760
ClientLeft = 60
ClientTop = 345
ClientWidth = 8040
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5760
ScaleWidth = 8040
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "返回"
Height = 375
Left = 6120
TabIndex = 5
Top = 1440
Width = 735
End
Begin VB.CommandButton Command2
Caption = "罚款单"
Height = 375
Left = 6120
TabIndex = 4
Top = 720
Width = 735
End
Begin VB.Frame Frame2
Caption = "还书人信息"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 2775
Left = 720
TabIndex = 3
Top = 2640
Width = 6735
Begin VB.TextBox Text6
Height = 375
Left = 4920
TabIndex = 15
Text = "Text6"
Top = 1560
Width = 1455
End
Begin VB.TextBox Text5
Height = 375
Left = 4920
TabIndex = 13
Text = "Text5"
Top = 480
Width = 1455
End
Begin VB.TextBox Text4
Height = 375
Left = 1680
TabIndex = 11
Text = "Text4"
Top = 1920
Width = 1095
End
Begin VB.TextBox Text3
Height = 375
Left = 1680
TabIndex = 9
Text = "Text3"
Top = 1200
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 1680
TabIndex = 7
Text = "Text2"
Top = 480
Width = 1935
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "罚款"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 4080
TabIndex = 14
Top = 1560
Width = 480
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "姓名"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 300
Left = 4080
TabIndex = 12
Top = 480
Width = 480
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "可借书数"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 360
TabIndex = 10
Top = 1920
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "已借书数"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 240
Left = 360
TabIndex = 8
Top = 1200
Width = 960
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "借书证号"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 300
Left = 360
TabIndex = 6
Top = 480
Width = 960
End
End
Begin VB.Frame Frame1
Caption = "输入图书编号"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 1935
Left = 720
TabIndex = 0
Top = 360
Width = 4455
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 3000
TabIndex = 2
Top = 1320
Width = 615
End
Begin VB.TextBox Text1
Height = 375
Left = 960
TabIndex = 1
Text = "Text1"
Top = 720
Width = 2655
End
End
End
Attribute VB_Name = "retbook"
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 图书编号='" + bno + "'"
Set brs = exesql(sqltxt)
If brs.RecordCount = 0 Then
MsgBox "该书无法归还", vbOKOnly, "信息提示"
Else
If Trim(brs.Fields("借阅证号")) <> rno Then
If rno <> "" Then
dstr = "罚款单" + Chr(10) + Chr(13)
dstr = dstr & "姓名:" & Trim(Text2.Text) + "(" + rno + ") 罚款总额:" & Str(Text6.Text) & "元"
MsgBox dstr, vbOKOnly, "罚款单"
End If
rno = Trim(brs.Fields("借阅证号"))
sqltxt = "select * from book where 图书编号='" + bno + "'"
Set bs = exesql(sqltxt)
bs.Fields("借否") = "否"
bs.Update
sqltxt = "select * from reader where 借阅证号='" + rno + "'"
Set rs = exesql(sqltxt)
rs.Fields("已借书数") = rs.Fields("已借书数") - 1
rs.Update
Text2.Text = rno
Text5.Text = rs.Fields("姓名")
Text3.Text = rs.Fields("已借书数")
Text4.Text = rs.Fields("借书总数") - rs.Fields("已借书数")
If (Date - brs.Fields("借书日期") < rs.Fields("借书天数")) Then
Text6.Text = 0
Else
Text6.Text = (Date - brs.Fields("借书日期") - rs.Fields("借书天数")) * rs.Fields("过期罚款")
End If
MsgBox "过期罚款:" + Str(rs.Fields("过期罚款"))
Else
rno = Trim(brs.Fields("借阅证号"))
sqltxt = "select * from book where 图书编号='" + bno + "'"
Set bs = exesql(sqltxt)
bs.Fields("借否") = "否"
bs.Update
sqltxt = "select * from reader where 借阅证号='" + bno + "'"
Set rs = exesql(sqltxt)
rs.Fields("已借书数") = rs.Fields("已借书数") - 1
rs.Update
If (Date - brs.Fields("借书日期") > rs.Fields("借书天数")) Then
Text6.Text = Val(Text6.Text) + (Data - brs.Fields("借书日期") - rs.Fields("借书天数")) * rs.Fields("过期罚款")
End If
End If
brs.Delete
brs.Update
End If
Else
MsgBox "图书编号不能为空", vbOKOnly, "信息提示"
End If
End Sub
Private Sub Command2_Click()
Dim dstr As String
dstr = "罚款单" + Chr(10) + Chr(13)
dstr = dstr & "姓名:" & Trim(Text5.Text) + "(" + Trim(Text2.Text) + ") 罚款总额:" & Str(Text6.Text) & "元"
MsgBox dstr, vbOKOnly, "罚款单"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
rno = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -