Sub ListView1_ItemClick (Position As Int, Value As Object)
listpos = Position
CallSubDelayed(Me,listviewklick)
end sub
Sub listviewklick
ergebnis = InputList(actionlist,"Select:",0)
If ergebnis = 0 Then
identselect = listpos
StartActivity("edit")
End If
If ergebnis = 1 Then
If freeversion = False Then
identselect = ListView1.Size
newitem = True
StartActivity("edit")
Else
If ListView1.Size < 4 Then
identselect = ListView1.Size
newitem = True
StartActivity("edit")
Else
Marketlink
End If
End If
End If
If ergebnis = 2 Then
identselect = listpos
sql1.Initialize(File.DirInternal,"filemover.db",True)
sql2.Initialize(File.DirInternal,"interims.db",True)
sql2.ExecNonQuery("DROP TABLE IF EXISTS table1")
sql2.ExecNonQuery("CREATE TABLE table1 (nr INTEGER, identifier TEXT, source TEXT, target TEXT, copmov TEXT)")
' sql1.ExecNonQuery("DELETE FROM table1 WHERE nr = '" & identselect & "'")
Dim cursor1 As Cursor
cursor1 = sql1.ExecQuery("SELECT nr, identifier, source, target, copmov FROM table1")
If cursor1.RowCount > 0 Then
For i = 0 To cursor1.rowCount -1
cursor1.Position = i
cpident = cursor1.getstring("identifier")
cpsource = cursor1.GetString("source")
cptarget = cursor1.GetString("target")
cpnr = cursor1.GetInt("nr")
cpcopmov = cursor1.GetString("copmov")
If cursor1.Position <> identselect Then sql2.ExecNonQuery("INSERT INTO table1 VALUES(" & cpnr & ",'" & cpident & "','" & cpsource & "','" & cptarget & "','" & cpcopmov & "')")
Next
End If
File.Delete(File.DirInternal,"filemover.db")
File.Copy(File.DirInternal,"interims.db",File.DirInternal,"filemover.db")
cursor1.Close
sql1.close
sql2.close
auslesen
End If
End Sub