![]() |
#2
黄某某某人2018-04-25 17:44
|
Public Function DecideVehicle() As Boolean
Dim bResult As Boolean = False
Dim oMT As New AWSvcMain.MTVehicle
Dim strOrderSQL As String = ""
strOrderSQL = "select MTVehicle.VehicleNo,* from MTVehicle where datediff(dd,EffectiveDate,getdate())=30"
Dim rs As ADODB.Recordset = G_objService.DB_ExecSelectSQL(strOrderSQL)
If rs.EOF = False Then
oMT.SetService(G_objService)
Dim strKey As String
Dim strSQL As String = ""
strSQL = "select * from MTVehicle where datediff(dd,EffectiveDate,getdate())>30"
Dim rs1 As ADODB.Recordset = G_objService.DB_ExecSelectSQL(strSQL)
Do Until rs1.EOF = True
strKey = rs1.Fields(0).Value
If oMT.LoadFromDB(strKey) = True Then
oMT.ValidFlag = 0
If oMT.SaveToDB() = True Then
bResult = True
End If
End If
rs1.MoveNext()
Loop
End If
Return bResult
End Function