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

📄 frmtrc1.frm

📁 用VB6.0编写的关于车辆运输调度的系统
💻 FRM
📖 第 1 页 / 共 4 页
字号:

SavetruInfo = False

    
    If Text2.Text = "" Then
        Text2.Text = "0"
        ElseIf IsNumeric(Text2.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text3.Text = "" Then
        Text3.Text = "0"
        ElseIf IsNumeric(Text3.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text4.Text = "" Then
        Text4.Text = "0"
        ElseIf IsNumeric(Text4.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text5.Text = "" Then
        Text5.Text = "0"
        ElseIf IsNumeric(Text5.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text6.Text = "" Then
        Text6.Text = "0"
        ElseIf IsNumeric(Text6.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text7.Text = "" Then
        Text7.Text = "0"
        ElseIf IsNumeric(Text7.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text8.Text = "" Then
        Text8.Text = "0"
        ElseIf IsNumeric(Text8.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text9.Text = "" Then
        Text9.Text = "0"
        ElseIf IsNumeric(Text9.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text10.Text = "" Then
        Text10.Text = "0"
        ElseIf IsNumeric(Text10.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text11.Text = "" Then
        Text11.Text = "0"
        ElseIf IsNumeric(Text11.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text12.Text = "" Then
        Text12.Text = "0"
        ElseIf IsNumeric(Text12.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text13.Text = "" Then
        Text13.Text = "0"
        ElseIf IsNumeric(Text13.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text14.Text = "" Then
        Text14.Text = "0"
        ElseIf IsNumeric(Text14.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text15.Text = "" Then
        Text15.Text = "0"
        ElseIf IsNumeric(Text15.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text16.Text = "" Then
        Text16.Text = "0"
        ElseIf IsNumeric(Text16.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text17.Text = "" Then
        Text17.Text = "0"
        ElseIf IsNumeric(Text13.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text18.Text = "" Then
        Text18.Text = "0"
        ElseIf IsNumeric(Text18.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text19.Text = "" Then
        Text19.Text = "0"
        ElseIf IsNumeric(Text19.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text20.Text = "" Then
        Text20.Text = "0"
        ElseIf IsNumeric(Text20.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text21.Text = "" Then
        Text21.Text = "0"
        ElseIf IsNumeric(Text21.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    
    
flag = text1.Text <> "" And Text7.Text <> ""

If flag Then
        truckno = text1.Text
        inpdate = CLng(Text2.Text)
        brgdate = CLng(Text3.Text)
        enddate = CLng(Text4.Text)
        voldeli = CSng(Text5.Text)
        volbill = CSng(Text6.Text)
        volrest = CSng(Text7.Text)
        kilomet = CSng(Text8.Text)
        deltime = CLng(Text9.Text)
        btptime = CLng(Text10.Text)
        reftime = CLng(Text11.Text)
        wactime = CLng(Text12.Text)
        ishours = CLng(Text13.Text)
        orepare = CLng(Text14.Text)
        cusfill = CLng(Text15.Text)
        trips = CLng(Text16.Text)
        costcap = CSng(Text17.Text)
        fuelrmb = CSng(Text18.Text)
        tollrmb = CSng(Text19.Text)
        drvcost = CSng(Text20.Text)
        maicost = CSng(Text21.Text)
            
        sSQL = "select * from apptru where truckno ='" & truckno & "'and volrest = " & volrest & ""
        Set rsttru = Acs_cnt.Execute(sSQL)
        With rsttru
        If Not .EOF Then
            MsgBox "This Code is exist,please change the Stacode!", vbInformation, "Error"
            SavetruInfo = False
            Exit Function
        End If
        End With
        rsttru.Close
       Set rsttru = Nothing
       'truckno , inpdate, brgdate, enddate, voldeli, volbill, volrest, kilomet, deltime, btptime,
       'reftime, wactime, ishours, orepare, cusfill, trips, costcap, fuelrmb, tollrmb, drvcost, maicost
       sSQL = "insert into apptru (entcode,truckno , inpdate, brgdate, enddate, voldeli, volbill, volrest, kilomet, deltime, btptime, reftime, wactime, ishours, orepare, cusfill, trips, costcap, fuelrmb, tollrmb, drvcost, maicost)" & _
            "values (" & Entcode & ",'" & truckno & "'," & inpdate & "," & brgdate & "," & enddate & "," & voldeli & "," & volbill & "," & volrest & "," & kilomet & "," & deltime & "," & btptime & "," & reftime & "," & wactime & "," & ishours & _
            "," & orepare & "," & cusfill & "," & trips & "," & costcap & "," & fuelrmb & "," & tollrmb & "," & drvcost & "," & maicost & ")"
            
    Acs_cnt.Execute (sSQL)
    vastru.MaxRows = vastru.MaxRows + 1
     
    SetValue vastru, vastru.MaxRows, 1, truckno
    SetValue vastru, vastru.MaxRows, 2, inpdate
    SetValue vastru, vastru.MaxRows, 3, brgdate
    SetValue vastru, vastru.MaxRows, 4, enddate
    SetValue vastru, vastru.MaxRows, 5, voldeli
    SetValue vastru, vastru.MaxRows, 6, volbill
    SetValue vastru, vastru.MaxRows, 7, volrest
    SetValue vastru, vastru.MaxRows, 8, kilomet
    SetValue vastru, vastru.MaxRows, 9, deltime
    SetValue vastru, vastru.MaxRows, 10, btptime
    SetValue vastru, vastru.MaxRows, 11, reftime
    SetValue vastru, vastru.MaxRows, 12, wactime
    SetValue vastru, vastru.MaxRows, 13, ishours
    SetValue vastru, vastru.MaxRows, 14, orepare
    SetValue vastru, vastru.MaxRows, 15, cusfill
    SetValue vastru, vastru.MaxRows, 16, trips
    SetValue vastru, vastru.MaxRows, 17, costcap
    SetValue vastru, vastru.MaxRows, 19, tollrmb
    SetValue vastru, vastru.MaxRows, 20, drvcost
    SetValue vastru, vastru.MaxRows, 21, maicost

    Else
    MsgBox "One or Some items are wrong input!", vbExclamation, "Error"
    SavetruInfo = False
    End If
    SavetruInfo = True

End Function

Private Function trumodify() As Boolean
'Dim rsttru As Recordset
Dim sSQL As String
Dim Entcode, truckno As String
Dim inpdate, brgdate, enddate As Long
Dim voldeli, volbill, volrest, kilomet As Single
Dim deltime, btptime, reftime, wactime, ishours, orepare, cusfill, trips As Long
Dim costcap, fuelrmb, tollrmb, drvcost, maicost As Single
Dim lCurRow As Integer
Dim flag As Boolean

    trumodify = False
    
    If Text2.Text = "" Then
        Text2.Text = "0"
        ElseIf IsNumeric(Text2.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text3.Text = "" Then
        Text3.Text = "0"
        ElseIf IsNumeric(Text3.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text4.Text = "" Then
        Text4.Text = "0"
        ElseIf IsNumeric(Text4.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text5.Text = "" Then
        Text5.Text = "0"
        ElseIf IsNumeric(Text5.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text6.Text = "" Then
        Text6.Text = "0"
        ElseIf IsNumeric(Text6.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text7.Text = "" Then
        Text7.Text = "0"
        ElseIf IsNumeric(Text7.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text8.Text = "" Then
        Text8.Text = "0"
        ElseIf IsNumeric(Text8.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text9.Text = "" Then
        Text9.Text = "0"
        ElseIf IsNumeric(Text9.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text10.Text = "" Then
        Text10.Text = "0"
        ElseIf IsNumeric(Text10.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text11.Text = "" Then
        Text11.Text = "0"
        ElseIf IsNumeric(Text11.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text12.Text = "" Then
        Text12.Text = "0"
        ElseIf IsNumeric(Text12.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text13.Text = "" Then
        Text13.Text = "0"
        ElseIf IsNumeric(Text13.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text14.Text = "" Then
        Text14.Text = "0"
        ElseIf IsNumeric(Text14.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text15.Text = "" Then
        Text15.Text = "0"
        ElseIf IsNumeric(Text15.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text16.Text = "" Then
        Text16.Text = "0"
        ElseIf IsNumeric(Text16.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text17.Text = "" Then
        Text17.Text = "0"
        ElseIf IsNumeric(Text13.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text18.Text = "" Then
        Text18.Text = "0"
        ElseIf IsNumeric(Text18.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text19.Text = "" Then
        Text19.Text = "0"
        ElseIf IsNumeric(Text19.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text20.Text = "" Then
        Text20.Text = "0"
        ElseIf IsNumeric(Text20.Text) = False Then
        MsgBox "error"
        Exit Function
    End If
    If Text21.Text = "" Then
        Text21.Text = "0"
        ElseIf IsNumeric(Text21.Text) = False Then
        MsgBox "error"
        Exit Function
    End If

    flag = text1.Text = "" And Text7.Text <> ""
    If flag Then
 truckno = text1.Text
        inpdate = CLng(Text2.Text)
        brgdate = CLng(Text3.Text)
        enddate = CLng(Text4.Text)
        voldeli = CSng(Text5.Text)
        volbill = CSng(Text6.Text)
        volrest = CSng(Text7.Text)
        kilomet = CSng(Text8.Text)
        deltime = CLng(Text9.Text)
        btptime = CLng(Text10.Text)
        reftime = CLng(Text11.Text)
        wactime = CLng(Text12.Text)
        ishours = CLng(Text13.Text)
        orepare = CLng(Text14.Text)
        cusfill = CLng(Text15.Text)
        trips = CLng(Text16.Text)
        costcap = CSng(Text17.Text)
        fuelrmb = CSng(Text18.Text)
        tollrmb = CSng(Text19.Text)
        drvcost = CSng(Text20.Text)
        maicost = CSng(Text21.Text)
    Entcode = gsEntCode
    
    sSQL = "update apptru set truckno = '" & truckno & "',inpdate = " & inpdate & ",brgdate = " & brgdate & _
        ",enddate = " & enddate & ", voldeli = " & voldeli & ", volbill = " & volbill & ", volrest = " & volrest & _
        ",kilomet = " & kilomet & ", deltime = " & deltime & ", btptime = " & btptime & ", reftime = " & reftime & _
        ", wactime = " & wactime & ", ishours = " & ishours & ", orepare = " & orepare & ", cusfill = " & cusfill & _
        ",trips = " & trips & ", costcap = " & costcap & ", fuelrmb= " & fuelrmb & ", tollrmb = " & tollrmb & _
        ", drvcost= " & drvcost & ", maicost = " & maicost & ""
    
    Acs_cnt.Execute (sSQL)
    
    lCurRow = vastru.ActiveRow
    
    SetValue vastru, lCurRow, 1, truckno
    SetValue vastru, lCurRow, 2, inpdate
    SetValue vastru, lCurRow, 3, brgdate
    SetValue vastru, lCurRow, 4, enddate
    SetValue vastru, lCurRow, 5, voldeli
    SetValue vastru, lCurRow, 6, volbill
    SetValue vastru, lCurRow, 7, volrest
    SetValue vastru, lCurRow, 8, kilomet
    SetValue vastru, lCurRow, 9, deltime
    SetValue vastru, lCurRow, 10, btptime
    SetValue vastru, lCurRow, 11, reftime
    SetValue vastru, lCurRow, 12, wactime
    SetValue vastru, lCurRow, 13, ishours
    SetValue vastru, lCurRow, 14, orepare
    SetValue vastru, lCurRow, 15, cusfill
    SetValue vastru, lCurRow, 16, trips
    SetValue vastru, lCurRow, 17, costcap
    SetValue vastru, lCurRow, 18, fuelrmb
    SetValue vastru, lCurRow, 19, tollrmb
    SetValue vastru, lCurRow, 20, drvcost
    SetValue vastru, lCurRow, 21, maicost

    Else
    MsgBox "One or Some items are wrong input!", vbExclamation, "Error"
    trumodify = False
    Exit Function
    End If
    
    trumodify = True

End Function


Private Sub display()

SetColHead vastru, trudetail.voldeli, "Volume Delivered (TON)", 10
SetColHead vastru, trudetail.volbill, "Volume Billed (TON)", 10
SetColHead vastru, trudetail.volrest, "Volume Reskful (T)", 10
SetColHead vastru, trudetail.kilomet, "Kilometers (KM)", 10
SetColHead vastru, trudetail.deltime, "Delivery Time", 10
SetColHead vastru, trudetail.btptime, "Back to Plant Time", 10
SetColHead vastru, trudetail.reftime, "Refuel Time", 10
SetColHead vastru, trudetail.wactime, "Wait at Customer Time", 10
SetColHead vastru, trudetail.ishours, "In Service For Repare", 10
SetColHead vastru, trudetail.orepare, "Out Of Service For Repare", 15
SetColHead vastru, trudetail.cusfill, "Customer Fills", 10
SetColHead vastru, trudetail.trips, "Trips", 10
SetColHead vastru, trudetail.costcap, "Fuel Costs (RMB)", 10
SetColHead vastru, trudetail.fuelrmb, "Fuel Cost (RMB)", 10
SetColHead vastru, trudetail.tollrmb, "Toll Cost (RMB)", 10
SetColHead vastru, trudetail.drvcost, "Driver Cost (RMB)", 10
SetColHead vastru, trudetail.maicost, "Maintenance Cost (RMB)", 10

End Sub

⌨️ 快捷键说明

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