📄 forbackticket.frm
字号:
Text = "Text4"
Top = 2280
Width = 1695
End
Begin VB.TextBox Text3
BackColor = &H00FFFFC0&
Enabled = 0 'False
Height = 495
Left = 5880
TabIndex = 6
Text = "Text3"
Top = 1440
Width = 1695
End
Begin VB.TextBox Text2
BackColor = &H00FFFFC0&
Enabled = 0 'False
Height = 495
Left = 2280
TabIndex = 5
Text = "Text2"
Top = 2280
Width = 1695
End
Begin VB.TextBox Text1
BackColor = &H00FFFFC0&
Height = 495
Left = 2280
TabIndex = 1
Text = "Text1"
Top = 1440
Width = 1695
End
Begin VB.Label Label5
BackColor = &H00C0FFFF&
Caption = "车票状态:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 840
TabIndex = 13
Top = 3360
Width = 3255
End
Begin VB.Shape Shape2
BorderColor = &H00FF00FF&
Height = 1335
Left = 840
Shape = 4 'Rounded Rectangle
Top = 3840
Width = 7455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "返还金额"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 4
Top = 2400
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "扣除金额"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4440
TabIndex = 3
Top = 1560
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "已交金额"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 2
Top = 2400
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "车票编号"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 0
Top = 1560
Width = 975
End
Begin VB.Shape Shape1
BackColor = &H00FFFFC0&
BorderColor = &H00FF00FF&
Height = 2175
Left = 840
Shape = 4 'Rounded Rectangle
Top = 960
Width = 7335
End
Begin VB.Image Image1
Height = 11520
Left = -3360
Picture = "ForBackTicket.frx":149E
Top = -240
Width = 15360
End
End
Attribute VB_Name = "ForBackTicket"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "请输入车票编号!!"
Text1.SetFocus
Exit Sub
End If
Adodc1.RecordSource = "select * from 未售票登记表 where 车票编号= '" & Text1.Text & "'"
Adodc1.Refresh
Adodc3.RecordSource = "select * from 已售票登记表 where 车票编号= '" & Text1.Text & "'"
Adodc3.Refresh
If Adodc1.Recordset.EOF = True Or Adodc1.Recordset.BOF = True Then
MsgBox "对不起!没有该车票!请核查后再输入!"
Exit Sub
End If
If Adodc1.Recordset.EOF = False Or Adodc1.Recordset.BOF = False Then
Label5.Caption = "车票状态:" & Adodc1.Recordset.Fields(11)
If Trim(Adodc1.Recordset.Fields(11)) = "已售" Then
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'对退票登记表做记录
Adodc2.RecordSource = "select * from 退票登记表"
Adodc2.Refresh
Adodc2.Recordset.AddNew
Adodc2.Recordset("车票编号") = Adodc1.Recordset("车票编号")
Adodc2.Recordset("车次") = Adodc1.Recordset("车次")
Adodc2.Recordset("起始站") = Adodc1.Recordset("起始站")
Adodc2.Recordset("终点站") = Adodc1.Recordset("终点站")
Adodc2.Recordset("发车时间") = Adodc1.Recordset("发车时间")
Adodc2.Recordset("退票状态") = Adodc1.Recordset("车票状态")
Adodc2.Recordset("扣除金额") = Adodc1.Recordset.Fields(10) * 0.35
Adodc2.Recordset.Update
Adodc2.Refresh
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'在未售票登记表中把"已售"状态置为"未售"
Text2.Text = Adodc1.Recordset.Fields(10)
Text3.Text = Adodc1.Recordset.Fields(10) * 0.35
Text4.Text = Adodc1.Recordset.Fields(10) * 0.65
Adodc1.Recordset.Fields(11) = "未售"
Adodc1.Recordset.Update
Adodc1.Refresh
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'已售票登记表中把该记录删除
Adodc3.Recordset.Delete
Adodc3.Refresh
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
MsgBox "退票成功!!!"
End If
If Trim(Adodc1.Recordset.Fields(11)) = "预售" Then
Adodc4.RecordSource = "select * from 用户订票表单 where 车票编号='" & Text1.Text & "'"
Adodc4.Refresh
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Adodc2.RecordSource = "select * from 退票登记表"
Adodc2.Refresh
Adodc2.Recordset.AddNew
Adodc2.Recordset("车票编号") = Adodc1.Recordset("车票编号")
Adodc2.Recordset("车次") = Adodc1.Recordset("车次")
Adodc2.Recordset("起始站") = Adodc1.Recordset("起始站")
Adodc2.Recordset("终点站") = Adodc1.Recordset("终点站")
Adodc2.Recordset("发车时间") = Adodc1.Recordset("发车时间")
Adodc2.Recordset("退票状态") = Adodc1.Recordset("车票状态")
Adodc2.Recordset("扣除金额") = Adodc4.Recordset("预付金额") * 0.5
Adodc2.Recordset.Update
Adodc2.Refresh
'''''''''''''''''''''''''''''''''''''''''''''''''''
Text2.Text = Adodc4.Recordset("预付金额")
Text3.Text = Adodc4.Recordset("预付金额") * 0.35
Text4.Text = Adodc4.Recordset("预付金额") * 0.65
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'删除用户的订票信息
Adodc4.Recordset.Delete
Adodc4.Refresh
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'在未售票登记表中把"预售"状态置为"未售"
Adodc1.Recordset.Fields(11) = "未售"
Adodc1.Recordset.Update
Adodc1.Refresh
MsgBox "退票成功!!!"
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -