📄 taxi.vb
字号:
Me.Label3.ForeColor = System.Drawing.Color.Red
Me.Label3.Location = New System.Drawing.Point(48, 64)
Me.Label3.Size = New System.Drawing.Size(120, 20)
Me.Label3.Text = "公里后每公里价格为"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.NWrite)
Me.GroupBox2.Controls.Add(Me.Night)
Me.GroupBox2.Controls.Add(Me.GroupBox3)
Me.GroupBox2.Controls.Add(Me.Button1)
Me.GroupBox2.Controls.Add(Me.Fee)
Me.GroupBox2.Controls.Add(Me.Label8)
Me.GroupBox2.Controls.Add(Me.ThisTime)
Me.GroupBox2.Controls.Add(Me.thisDistance)
Me.GroupBox2.Controls.Add(Me.Label7)
Me.GroupBox2.Controls.Add(Me.Label6)
Me.GroupBox2.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold)
Me.GroupBox2.Location = New System.Drawing.Point(8, 118)
Me.GroupBox2.Size = New System.Drawing.Size(224, 114)
Me.GroupBox2.Text = "本次乘车计价"
'
'NWrite
'
Me.NWrite.Location = New System.Drawing.Point(96, 90)
Me.NWrite.Size = New System.Drawing.Size(120, 20)
Me.NWrite.Text = "写入乘车记录"
'
'Night
'
Me.Night.Location = New System.Drawing.Point(8, 90)
Me.Night.Size = New System.Drawing.Size(104, 20)
Me.Night.Text = "是否有夜计?"
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.ZK)
Me.GroupBox3.Controls.Add(Me.Lable)
Me.GroupBox3.Controls.Add(Me.Label9)
Me.GroupBox3.Location = New System.Drawing.Point(160, 9)
Me.GroupBox3.Size = New System.Drawing.Size(64, 56)
'
'ZK
'
Me.ZK.Location = New System.Drawing.Point(8, 32)
Me.ZK.Size = New System.Drawing.Size(32, 21)
Me.ZK.Text = "10"
'
'Lable
'
Me.Lable.Location = New System.Drawing.Point(8, 8)
Me.Lable.Size = New System.Drawing.Size(48, 20)
Me.Lable.Text = "折扣:"
'
'Label9
'
Me.Label9.Location = New System.Drawing.Point(40, 32)
Me.Label9.Size = New System.Drawing.Size(16, 20)
Me.Label9.Text = "折"
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Button1.Location = New System.Drawing.Point(168, 66)
Me.Button1.Size = New System.Drawing.Size(48, 20)
Me.Button1.Text = "计算"
'
'Fee
'
Me.Fee.Enabled = False
Me.Fee.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Fee.ForeColor = System.Drawing.Color.Red
Me.Fee.Location = New System.Drawing.Point(94, 64)
Me.Fee.Size = New System.Drawing.Size(58, 22)
Me.Fee.Text = ""
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Label8.ForeColor = System.Drawing.Color.Magenta
Me.Label8.Location = New System.Drawing.Point(8, 64)
Me.Label8.Text = "本次乘车费用:"
'
'ThisTime
'
Me.ThisTime.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.ThisTime.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.ThisTime.Location = New System.Drawing.Point(112, 40)
Me.ThisTime.Size = New System.Drawing.Size(40, 22)
Me.ThisTime.Text = "0"
'
'thisDistance
'
Me.thisDistance.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.thisDistance.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.thisDistance.Location = New System.Drawing.Point(112, 16)
Me.thisDistance.Size = New System.Drawing.Size(40, 22)
Me.thisDistance.Text = ""
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Label7.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(8, 40)
Me.Label7.Size = New System.Drawing.Size(120, 20)
Me.Label7.Text = "本次乘车等待时间:"
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
Me.Label6.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
Me.Label6.Location = New System.Drawing.Point(8, 16)
Me.Label6.Size = New System.Drawing.Size(104, 20)
Me.Label6.Text = "本次乘车公里数:"
'
'N1
'
Me.N1.Location = New System.Drawing.Point(7, 241)
Me.N1.Size = New System.Drawing.Size(16, 20)
Me.N1.Text = "1"
'
'N2
'
Me.N2.Location = New System.Drawing.Point(26, 241)
Me.N2.Size = New System.Drawing.Size(16, 20)
Me.N2.Text = "2"
'
'N4
'
Me.N4.Location = New System.Drawing.Point(64, 241)
Me.N4.Size = New System.Drawing.Size(16, 20)
Me.N4.Text = "4"
'
'N3
'
Me.N3.Location = New System.Drawing.Point(45, 241)
Me.N3.Size = New System.Drawing.Size(16, 20)
Me.N3.Text = "3"
'
'N8
'
Me.N8.Location = New System.Drawing.Point(140, 241)
Me.N8.Size = New System.Drawing.Size(16, 20)
Me.N8.Text = "8"
'
'N7
'
Me.N7.Location = New System.Drawing.Point(121, 241)
Me.N7.Size = New System.Drawing.Size(16, 20)
Me.N7.Text = "7"
'
'N6
'
Me.N6.Location = New System.Drawing.Point(102, 241)
Me.N6.Size = New System.Drawing.Size(16, 20)
Me.N6.Text = "6"
'
'N5
'
Me.N5.Location = New System.Drawing.Point(83, 241)
Me.N5.Size = New System.Drawing.Size(16, 20)
Me.N5.Text = "5"
'
'N0
'
Me.N0.Location = New System.Drawing.Point(178, 241)
Me.N0.Size = New System.Drawing.Size(16, 20)
Me.N0.Text = "0"
'
'N9
'
Me.N9.Location = New System.Drawing.Point(159, 241)
Me.N9.Size = New System.Drawing.Size(16, 20)
Me.N9.Text = "9"
'
'Ndot
'
Me.Ndot.Location = New System.Drawing.Point(197, 241)
Me.Ndot.Size = New System.Drawing.Size(16, 20)
Me.Ndot.Text = "."
'
'NBack
'
Me.NBack.Location = New System.Drawing.Point(216, 241)
Me.NBack.Size = New System.Drawing.Size(16, 20)
Me.NBack.Text = "C"
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 60000
'
'Form1
'
Me.Controls.Add(Me.NBack)
Me.Controls.Add(Me.Ndot)
Me.Controls.Add(Me.N0)
Me.Controls.Add(Me.N9)
Me.Controls.Add(Me.N8)
Me.Controls.Add(Me.N7)
Me.Controls.Add(Me.N6)
Me.Controls.Add(Me.N5)
Me.Controls.Add(Me.N4)
Me.Controls.Add(Me.N3)
Me.Controls.Add(Me.N2)
Me.Controls.Add(Me.N1)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Menu = Me.MainMenu1
Me.Text = "出租车计价程序"
End Sub
#End Region
Dim iStartFee, iStartDistance As Integer
Dim iDistance, iPrice1, iPrice2 As Integer
Dim iThisDistance, iThisTime As Double
Dim iFee, iZK As Double
Dim iFocus As Integer
Dim iStartTime As Integer
Dim fullname As String '可执行文件含路径
Dim myAppPath As String
Dim cn As System.Data.SqlServerCe.SqlCeConnection
Dim SQL As String
Dim SQLEngine As System.Data.SqlServerCe.SqlCeEngine
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fullname = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
myAppPath = System.IO.Path.GetDirectoryName(fullname) '全局可执行文件路径变量
Call CreateDatabase()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If thisDistance.Text = "" Then
MsgBox("请输入本次乘车的公里数!", MsgBoxStyle.Information, "请输入")
Return
End If
If ThisTime.Text = "" Then
MsgBox("请输入本次乘车的等待时间!", MsgBoxStyle.Information, "请输入")
Return
End If
iThisDistance = thisDistance.Text
iThisTime = ThisTime.Text
iZK = ZK.Text
iStartFee = StartFee.Text
iDistance = Distance.Text
iStartDistance = StartDistance.Text
iStarttime = StartTime.Text
If iThisDistance > 10 Then
iFee = (iStartFee + (iThisDistance - iDistance) * 3 + (iDistance - iStartDistance) * 2 + (iThisTime - iStartTime) / 5 * 2) * iZK / 10
If Night.Checked = True Then iFee = iFee * 1.3
If iFee - System.Math.Floor(iFee) > 0.5 Then
iFee = System.Math.Ceiling(iFee)
Else
iFee = System.Math.Floor(iFee)
End If
Fee.Text = Str(System.Math.Floor(iFee)) + "元"
Else
iFee = (iStartFee + (iThisDistance - iStartDistance) * 2 + (iThisTime - iStartTime) / 5 * 2) * iZK / 10
If iFee <= 10 Then iFee = 10
If Night.Checked = True Then iFee = iFee * 1.3
If iFee - System.Math.Floor(iFee) > 0.5 Then
iFee = System.Math.Ceiling(iFee)
Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -