Sub AddScaleRecs
' MHW return for now while testing other mods in production
'Return
Dim i As Int
Dim c As Cursor
Dim commands As List
commands.Initialize
If DefCM.Sql1.ExecQuerySingleResult("SELECT count(name) FROM sqlite_master WHERE type='table' AND name ='scalemast1'") = 0 Then
' do nothing cause no table built
Else
Try
c = DefCM.SQL1.ExecQuery("Select * from scalemast1 where sent = 0")
For i = 0 To c.RowCount -1
c.Position = i
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "scale_mast"
cmd.Parameters = Array As Object(c.GetLong("pk"),c.GetInt("loadtype"),c.GetInt("acttype"),c.GetLong("recdate"),c.GetInt("drvid"),c.GetString("trkid"),c.GetString("trl1id"),c.GetString("trl2id"),c.GetString("trl3id"),c.GetLong("gross"),c.GetLong("tare"),c.GetString("rectype"),c.GetDouble("lat"),c.GetDouble("lon"),c.GetString("place"),c.GetInt("compid"),c.GetInt("sent"),c.GetDouble("odom"),c.GetDouble("fuel"),c.GetString("sourceid"),c.GetString("swver"),c.GetString("comment"))
commands.Add(cmd)
Log("added SCALE mast rec: "&i)
Next
c.Close
If commands.Size > 0 Then
LogCM.reqManager.myloadmast = commands
LogCM.reqManager.mytagldmast = "scale_mast"
LogCM.reqManager.IsConnectedLoadmast
Else
' ToastMessageShow(" No Load Records to Send...",False)
End If
Catch
Log("Table ScaleMast doesn't exist")
If c.IsInitialized Then
c.Close
End If
End Try
End If
End Sub