📄 lentcd.frm
字号:
Width = 735
End
Begin VB.Label Label5
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "价格:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 6240
TabIndex = 12
Top = 1680
Width = 735
End
Begin VB.Label Label6
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "数量:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 11
Top = 2280
Width = 735
End
Begin VB.Label Label7
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "天数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 3240
TabIndex = 10
Top = 2280
Width = 735
End
Begin VB.Label Label8
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "押金:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 6240
TabIndex = 9
Top = 2280
Width = 735
End
Begin VB.Label Label9
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "元"
ForeColor = &H80000008&
Height = 255
Left = 8640
TabIndex = 8
Top = 2280
Width = 255
End
End
End
Attribute VB_Name = "LentCD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
Option Explicit
Private Sub Command1_Click()
If TxtCDId.Text <> "" And TxtCDName.Text <> "" Then
VipLent.Show vbModal
End If
End Sub
Private Sub Command2_Click()
Dim SQL As String
If TxtCDId.Text <> "" And TxtCDName.Text <> "" Then
If TxtYj.Text = "" Then
MsgBox "请你输入要收取的押金!", vbInformation + vbOKOnly, "警告"
TxtYj.SetFocus
Exit Sub
End If
If Not IsNumeric(TxtYj.Text) Then
MsgBox "押金必须为数字!", vbInformation + vbOKOnly, "警告"
TxtYj.SetFocus
TxtYj.SelStart = 0
TxtYj.SelLength = Len(TxtYj.Text)
Exit Sub
End If
SQL = "insert into lentinfo(影碟编号,影碟名称,所交押金,借碟时间)values(""" _
& TxtCDId.Text & """,""" _
& TxtCDName.Text & """," _
& TxtYj.Text & ",#" _
& Date & "#)"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "update cdinfo set 是否借出=-1 where 影碟编号=""" & TxtCDId.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
MsgBox "恭喜!影碟租借成功,按关闭按钮返回!", vbInformation + vbOKOnly, "信息"
TxtCDId.Text = ""
TxtCDId.SetFocus
TxtCDName.Text = ""
TxtCDle.Text = ""
TxtM.Text = ""
TxtSum.Text = ""
TxtDATE.Text = ""
TxtYj.Text = ""
End If
End Sub
Private Sub Command3_Click()
TxtCDId.Text = ""
TxtCDId.SetFocus
TxtCDName.Text = ""
TxtCDle.Text = ""
TxtM.Text = ""
TxtSum.Text = ""
TxtDATE.Text = ""
TxtYj.Text = ""
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub txtcdid_keypress(keyascii As Integer)
Dim SQL As String
If keyascii = "13" And TxtCDId.Text <> "" Then
SQL = "select * from cdinfo,cdtype where cdinfo.影碟类别=cdtype.影碟类别 and 影碟编号=""" & TxtCDId.Text & """"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
If gRst("是否借出") = -1 Then
MsgBox "此影碟已经借出,请重新选择其它影碟!", vbInformation + vbOKOnly, "信息"
TxtCDId.Text = ""
TxtCDId.SetFocus
TxtCDName.Text = ""
TxtCDle.Text = ""
TxtM.Text = ""
TxtSum.Text = ""
TxtDATE.Text = ""
TxtYj.Text = ""
CloseRS
Exit Sub
End If
TxtCDName.Text = gRst("影碟名称")
TxtCDle.Text = gRst("cdinfo.影碟类别")
TxtM.Text = gRst("影碟价格")
TxtSum.Text = gRst("光碟数量")
TxtDATE.Text = gRst("借出天数")
Else
MsgBox "你输入的影碟编号不存在!", vbInformation + vbOKOnly, "信息"
TxtCDId.Text = ""
TxtCDId.SetFocus
CloseRS
Exit Sub
End If
CloseRS
TxtYj.SetFocus
ElseIf keyascii = "13" And TxtCDId.Text = "" Then
MsgBox "请你输入影碟编号,按回车键!", vbInformation + vbOKOnly, "警告"
TxtCDId.Text = ""
TxtCDId.SetFocus
End If
End Sub
Private Sub Form_Load()
SkyGzForm1.Caption = Me.Caption
SkyGzForm1.hWnd = Me.hWnd
End Sub
Private Sub Form_Resize()
SkyGzForm1.Left = 0
SkyGzForm1.Top = 0
Me.Width = SkyGzForm1.Width - 5
Me.Height = SkyGzForm1.Height
Call SkyGzForm1.SetRgn(Me, 5)
End Sub
Private Sub SkyGzForm1_UnloadClick()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -