Sub btnprint_Click
mp1.Load(File.DirAssets,"click.wav")
mp1.Play
DateTime.DateFormat="dd/MM/yyyy"
DateTime.TimeFormat="HH.mm"
If txteuroparziale.Text="" Then
Else
End If
If connected Then
btncalcola_Click
contatore= contatore +1
txtcontatore.Text=contatore
TextWriter1.WriteLine("COMANDA" & " Numero: " & txtcontatore.Text & " - " & DateTime.Date (now) & " - ORE:" & DateTime.Time (now) & CRLF)
TextWriter1.WriteLine("Operatore: " & txtoperatore.Text & " - Tavolo: " & txttavolo.Text & CRLF)
TextWriter1.WriteLine(" " & lblm1.Text & " " & CRLF)
For i = 0 To lswordine2.Size -1
TextWriter1.WriteLine(lswordine2.GetItem(i) & CRLF)
Next
TextWriter1.WriteLine(" " & CRLF)
TextWriter1.WriteLine("===========================" & CRLF)
TextWriter1.WriteLine(" " & CRLF)
TextWriter1.WriteLine("COMANDA" & " Numero: " & txtcontatore.Text & " - " & DateTime.Date (now) & " - ORE:" & DateTime.Time (now) & CRLF)
TextWriter1.WriteLine("Operatore: " & txtoperatore.Text & " - Tavolo: " & txttavolo.Text & CRLF)
TextWriter1.WriteLine(" " & lblm2.Text & " " & CRLF)
For i = 0 To lswordine.Size -1
TextWriter1.WriteLine(lswordine.GetItem(i) & CRLF)
Next
TextWriter1.WriteLine(" Note: " & txtnote.Text & CRLF)
TextWriter1.WriteLine("TOTALE EURO: " & txttotaleeuro.Text & CRLF)
TextWriter1.WriteLine("id " & txttavolo.Text & CRLF) ' this code added after modify, before substring index ("TAvolo:") now substring ("id ")
TextWriter1.WriteLine(" ")
TextWriter1.WriteLine(" ")
TextWriter1.WriteLine(" ")
TextWriter1.Flush
End If
mnuDisconnect_Click
Msgbox("Comanda inviata","ESEGUITO")
Else
mp1.Load(File.DirAssets,"alert.wav")
mp1.Play
Msgbox("Attenzione connetti la stampante","STAMPANTE NON CONNESSA")
End If
End Sub