📄 forbookticket.frm
字号:
Begin VB.TextBox Text6
Enabled = 0 'False
Height = 375
Left = 3360
TabIndex = 20
Text = "Text6"
Top = 360
Width = 1815
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 19
Text = "Text5"
Top = 2280
Width = 1095
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 18
Text = "Text4"
Top = 1800
Width = 1095
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 17
Text = "Text3"
Top = 1320
Width = 1095
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 16
Text = "Text2"
Top = 840
Width = 1095
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 405
Left = 1080
TabIndex = 15
Text = "Text1"
Top = 360
Width = 1095
End
Begin VB.Label Label19
BackColor = &H00C0FFC0&
Caption = "领票时间"
Height = 375
Left = 5400
TabIndex = 45
Top = 480
Width = 975
End
Begin VB.Label Label14
BackColor = &H00C0FFC0&
Caption = "车票编号"
Height = 375
Left = 2400
TabIndex = 33
Top = 360
Width = 735
End
Begin VB.Label Label13
BackColor = &H00C0FFC0&
Caption = "未付金额"
Height = 375
Left = 5400
TabIndex = 14
Top = 2400
Width = 975
End
Begin VB.Label Label12
BackColor = &H00C0FFC0&
Caption = "乘客类型"
Height = 375
Left = 5400
TabIndex = 13
Top = 960
Width = 855
End
Begin VB.Label Label11
BackColor = &H00C0FFC0&
Caption = "预付金额"
Height = 375
Left = 5400
TabIndex = 12
Top = 1920
Width = 855
End
Begin VB.Label Label10
BackColor = &H00C0FFC0&
Caption = "车票折后价"
Height = 375
Left = 5280
TabIndex = 11
Top = 1440
Width = 1095
End
Begin VB.Label Label9
BackColor = &H00C0FFC0&
Caption = "到站时间"
Height = 375
Left = 2400
TabIndex = 10
Top = 2280
Width = 855
End
Begin VB.Label Label8
BackColor = &H00C0FFC0&
Caption = "始发时间"
Height = 375
Left = 2400
TabIndex = 9
Top = 1800
Width = 855
End
Begin VB.Label Label7
BackColor = &H00C0FFC0&
Caption = "座位号"
Height = 375
Left = 2400
TabIndex = 8
Top = 1320
Width = 735
End
Begin VB.Label Label6
BackColor = &H00C0FFC0&
Caption = "车廂号"
Height = 375
Left = 2400
TabIndex = 7
Top = 840
Width = 735
End
Begin VB.Label Label5
BackColor = &H00C0FFC0&
Caption = "终点站"
Height = 375
Left = 240
TabIndex = 6
Top = 2400
Width = 735
End
Begin VB.Label Label4
BackColor = &H00C0FFC0&
Caption = "起点站"
Height = 375
Left = 240
TabIndex = 5
Top = 1920
Width = 855
End
Begin VB.Label Label3
BackColor = &H00C0FFC0&
Caption = "座位类型"
Height = 375
Left = 240
TabIndex = 4
Top = 1440
Width = 975
End
Begin VB.Label Label2
BackColor = &H00C0FFC0&
Caption = "列车类型"
Height = 255
Left = 240
TabIndex = 3
Top = 960
Width = 855
End
Begin VB.Label Label1
BackColor = &H00C0FFC0&
Caption = "车次"
Height = 375
Left = 360
TabIndex = 2
Top = 480
Width = 855
End
End
Begin VB.Image Image1
Height = 11520
Left = -4200
Picture = "ForBookTicket.frx":1D9D
Top = -720
Visible = 0 'False
Width = 15360
End
End
Attribute VB_Name = "ForBookTicket"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
If Combo1.Text = "普通" Then
Text12.Text = ForSaleTicket.Adodc1.Recordset.Fields(10)
Text13.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6
Text18.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) - ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6
ElseIf Combo1.Text = "学生" Then
Text12.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.5
Text13.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.5
Text18.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) - ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.5
ElseIf Combo1.Text = "军人" Then
Text12.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.8
Text13.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.8
Text18.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) - ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.8
ElseIf Combo1.Text = "伤残" Then
Text12.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6
Text13.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.6
Text18.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) - ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.6
Else
Text12.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.5
Text13.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.5
Text18.Text = ForSaleTicket.Adodc1.Recordset.Fields(10) - ForSaleTicket.Adodc1.Recordset.Fields(10) * 0.6 * 0.5
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
If Text14.Text = "" Then
MsgBox "请先交预付金额,并确定预付!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Text15.Text = "" Then
MsgBox "请先交预付金额,并确定预付!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Text16.Text = "" Then
MsgBox "请先交预付金额,并确定预付!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Text17.Text = "" Then
MsgBox "请先交预付金额,并确定预付!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Not IsNumeric(Text12.Text) Then
MsgBox "请先交预付金额,并确定预付!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
MsgBox "正在打印车票,请稍后、、、、", vbOKOnly + vbExclamation, "提示"
End Sub
Private Sub Command3_Click()
If Text14.Text = "" Then
MsgBox "证件号码不能为空!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Not IsNumeric(Text14.Text) Then
MsgBox "证件号码不能为空!!!", vbOKOnly + vbExclamation, "提示"
Text14.SetFocus
Text14.Text = ""
Exit Sub
End If
If Text15.Text = "" Then
MsgBox "姓名不能为空!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Text16.Text = "" Then
MsgBox "联系方式不能为空!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Text17.Text = "" Then
MsgBox "住址不能为空!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
If Not IsNumeric(Text12.Text) Then
MsgBox "请选择乘客类型!!!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
'Adodc1.Refresh
'Adodc1.RecordSource = "Insert into 用户订票表单 values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "','" & Text10.Text & "','" & Text11.Text & "','" & Text12.Text & "','" & Text13.Text & "','" & Text14.Text & "','" & Text15.Text & "','" & Text16.Text & "','" & Text17.Text & "','" & Text18.Text & "')"
'Adodc1.Recordset.Update
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset("车次") = Trim(Text1.Text)
Adodc1.Recordset("列车类型") = Trim(Text2.Text)
Adodc1.Recordset("座位类型") = Trim(Text3.Text)
Adodc1.Recordset("起始站") = Trim(Text4.Text)
Adodc1.Recordset("目的站") = Trim(Text5.Text)
Adodc1.Recordset("车票编号") = Trim(Text6.Text)
Adodc1.Recordset("车厢号") = Trim(Text7.Text)
Adodc1.Recordset("座位号") = Trim(Text8.Text)
Adodc1.Recordset("发车时间") = Trim(Text9.Text)
Adodc1.Recordset("到站时间") = Trim(Text10.Text)
Adodc1.Recordset("领票日期") = Trim(Text11.Text)
Adodc1.Recordset("车票折后价格") = Trim(Text12.Text)
Adodc1.Recordset("预付金额") = Trim(Text13.Text)
Adodc1.Recordset("有效证件号") = Trim(Text14.Text)
Adodc1.Recordset("姓名") = Trim(Text15.Text)
Adodc1.Recordset("联系方式") = Trim(Text16.Text)
Adodc1.Recordset("地址") = Trim(Text17.Text)
Adodc1.Recordset("未付金额") = Trim(Text18.Text)
Adodc1.Recordset.Update
Adodc1.Refresh
'把未售票表里的"未售"改为"预售"
ForSaleTicket.Adodc1.Recordset("车票状态") = "预售"
ForSaleTicket.Adodc1.Recordset.Update
ForSaleTicket.Adodc1.Refresh
MsgBox "订票成功!!!", vbOKOnly + vbExclamation, "提示"
End Sub
Private Sub Form_Load()
Combo1.Text = "普通"
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -