?? cancellent.frm
字號(hào):
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 = "關(guān)閉(&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 = "聯(lián)系電話:"
Height = 255
Left = 240
TabIndex = 14
Top = 360
Visible = 0 'False
Width = 975
End
Begin VB.Label LabelVip
Caption = "會(huì) 員 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 = "影碟數(shù)量:"
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 = "<輸入編號(hào)后按回車鍵>"
ForeColor = &H000000FF&
Height = 255
Left = 3240
TabIndex = 10
Top = 360
Width = 2295
End
Begin VB.Label Label1
Caption = "影碟編號(hào):"
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 "請記錄退租客戶的聯(lián)系電話!", vbInformation + vbOKOnly, "警告"
TxtTel.SetFocus
Exit Sub
Else
OpenDBFile
gCon.Execute "delete from lentinfo where 影碟編號(hào)=""" & Text1.Text & """"
CloseDBFile
SQL = "update cdinfo set 是否借出=0 where 影碟編號(hào)=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "insert into cancellent(影碟編號(hào),影碟名稱,退租電話,退租時(shí)間,退租原因)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 影碟編號(hào)=""" & Text1.Text & """"
CloseDBFile
SQL = "update cdinfo set 是否借出=0 where 影碟編號(hào)=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "select * from vipinfo where 會(huì)員ID=""" & TxtVip.Text & """"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
tel = gRst("會(huì)員電話")
i = gRst("還剩盤數(shù)")
i = i + 1
End If
CloseRS
SQL = "update vipinfo set 還剩盤數(shù)=" & i & " where 會(huì)員ID=""" & TxtVip.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile
SQL = "insert into cancellent(影碟編號(hào),影碟名稱,退租電話,退租時(shí)間,退租原因)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 "請不要亂點(diǎn),先輸入待退影碟的編號(hào)按回車鍵!", 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.影碟編號(hào)=lentinfo.影碟編號(hào) and lentinfo.影碟編號(hào)=""" & Text1.Text & """ and lentinfo.還碟時(shí)間 is null"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
Text2.Text = gRst("lentinfo.影碟名稱")
Text3.Text = gRst("光碟數(shù)量")
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.影碟編號(hào)=viplentinfo.影碟編號(hào) and viplentinfo.影碟編號(hào)=""" & Text1.Text & """ and viplentinfo.還碟時(shí)間 is null"
OpenDBFile
OpenRS (SQL)
If Not gRst.EOF Then
Text2.Text = gRst("影碟名稱")
Text3.Text = gRst("光碟數(shù)量")
TxtVip.Text = gRst("會(huì)員編號(hào)")
LabelVip.Visible = True
TxtVip.Visible = True
LabelTel.Visible = False
TxtTel.Visible = False
LabelTxt.Visible = False
LabelYj.Visible = False
Text4.SetFocus
CloseRS
Else
MsgBox "對(duì)不起,該影碟沒有借出或不存在該影碟!", 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 "請輸入影碟編號(hào),按回車鍵!", vbInformation + vbOKOnly, "警告"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -