Sub Class_Globals
Type Inspection(InspectionId As Int, Title As String, Customer As String, Project As String, Order As String, OrderPos As String, Description As String, Notes As String, Name As String, State As String, City As String, Zip As String, Country As String, Latitude As String, Longitude As String, Address As String, IsGPSCoordinates As String, AppId As String, Date As Long)
End Sub
public Sub LoadAll(Filter As String)
If Filter="" Then
Filter="%"
Else
Filter="%" & Filter & "%"
End If
Dim List1 As List
List1.Initialize
Dim DB1 As DB
DB1.Initialize
Dim sql1 As SQL = DB1.Open
Dim rs As ResultSet = sql1.ExecQuery2("SELECT * FROM Inspection WHERE NAME LIKE ? ORDER BY NAME",Array As String(Filter))
Do While rs.NextRow
Dim Item11 As Inspection
Item11 = FromDB(rs)
List1.Add(Item11)
Loop
rs.Close
DB1.Close
Inspections = List1
End Sub
Sub FromDB(rs As ResultSet) As Inspection
'Log("FromDB")
Dim Item As Inspection
Item.Initialize
Item.InspectionId = rs.GetInt("InspectionId")
Item.Title = rs.GetString("Title")
Item.Description = rs.GetString("Description")
Item.Notes = rs.GetString("Notes")
Item.Customer = rs.GetString("Customer")
Item.Project = rs.GetString("Project")
Item.Order = rs.GetString("Order")
Item.OrderPos = rs.GetString("OrderPos")
Item.Name = rs.GetString("Name")
Item.Address = rs.GetString("Address")
Item.Zip = rs.GetString("Zip")
Item.City = rs.GetString("City")
Item.State = rs.GetString("State")
Item.Country = rs.GetString("Country")
Item.Latitude = rs.GetString("Latitude")
Item.Longitude = rs.GetString("Longitude")
Item.IsGPSCoordinates = rs.GetString("IsGPSCoordinates")
Item.Date = rs.GetLong("Date")
Item.AppId = rs.GetString("AppId")
Return Item
End Sub