📄 cancellent.frm
字号:
Height = 255
Left = 2520
TabIndex = 9
Top = 2760
Visible = 0 'False
Width = 2295
End
Begin VB.Label LabelVip
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "ID:"
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 = 3600
TabIndex = 8
Top = 1200
Visible = 0 'False
Width = 375
End
Begin VB.Label LabelTel
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 = 3480
TabIndex = 7
Top = 1200
Width = 735
End
End
End
Attribute VB_Name = "CancelLent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
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
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 + -