📄 cancellent.frm
字号:
VERSION 5.00
Begin VB.Form CancelLent
BorderStyle = 1 'Fixed Single
Caption = "影碟退租"
ClientHeight = 3945
ClientLeft = 45
ClientTop = 435
ClientWidth = 7320
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 3945
ScaleWidth = 7320
Begin VB.CommandButton Command2
Caption = "关闭(&C)"
Height = 375
Left = 6000
TabIndex = 18
Top = 3360
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "退租(&H)"
Height = 375
Left = 4680
TabIndex = 17
Top = 3360
Width = 1215
End
Begin VB.Frame Frame4
Caption = "退租信息"
Height = 855
Left = 240
TabIndex = 11
Top = 2880
Width = 4215
Begin VB.TextBox TxtTel
Appearance = 0 'Flat
BackColor = &H00C0E0FF&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 15
Top = 240
Visible = 0 'False
Width = 2055
End
Begin VB.TextBox TxtVip
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 13
Top = 240
Visible = 0 'False
Width = 2055
End
Begin VB.Label LabelTxt
BackStyle = 0 'Transparent
Caption = "(必填)"
Height = 255
Left = 3360
TabIndex = 16
Top = 360
Visible = 0 'False
Width = 855
End
Begin VB.Label LabelTel
Caption = "联系电话:"
Height = 255
Left = 240
TabIndex = 14
Top = 360
Visible = 0 'False
Width = 975
End
Begin VB.Label LabelVip
Caption = "会 员 ID:"
Height = 375
Left = 240
TabIndex = 12
Top = 360
Visible = 0 'False
Width = 975
End
End
Begin VB.Frame Frame3
Caption = "退租原因"
Height = 1695
Left = 3840
TabIndex = 8
Top = 1080
Width = 3375
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 9
Top = 240
Width = 3135
End
End
Begin VB.Frame Frame2
Caption = "影碟信息"
Height = 1695
Left = 240
TabIndex = 3
Top = 1080
Width = 3495
Begin VB.TextBox Text3
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
Locked = -1 'True
TabIndex = 7
Top = 1080
Width = 1935
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
Locked = -1 'True
TabIndex = 5
Top = 360
Width = 1935
End
Begin VB.Label Label3
Caption = "影碟数量:"
Height = 255
Left = 240
TabIndex = 6
Top = 1200
Width = 975
End
Begin VB.Label Label2
Caption = "影碟名称:"
Height = 255
Left = 240
TabIndex = 4
Top = 480
Width = 975
End
End
Begin VB.Frame Frame1
Height = 855
Left = 240
TabIndex = 0
Top = 120
Width = 6975
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 2
Top = 240
Width = 1935
End
Begin VB.Label Label4
Caption = "<输入编号后按回车键>"
ForeColor = &H000000FF&
Height = 255
Left = 3240
TabIndex = 10
Top = 360
Width = 2295
End
Begin VB.Label Label1
Caption = "影碟编号:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 975
End
End
Begin VB.Label LabelYj
Height = 255
Left = 4680
TabIndex = 19
Top = 3000
Visible = 0 'False
Width = 2295
End
End
Attribute VB_Name = "CancelLent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim yj As Integer
Private Sub Command1_Click()
Dim SQL As String
Dim i As Integer
Dim tel As String
If Text1.Text <> "" And Text2.Text <> "" Then
If Text4.Text = "" Then
MsgBox "请记录退租原因!", vbInformation + vbOKOnly, "警告"
Text4.SetFocus
Exit Sub
End If
If TxtTel.Visible = True Then
If TxtTel.Text = "" Then
MsgBox "请记录退租客户的联系电话!", vbInformation + vbOKOnly, "警告"
TxtTel.SetFocus
Exit Sub
Else
OpenDBFile
gCon.Execute "delete from lentinfo where 影碟编号=""" & Text1.Text & """"
CloseDBFile
SQL = "update cdinfo set 是否借出=0 where 影碟编号=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "insert into cancellent(影碟编号,影碟名称,退租电话,退租时间,退租原因)values(""" _
& Text1.Text & """,""" _
& Text2.Text & """,""" _
& TxtTel.Text & """,#" _
& Date & "#,""" _
& Text4.Text & """)"
OpenDBFile
gCon.Execute SQL
CloseDBFile
MsgBox "退租成功,请退还客户押金:" & yj & "元", vbInformation + vbOKOnly, "提示"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
TxtTel.Text = ""
LabelTel.Visible = False
LabelTxt.Visible = False
LabelYj.Visible = False
TxtTel.Visible = False
End If
Else
OpenDBFile
gCon.Execute "delete from viplentinfo where 影碟编号=""" & Text1.Text & """"
CloseDBFile
SQL = "update cdinfo set 是否借出=0 where 影碟编号=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "select * from vipinfo where 会员ID=""" & TxtVip.Text & """"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
tel = gRst("会员电话")
i = gRst("还剩盘数")
i = i + 1
End If
CloseRS
SQL = "update vipinfo set 还剩盘数=" & i & " where 会员ID=""" & TxtVip.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "insert into cancellent(影碟编号,影碟名称,退租电话,退租时间,退租原因)values(""" _
& Text1.Text & """,""" _
& Text2.Text & """,""" _
& tel & """,#" _
& Date & "#,""" _
& Text4.Text & """)"
OpenDBFile
gCon.Execute SQL
CloseDBFile
MsgBox "退租成功,请返回!", vbInformation + vbOKOnly, "提示"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
TxtTel.Text = ""
LabelVip.Visible = False
TxtVip.Visible = False
End If
Else
MsgBox "请不要乱点,先输入待退影碟的编号按回车键!", vbInformation + vbOKOnly, "警告"
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub text1_keypress(keyacsii As Integer)
Dim SQL As String
If keyacsii = "13" And Text1.Text <> "" Then
SQL = "select * from lentinfo,cdinfo where cdinfo.影碟编号=lentinfo.影碟编号 and lentinfo.影碟编号=""" & Text1.Text & """ and lentinfo.还碟时间 is null"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
Text2.Text = gRst("lentinfo.影碟名称")
Text3.Text = gRst("光碟数量")
yj = gRst("所交押金")
LabelYj.Caption = "退还押金:" & yj & "元"
LabelVip.Visible = False
TxtVip.Visible = False
LabelTel.Visible = True
TxtTel.Visible = True
LabelTxt.Visible = True
LabelYj.Visible = True
Text4.SetFocus
CloseRS
Else
CloseRS
SQL = "select * from viplentinfo,cdinfo where cdinfo.影碟编号=viplentinfo.影碟编号 and viplentinfo.影碟编号=""" & Text1.Text & """ and viplentinfo.还碟时间 is null"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
Text2.Text = gRst("影碟名称")
Text3.Text = gRst("光碟数量")
TxtVip.Text = gRst("会员编号")
LabelVip.Visible = True
TxtVip.Visible = True
LabelTel.Visible = False
TxtTel.Visible = False
LabelTxt.Visible = False
LabelYj.Visible = False
Text4.SetFocus
CloseRS
Else
MsgBox "对不起,该影碟没有借出或不存在该影碟!", vbInformation + vbOKOnly, "警告"
Text1.Text = ""
Text1.SetFocus
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
LabelVip.Visible = False
TxtVip.Visible = False
LabelTel.Visible = False
TxtTel.Visible = False
LabelTxt.Visible = False
LabelYj.Visible = False
CloseRS
Exit Sub
End If
End If
ElseIf keyacsii = "13" And Text1.Text <> "" Then
MsgBox "请输入影碟编号,按回车键!", vbInformation + vbOKOnly, "警告"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -