Hello everyone, after years of absence I come back to make myself heard with a question that I hope can be solved, I have an old application for managing orders that uses a listview where I insert the products, for example: 1: pizza Margherita - Euro 6.50
these are then sent to the thermal printer, but once sent to the printer I would like to be able to save them perhaps in a sqlite database and be able to recall them for example always by loading them into the listview and I would like to be able to modify them by adding or removing the individual products loaded into the listview with the relative price.
I post the code that I use to send the order, considering that I insert the contents of the listview and all the other elements into a text box, see example.
How can I save this listview and reopen it whenever I want to edit its content?
I managed to save the text boxes that are in the order sending app but I don't understand how to save the listview and its content, I attach a code example to save the data of the text boxes.
these are then sent to the thermal printer, but once sent to the printer I would like to be able to save them perhaps in a sqlite database and be able to recall them for example always by loading them into the listview and I would like to be able to modify them by adding or removing the individual products loaded into the listview with the relative price.
I post the code that I use to send the order, considering that I insert the contents of the listview and all the other elements into a text box, see example.
B4X:
For i = 0 To lswordine2.Size -1
txtlswordine2.Text = txtlswordine2.Text & lswordine2.GetItem(i) & CRLF
Log("verifico cosa contiene txtlswordine2.text con switchstampante = 0 " & txtlswordine2.Text)
Next
I managed to save the text boxes that are in the order sending app but I don't understand how to save the listview and its content, I attach a code example to save the data of the text boxes.
B4X:
Dim NewID As Int
Try
NewID = SQL1.ExecQuerySingleResult("SELECT max(id) FROM listview ") + 1
Catch
NewID = 1
End Try
Dim qry As String
Dim MyFields() As Object
MyFields=Array As Object(txttavolo.Text,txtoperatore.Text,txteuro.Text,txttotaleeuro.Text ,txtnote.Text,NewID)
qry = "INSERT INTO listview VALUES (?,?,?,?,?,?)" 'Account for all fields
SQL1.ExecNonQuery2(qry,MyFields)
txteuro.Text=""
'txttotaleeuro.Text=""
txtnote.Text=""
Last edited: