Sub WriteToFavorite
HD.ProgressDialogShow("writing data")
Dim Cursor1 As ResultSet
If Not(File.Exists(File.DirDocuments,"My.db")) Then
File.Copy(File.DirAssets,"My.db",File.DirDocuments,"My.db")
End If
If SQL1.IsInitialized = False Then
SQL1.Initialize(File.DirDocuments,"My.db", False)
End If
Cursor1 = SQL1.ExecQuery("SELECT * FROM Favorite WHERE CustomerPhone='" & Main.CustomerPhone & "'")
If Cursor1.NextRow Then
HD.ToastMessageShow ("already exist",False)
Else
SQL1.ExecNonQuery("INSERT INTO Favorite (CustomerName, CustomerName2, City, Street, Number, AptNum, Floor, ContactPerson, CustomerPhone, Email, Lat, Lon) VALUES ('" & Main.CustomerName & "','" & Main.CustomerName2 & "','" & Main.City & "','" & Main.Street & "','" & Main.Number & "','" & Main.AptNum & "','" & Main.Floor1 & "','" & Main.ContactPerson & "','" & Main.CustomerPhone & "','" & Main.Email1 & "','" & Main.Lat & "','" & Main.Lon & "')")
End If
Register
End Sub