📄 viplent.frm
字号:
VERSION 5.00
Begin VB.Form VipLent
BorderStyle = 1 'Fixed Single
Caption = "会员租借"
ClientHeight = 3855
ClientLeft = 45
ClientTop = 435
ClientWidth = 5595
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3855
ScaleWidth = 5595
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消租借(&D)"
Height = 495
Left = 4080
TabIndex = 14
Top = 1800
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确认租借(&L)"
Height = 495
Left = 4080
TabIndex = 13
Top = 1080
Width = 1335
End
Begin VB.Frame Frame2
Caption = "会员信息"
Height = 2775
Left = 120
TabIndex = 4
Top = 960
Width = 3855
Begin VB.TextBox Text5
Appearance = 0 'Flat
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 12
Top = 2160
Width = 1935
End
Begin VB.TextBox Text4
Appearance = 0 'Flat
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 11
Top = 1560
Width = 1935
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 10
Top = 960
Width = 1935
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
Height = 375
Left = 1080
Locked = -1 'True
TabIndex = 9
Top = 360
Width = 1935
End
Begin VB.Label Label6
Caption = "还剩盘数:"
Height = 375
Left = 120
TabIndex = 8
Top = 2280
Width = 1095
End
Begin VB.Label Label5
Caption = "联系电话:"
Height = 375
Left = 120
TabIndex = 7
Top = 1680
Width = 1335
End
Begin VB.Label Label4
Caption = "会员级别:"
Height = 375
Left = 120
TabIndex = 6
Top = 1080
Width = 1215
End
Begin VB.Label Label3
Caption = "会员姓名:"
Height = 375
Left = 120
TabIndex = 5
Top = 480
Width = 975
End
End
Begin VB.Frame Frame1
Height = 735
Left = 120
TabIndex = 0
Top = 120
Width = 5295
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
Height = 375
Left = 1080
TabIndex = 2
Top = 240
Width = 1815
End
Begin VB.Label Label2
Caption = "<输入ID后按回车键>"
ForeColor = &H000000FF&
Height = 255
Left = 3120
TabIndex = 3
Top = 360
Width = 1695
End
Begin VB.Label Label1
Caption = "会 员 ID:"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "VipLent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim SQL As String
Dim i As Integer
If Text2.Text <> "" Then
i = Text5.Text - 1
If Text5.Text = 0 Then
MsgBox "对不起该会员需要续费!", vbInformation + vbOKOnly, "提示"
Exit Sub
End If
End If
If Text1.Text <> "" And Text2.Text <> "" Then
SQL = "insert into viplentinfo(影碟编号,会员编号,借碟时间)values(""" _
& LentCD.TxtCDId.Text & """,""" _
& Text1.Text & """,#" _
& Date & "#)"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "update cdinfo set 是否借出= -1 where 影碟编号= """ & LentCD.TxtCDId.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "update vipinfo set 还剩盘数=" & i & " where 会员ID=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
MsgBox "租借成功,请返回!", vbInformation + vbOKOnly, "信息"
LentCD.TxtCDId = ""
LentCD.TxtCDle = ""
LentCD.TxtCDName = ""
LentCD.TxtDATE = ""
LentCD.TxtM = ""
LentCD.TxtSum = ""
LentCD.TxtYj = ""
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub text1_keypress(keyascii As Integer)
Dim SQL As String
If keyascii = "13" And Text1.Text <> "" Then
SQL = "select * from vipinfo where 会员ID= """ & Text1.Text & """"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
Text2.Text = gRst("会员姓名")
Text3.Text = gRst("会员级别")
Text4.Text = gRst("会员电话")
Text5.Text = gRst("还剩盘数")
Else
MsgBox "对不起该会员ID不存在,请重新输入!", vbInformation + vbOKOnly, "信息"
Text1.Text = ""
Text1.SetFocus
End If
CloseRS
ElseIf keyascii = "13" And Text1.Text = "" Then
MsgBox "请输入会员ID,并按回车键!", vbInformation + vbOKOnly, "警告"
Text1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -