⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 广州收费标准自动化测试程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "广州收费标准自动测试"
   ClientHeight    =   5145
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7080
   LinkTopic       =   "Form1"
   ScaleHeight     =   5145
   ScaleWidth      =   7080
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   4920
      TabIndex        =   12
      Text            =   "Text1"
      Top             =   3480
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "开始自动测试"
      Height          =   615
      Left            =   2400
      TabIndex        =   11
      Top             =   4080
      Width           =   1335
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   200
      Left            =   5400
      Top             =   480
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "Form1.frx":0000
      Left            =   1920
      List            =   "Form1.frx":0010
      TabIndex        =   9
      Top             =   1920
      Width           =   2175
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   1920
      TabIndex        =   7
      Top             =   3480
      Width           =   2055
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   1920
      TabIndex        =   5
      Text            =   "15"
      Top             =   2640
      Width           =   2055
   End
   Begin VB.CommandButton Command1 
      Caption         =   " 确认&X"
      Height          =   375
      Left            =   720
      TabIndex        =   2
      Top             =   4200
      Width           =   975
   End
   Begin VB.TextBox txtOutdate 
      Height          =   495
      Left            =   1920
      TabIndex        =   1
      Text            =   $"Form1.frx":0030
      Top             =   1080
      Width           =   2175
   End
   Begin VB.TextBox txtIndate 
      Height          =   495
      Left            =   1920
      TabIndex        =   0
      Text            =   $"Form1.frx":0045
      Top             =   360
      Width           =   2175
   End
   Begin VB.Label Label3 
      Caption         =   "车类"
      Height          =   375
      Left            =   600
      TabIndex        =   10
      Top             =   1920
      Width           =   975
   End
   Begin VB.Label Label6 
      Caption         =   "收费金额"
      Height          =   375
      Left            =   240
      TabIndex        =   8
      Top             =   3480
      Width           =   1215
   End
   Begin VB.Label Label5 
      Caption         =   "免费分钟"
      Height          =   495
      Left            =   240
      TabIndex        =   6
      Top             =   2760
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "出 "
      Height          =   255
      Left            =   600
      TabIndex        =   4
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "入"
      Height          =   375
      Left            =   600
      TabIndex        =   3
      Top             =   480
      Width           =   855
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Indate = txtIndate.Text
OldIndate = txtIndate.Text
Outdate = txtOutdate.Text
OldOutdate = txtOutdate.Text
Call GetCharge

End Sub

Private Sub Command2_Click()
If Timer1.Enabled = False Then
    Timer1.Enabled = True
    Command2.Caption = "停止自动测试"
Else
    Timer1.Enabled = False
    Command2.Caption = "开始自动测试"
End If

End Sub

Private Sub Form_Load()
Indate = txtIndate.Text
OldIndate = txtIndate.Text
Outdate = txtOutdate.Text
OldOutdate = txtOutdate.Text
End Sub

Private Sub Timer1_Timer()
    Outdate = DateAdd("s", 33, Outdate)
    txtOutdate.Text = Outdate
    If DateDiff("D", OldOutdate, Outdate) > 15 Then
        Indate = DateAdd("s", 33, Indate)
        txtIndate.Text = Indate
    End If
    Call GetCharge
End Sub
Function GetCharge()
Cmd.ActiveConnection = Cn
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "t_Countmoney_GZ"

Cmd("@ComeDate") = Indate
Cmd("@GoDate") = Outdate


Charge = 0
FreeTime = Text5.Text


If Combo1.Text = "小车" Then
    HourMax = 2.5
    Max = 7.5
    Cmd("@CardType") = "A"
ElseIf Combo1.Text = "大车" Then
    HourMax = 3.5
    Max = 10.5
    Cmd("@CardType") = "B"
ElseIf Combo1.Text = "摩托" Then
    HourMax = 2
    Max = 2
    Cmd("@CardType") = "C"
ElseIf Combo1.Text = "残疾人车" Then
    HourMax = 1
    Max = 1
    FreeTime = 3 * 60
    Cmd("@CardType") = "D"
Else
    MsgBox "请选择车类"
End If
Cmd.Execute
tCharge = Cmd("@FeeMoney")
Text1.Text = tCharge

StopTimeDay = DateDiff("d", Indate, Outdate)
StopTime = DateDiff("s", Format(Indate, "hh:mm:ss"), Format(Outdate, "hh:mm:ss"))
If StopTime < 0 Then
    StopTime = 86400 + StopTime
    StopTimeDay = StopTimeDay - 1
End If

TemLong = CLng(12) * CLng(3600)
If StopTimeDay > 0 Then
    Charge = StopTimeDay * Max * 2
    If StopTime > 0 Then
        If StopTime <= TemLong Then
            Charge = Charge + IIf((Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax > Max, Max, (Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax)
        Else
            Charge = Charge + Max
            StopTime = StopTime - TemLong
            Charge = Charge + IIf((Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax > Max, Max, (Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax)
        End If
    End If
Else
    If StopTime > FreeTime * 60 And StopTimeDay >= 0 Then
        
        If StopTime <= TemLong Then
            Charge = Charge + IIf((Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax > Max, Max, (Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax)
        Else
            Charge = Charge + Max
            StopTime = StopTime - TemLong
            Charge = Charge + IIf((Int(StopTime / 3600) + 1) * HourMax > Max, Max, (Int(StopTime / 3600) + IIf(StopTime Mod 3600 = 0, 0, 1)) * HourMax)
        End If
    End If
    
End If

GetCharge = Charge
If Charge <> tCharge Then
    MsgBox ("aa")
End If
Cmd.CommandText = "adderr"
Cmd("@ComeDate") = Indate
Cmd("@GoDate") = Outdate
Cmd("@feemoney") = tCharge
Cmd("@myfeemoney") = Charge
If Combo1.Text = "小车" Then
    Cmd("@CardType") = "A"
ElseIf Combo1.Text = "大车" Then
    Cmd("@CardType") = "B"
ElseIf Combo1.Text = "摩托" Then
    Cmd("@CardType") = "C"
ElseIf Combo1.Text = "残疾人车" Then
    
    Cmd("@CardType") = "D"
Else
    MsgBox "请选择车类"
End If

Cmd.Execute

'End If


Text6.Text = Charge
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -