📄 form7.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Begin VB.Form form7
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "图书借出"
ClientHeight = 4035
ClientLeft = 45
ClientTop = 435
ClientWidth = 4860
Icon = "Form7.frx":0000
LinkTopic = "Form7"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4035
ScaleWidth = 4860
StartUpPosition = 1 '所有者中心
Begin StoneXP.XPButton XPButton1
Height = 375
Left = 720
TabIndex = 8
Top = 3000
Width = 1455
_ExtentX = 2566
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "确定归还"
MouseIcon = "Form7.frx":F84A
MousePointer = 99
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 2520
TabIndex = 3
Top = 1920
Width = 1935
_ExtentX = 3413
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 21168129
CurrentDate = 38591
End
Begin StoneXP.XPButton XPButton2
Height = 375
Left = 2760
TabIndex = 9
Top = 3000
Width = 1455
_ExtentX = 2566
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "确定续借"
MouseIcon = "Form7.frx":FB64
MousePointer = 99
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "借出最终期限:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 7
Top = 1920
Width = 2295
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "借书日期:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 6
Top = 1335
Width = 1575
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "图书编号:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 5
Top = 825
Width = 1695
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "学号:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 2
Top = 1335
Width = 1815
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
TabIndex = 1
Top = 825
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 0
Top = 240
Width = 1815
End
End
Attribute VB_Name = "form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Me.BackColor = RGB(121, 153, 207)
If ifuser = "0" Or ifuser = "1" Or ifuser = "2" Then
jechuxx
End If
End Sub
Private Sub Image1_Click()
Unload Me
End Sub
Private Sub xpbutton1_Click()
If admin = True Then
If sts1.State = adStateOpen Then
sts1.Close
End If
sts1.Open "select * from 借书信息", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If sts4.State = adStateOpen Then
sts4.Close
End If
sts4.Open "select * from 个人信息 where 学号='" & Label1.Caption & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If sts5.State = adStateOpen Then
sts5.Close
End If
sts5.Open "select * from 图书信息 where 图书编号='" & Label2.Caption & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
Do While sts1.EOF = False
If sts1.Fields(1) = Label1.Caption And sts1.Fields(2) = Label2.Caption Then
sts1.Fields(6) = "1"
sts4.Fields(9) = sts4.Fields(9) - 1
sts5.Fields(6) = sts5.Fields(6) + 1
sts4.Update
sts5.Update
sts1.Update
MsgBox "图书己归还,请继续操作!"
Exit Sub
Else
sts1.MoveNext
End If
Loop
Else
'--------------------
If sts3.State = adStateOpen Then '借书批准
sts3.Close
End If
sts3.Open "select * from 借书批准处", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If sts2.State = adStateOpen Then
sts2.Close
End If
sts2.Open "select * from 用户交流", cnn, adOpenKeyset, adLockOptimistic, adCmdText
sts3.AddNew
sts3.Fields(1) = id
sts3.Fields(2) = Label2.Caption
sts3.Fields(6) = "1"
sts3.Fields(7) = "2" '标志为还书
sts3.Update
sts2.AddNew
sts2.Fields(0) = sts3.Fields(0)
sts2.Fields(1) = id
sts2.Fields(2) = adminid
sts2.Fields(3) = "ID为:" + id + "的用户向管理员请求归还编号为:" + Label2.Caption + "的图书!"
sts2.Fields(4) = Date
sts2.Fields(5) = "0"
sts2.Update
MsgBox "你的请求需要管理员验证,请稍候!", vbInformation
End If
End Sub
Private Sub xpbutton2_Click()
If admin = True Then
If sts1.State = adStateOpen Then
sts1.Close
End If
sts1.Open "select * from 借书信息", cnn, adOpenKeyset, adLockOptimistic, adCmdText
Do While sts1.EOF = False
If sts1.Fields(1) = Label1.Caption And sts1.Fields(2) = Label2.Caption Then
sts1.Fields(5) = DTPicker1.Value
sts1.Update
MsgBox "图书己续借成功,请继续操作!"
Exit Sub
Else
sts1.MoveNext
End If
Loop
Else
If sts3.State = adStateOpen Then '借书批准
sts3.Close
End If
sts3.Open "select * from 借书批准处", cnn, adOpenKeyset, adLockOptimistic, adCmdText
If sts2.State = adStateOpen Then
sts2.Close
End If
sts2.Open "select * from 用户交流", cnn, adOpenKeyset, adLockOptimistic, adCmdText
sts3.AddNew
sts3.Fields(1) = id
sts3.Fields(2) = Label2.Caption
sts3.Fields(5) = DTPicker1.Value
sts3.Fields(6) = "1"
sts3.Fields(7) = "3" '标志为还书
sts3.Update
sts2.AddNew
sts2.Fields(0) = sts3.Fields(0)
sts2.Fields(1) = id
sts2.Fields(2) = adminid
sts2.Fields(3) = "ID为:" + id + "的用户向管理员请求续借编号为:" + Label2.Caption + "的图书到" + Str(DTPicker1.Value)
sts2.Fields(4) = Date
sts2.Fields(5) = "0"
sts2.Update
MsgBox "你的请求需要管理员验证,请稍候!", vbInformation
End If
End Sub
Private Sub jechuxx()
If sts1.State = adStateOpen Then
sts1.Close
End If
sts1.Open "select * from 借书信息 where 索引=" & tkUserID, cnn, adOpenKeyset, adLockOptimistic, adCmdText
Label1.Caption = sts1.Fields(1) '学号
Label2.Caption = sts1.Fields(2) '图书编号
Label3.Caption = sts1.Fields(3) '借书日期
DTPicker1.Value = sts1.Fields(5) '图书简介
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -