📄 form5.frm
字号:
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 13
Top = 3720
Width = 1335
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "剩余数量:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 780
TabIndex = 12
Top = 3240
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "图书总数:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 11
Top = 2640
Width = 1335
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "出版日期:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 10
Top = 2040
Width = 1335
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "图书名称:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 9
Top = 1440
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "图书编号:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 8
Top = 840
Width = 1335
End
End
Attribute VB_Name = "form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Call xpbutton1_Click
End Sub
Private Sub Form_Load()
Me.BackColor = RGB(121, 153, 207)
utid
End Sub
Private Sub xpbutton1_Click()
If admin = False Then
MsgBox "非管理员不可操作,谢谢合作", vbInformation, "错误操作"
Exit Sub
End If
If qy1.State = adStateOpen Then
qy1.Close
End If
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "编号和姓名不可为空,请检查看输入", vbInformation, "输入错误"
Exit Sub
End If
qy1.Open "select * from 图书信息", cnn, adOpenKeyset, adLockOptimistic, adCmdText
Do While qy1.EOF = False
If qy1.Fields(0) = Text1.Text Then
Dim str1 As String
str1 = MsgBox("您输入的图书编号己存在,是否将图书数量累加到原始图书上?", vbQuestion + vbYesNo, "编号重复")
If str1 = vbYes Then
qy1.Fields(5) = Int(qy1.Fields(5)) + Int(Text3.Text)
qy1.Fields(6) = Int(qy1.Fields(6)) + Int(Text3.Text)
qy1.Update
MsgBox "添加成功!请验证!", vbInformation, "累加成功"
Exit Sub
Else
Text1.Text = ""
Exit Sub
End If
Else
qy1.MoveNext
End If
Loop
qy1.AddNew
qy1.Fields(0) = Text1.Text '图书编号
qy1.Fields(1) = Text2.Text '图书名称
qy1.Fields(2) = DTPicker1.Value '出版日期
qy1.Fields(3) = Text5.Text '图书简介
qy1.Fields(4) = Text6.Text '图书其它
qy1.Fields(5) = Text3.Text '图书总数
qy1.Fields(6) = Text3.Text '剩余数量
qy1.Update
MsgBox "数据己添加成功", vbInformation, "添加成功"
Text1.Text = ""
End Sub
Private Sub xpbutton2_Click()
MsgBox "此版本为试用版本,联系QQ342483870可购买源码"
End Sub
Private Sub xpbutton3_Click()
MsgBox "此版本为试用版本,联系QQ342483870可购买源码"
End Sub
Private Sub xpbutton4_Click()
If systembooks - bookindex <= 0 Then
MsgBox "您己经超出借书所限本数!", vbInformation, id + "您好!"
Exit Sub
End If
'--------------检测图书剩余
If qy2.State = adStateOpen Then
qy2.Close
End If
qy2.Open "select * from 图书信息 where 图书编号='" & Text1.Text & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If qy2.Fields(6) <= 0 Then
MsgBox "您所借图书己被其他用户借走,目前剩余为0本", vbInformation, idname + "您好"
Exit Sub
End If
'--------------
If admin = True Then
If qy1.State = adStateOpen Then
qy1.Close
End If
qy1.Open "select * from 借书信息", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If qy3.State = adStateOpen Then
qy3.Close
End If
qy3.Open "select * from 个人信息 where 学号='" & id & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If qy2.Fields(6) <= 0 Then
MsgBox "您所借图书己被其他用户借走,目前剩余为0本", vbInformation, idname + "您好"
Exit Sub
End If
qy1.AddNew
qy1.Fields(1) = id '学号
qy1.Fields(2) = Text1.Text '图书编号
qy1.Fields(3) = Date '借书日期
qy1.Fields(4) = idname '操作人
Dim sstr1 As String '设定归还期限延长30天
sstr1 = "30"
qy1.Fields(5) = Int(Date + sstr1) '借出最终期限
qy1.Fields(6) = "0"
qy2.Fields(6) = qy2.Fields(6) - 1 '图书数量-1
qy3.Fields(9) = qy3.Fields(9) + 1 '借书数量+1
qy1.Update
qy2.Update
qy3.Update
MsgBox "您的借书记录己成功,请继续操作!", vbInformation, idname + "您好"
Exit Sub
End If
'----------
If qy1.State = adStateOpen Then
qy1.Close
End If
qy1.Open "select * from 借书批准处", cnn, adOpenKeyset, adLockOptimistic, adCmdText
qy1.AddNew
qy1.Fields(1) = id '学号
qy1.Fields(2) = Text1.Text '图书编号
qy1.Fields(3) = Date '借书日期
qy1.Fields(4) = idname '操作人
Dim sstr2 As String '设定归还期限延长30天
sstr2 = "30"
qy1.Fields(5) = Int(Date + sstr2) '借出最终期限
qy1.Fields(6) = "0"
qy1.Fields(7) = "1"
qy1.Update
If qy2.State = adStateOpen Then
qy2.Close
End If
qy2.Open "select * from 用户交流", cnn, adOpenKeyset, adLockOptimistic, adCmdText
qy2.AddNew
qy2.Fields(0) = qy1.Fields(0)
qy2.Fields(1) = id '学号
qy2.Fields(2) = adminid '当前管理员
qy2.Fields(3) = "ID为:" + id + "的用户向管理员请求借出编号为" + Text1.Text + "的图书!"
qy2.Fields(4) = Date
qy2.Fields(5) = "0"
qy2.Update
MsgBox "您的请求己提交,需要管理员来回复您!", vbInformation, idname + "您好"
Exit Sub
End Sub
Private Sub utid()
If ifuser = "0" Then
If qy1.State = adStateOpen Then
qy1.Close
End If
qy1.Open "select * from 图书信息 where 图书编号='" & tkUserID & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
Text1.Text = tkUserID '图书编号
Text2.Text = qy1.Fields(1) '图书名称
DTPicker1.Value = qy1.Fields(2) '出版日期
Text5.Text = qy1.Fields(3) '图书简介
Text6.Text = qy1.Fields(4) '图书其它
Text3.Text = qy1.Fields(5) '图书总数
Text4.Text = qy1.Fields(6) '剩余数量
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -