?? 退票.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form5
Caption = "退票"
ClientHeight = 3390
ClientLeft = 60
ClientTop = 345
ClientWidth = 7545
LinkTopic = "Form5"
MDIChild = -1 'True
ScaleHeight = 3390
ScaleWidth = 7545
Begin VB.TextBox Text13
DataField = "應退款"
DataSource = "Adodc3"
Height = 270
Left = 6240
TabIndex = 17
Top = 3000
Visible = 0 'False
Width = 375
End
Begin VB.TextBox Text12
DataField = "票價"
DataSource = "Adodc3"
Height = 270
Left = 6600
TabIndex = 16
Top = 2640
Visible = 0 'False
Width = 255
End
Begin VB.TextBox Text11
DataField = "退票時間"
DataSource = "Adodc3"
Height = 270
Left = 6240
TabIndex = 15
Top = 2640
Visible = 0 'False
Width = 255
End
Begin VB.TextBox Text10
DataField = "票號"
DataSource = "Adodc3"
Height = 270
Left = 5760
TabIndex = 14
Top = 2640
Visible = 0 'False
Width = 375
End
Begin MSAdodcLib.Adodc Adodc3
Height = 330
Left = 4800
Top = 2880
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=車站售票管理系統"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=車站售票管理系統"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "退票表"
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text9
DataField = "發車時間"
DataSource = "Adodc2"
Height = 375
Left = 2160
TabIndex = 13
Top = 2760
Visible = 0 'False
Width = 495
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 2160
Top = 2400
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=車站售票管理系統"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=車站售票管理系統"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "發車時刻表"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command1
Caption = "退票"
Height = 495
Left = 4560
TabIndex = 12
Top = 1920
Width = 1095
End
Begin VB.TextBox Text8
DataField = "退票否"
DataSource = "Adodc1"
Height = 375
Left = 360
TabIndex = 11
Top = 3000
Visible = 0 'False
Width = 495
End
Begin VB.TextBox Text7
DataField = "車次"
DataSource = "Adodc1"
Height = 375
Left = 1080
TabIndex = 10
Top = 3000
Visible = 0 'False
Width = 615
End
Begin VB.TextBox Text6
DataField = "票價"
DataSource = "Adodc1"
Height = 375
Left = 1200
TabIndex = 9
Top = 2280
Visible = 0 'False
Width = 495
End
Begin VB.TextBox Text5
DataField = "乘車日期"
DataSource = "Adodc1"
Height = 375
Left = 360
TabIndex = 8
Top = 2280
Visible = 0 'False
Width = 495
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 360
Top = 2640
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=車站售票管理系統"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=車站售票管理系統"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "車票表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text4
Height = 495
Left = 4440
TabIndex = 7
Top = 1080
Width = 1335
End
Begin VB.TextBox Text3
Height = 495
Left = 4440
TabIndex = 6
Top = 240
Width = 1335
End
Begin VB.TextBox Text2
Height = 495
Left = 1440
TabIndex = 3
Top = 1080
Width = 1455
End
Begin VB.TextBox Text1
Height = 495
Left = 1440
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.Label Label4
Caption = "應退款:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 5
Top = 1080
Width = 1215
End
Begin VB.Label Label3
Caption = "票價:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3240
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.Label Label2
Caption = "退票時間:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 2
Top = 1080
Width = 1455
End
Begin VB.Label Label1
Caption = "票號:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 0
Top = 240
Width = 1095
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc3.Recordset.AddNew
Text10.Text = Text1.Text
Text11.Text = Text2.Text
Text12.Text = Text3.Text
Text13.Text = Text4.Text
Adodc3.Recordset.Update
MsgBox "退票成功", 48, "成功"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Text1_LostFocus()
Dim cc As String
Adodc1.Recordset.MoveFirst
Adodc2.Recordset.MoveFirst
cc = "票號='" & Text1.Text & "'"
If Text1.Text <> "" Then
Adodc1.Recordset.Find cc
Text3.Text = Text6.Text
Text2.Text = Now
cc = "車次='" & Text7.Text & "'"
Adodc2.Recordset.Find cc
If Not Adodc2.Recordset.EOF Then
If Month(Text5.Text) > Month(Text2.Text) Then
Text4.Text = Int(Val(Text6.Text) * 0.1 + 0.5)
Else
If Month(Text5.Text) = Month(Text2.Text) Then
If Day(Text5.Text) > Day(Text2.Text) Then
Text4.Text = Val(Text6.Text) - Int(Val(Text6.Text) * 0.1 + 0.5)
Else
If Day(Text5.Text) = Day(Text2.Text) Then
If (Hour(Text9.Text) - Hour(Text2.Text)) * 60 + Minute(Text9.Text) - Minute(Text2.Text) >= 120 Then
Text4.Text = Val(Text6.Text) - Int(Val(Text6.Text) * 0.1 + 0.5)
Else
If (Hour(Text9.Text) - Hour(Text2.Text)) * 60 + Minute(Text9.Text) - Minute(Text2.Text) >= 60 Then
Text4.Text = Val(Text6.Text) - Int(Val(Text6.Text) * 0.2 + 1)
Else
If (Hour(Text9.Text) - Hour(Text2.Text)) * 60 + Minute(Text9.Text) - Minute(Text2.Text) < 5 Then
MsgBox "接近發車不能退票", 16, "錯誤"
Form5.Hide
Else
Text4.Text = Int(Val(Text6.Text) * 0.3 + 1)
End If
End If
End If
Else
MsgBox "車票過期不能退", 16, "錯誤"
Form5.Hide
End If
End If
Else
MsgBox "車票過期不能退", 16, "錯誤"
Form5.Hide
End If
End If
Else
MsgBox "沒有該票", 16, "錯誤"
End If
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -