📄 retbook.frm
字号:
VERSION 5.00
Begin VB.Form retbook
Caption = "还书处理"
ClientHeight = 3240
ClientLeft = 60
ClientTop = 450
ClientWidth = 5415
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3240
ScaleWidth = 5415
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3000
TabIndex = 15
Top = 2640
Width = 975
End
Begin VB.CommandButton Command2
Caption = "列罚款单"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 14
Top = 2640
Width = 975
End
Begin VB.Frame Frame2
Caption = "还书人信息"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1215
Left = 120
TabIndex = 3
Top = 1200
Width = 5055
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Index = 4
Left = 3840
TabIndex = 13
Top = 720
Width = 975
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Index = 3
Left = 2640
TabIndex = 12
Top = 720
Width = 615
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Index = 2
Left = 1080
TabIndex = 11
Top = 720
Width = 615
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Index = 1
Left = 3840
TabIndex = 10
Top = 360
Width = 975
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Index = 0
Left = 1080
TabIndex = 9
Top = 360
Width = 1335
End
Begin VB.Label Label5
Caption = "罚金"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 8
Top = 720
Width = 495
End
Begin VB.Label Label4
Caption = "可借书数"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1800
TabIndex = 7
Top = 720
Width = 975
End
Begin VB.Label Label3
Caption = "已借书数"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 6
Top = 720
Width = 975
End
Begin VB.Label Label2
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 5
Top = 360
Width = 615
End
Begin VB.Label Label1
Caption = "借书证号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 4
Top = 360
Width = 855
End
End
Begin VB.Frame Frame1
Caption = "输入图书编号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 960
TabIndex = 0
Top = 240
Width = 3615
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 2
Top = 360
Width = 615
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 360
TabIndex = 1
Top = 360
Width = 1695
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(1).Text) + "(" + rno + ") 罚款总额:" & str(Text2(4).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(0).Text = rno
Text2(1).Text = rs.Fields("姓名")
Text2(2).Text = rs.Fields("已借书数")
Text2(3).Text = rs.Fields("借书总数") - rs.Fields("已借书数")
If (Data - brs.Fields("借书日期") < rs.Fields("借书天数")) Then
Text2(4).Text = 0
Else
Text2(4).Text = (Data - 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 借书证号='" + rno + "'"
Set rs = exesql(sqltxt)
rs.Fields("已借书数") = rs.Fields("已借书数") - 1
rs.Update
If (Data - brs.Fields("借书日期") > rs.Fields("借书天数")) Then
Text2(4).Text = Val(Text2(4).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(Text2(1).Text) + "(" + Trim(Text2(0).Text) + ") 罚款总额: " & CStr(Text2(4).Text) & "元"
MsgBox dstr, vbOKOnly, "列罚款单"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
rno = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -