Spanish Como puedo hacer que cuando genere un nuevo ticket con el boton "Nuevo Pedido"

josue_acl

Member
Quiero poder guardar el archivo dentro del celular, que genere una carpeta o lo guarde en la tarjeta interna y que el nombre lleve un continuidad (ticket1, ticket2, ticket3,etc)


donde quiero ocupar:
Sub Process_Globals

    'These global variables will be declared once when the application starts.

    'These variables can be accessed from all modules.

    Private xui As XUI

End Sub


Sub Globals

    'These global variables will be redeclared each time the activity is created.

    Private TabHost1 As TabHost

    Private ScrollView1 As ScrollView

    Private ScrollView2 As ScrollView

    Private Button6 As Button

    Private ImageView1 As ImageView

    Private ImageView2 As ImageView

    Private ImageView3 As ImageView

    Private ImageView4 As ImageView

    Private ImageView6 As ImageView

    Private ImageView7 As ImageView

    Private Label1 As Label

    Private Label2 As Label

    Private Label3 As Label

    Private Label4 As Label

    Private Label5 As Label

    Private Label6 As Label

    Private Panel1 As Panel

    Private ButtonP As Button

    Private ButtonR As Button

    Private LabelC As Label

    Private LabelT As Label

    Private Panel2 As Panel

 

    Public p As Int = 0

    Public nE As Int = 0

    Public nT As Int = 0

    Public nP As Int = 0

    Public nC As Int = 0

    Public nCo As Int = 0

    Public nB As Int = 0

    Public Matrix(3) As Double

    Public LabelE As Label

    Public LabelB As Label

    Public LabelCo As Label

    Public LabelP As Label

    Public LabelTa As Label

    Private LabelTotal As Label

    Private Labeliva As Label

 

End Sub


Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("TB")

    TabHost1.AddTab("Menu","Scroll.bal")

    TabHost1.AddTab("Ticket","Scroll2.bal")

    ScrollView1.Panel.LoadLayout("Menu")

    ScrollView2.Panel.LoadLayout("Ticket")

    ScrollView1.Panel.Height=Panel1.Height

    ScrollView2.Panel.Height=Panel2.Height

 

 

End Sub


Sub Activity_Resume


End Sub


Sub Activity_Pause (UserClosed As Boolean)


End Sub


Private Sub ImageView7_Click

    nB = nB + 1

    'no es necesario colocar una sentencia condicional if, ya que cuando precionamos la imagen

    'sera por que queremos agregar un platillo, si agregamos

    xui.MsgboxAsync(nB , "Agregado")

End Sub


Private Sub ImageView6_Click

    nCo = nCo + 1

    xui.MsgboxAsync(nCo , "Agregado")

End Sub


Private Sub ImageView5_Click

    nC = nC + 1

    xui.MsgboxAsync(nC , "Agregado")

End Sub


Private Sub ImageView4_Click

    nP = nP + 1

    xui.MsgboxAsync(nP , "Agregado")

End Sub


Private Sub ImageView3_Click

    nT = nT + 1

    xui.MsgboxAsync(nT , "Agregado")

End Sub


Private Sub ImageView2_Click

    nE = nE + 1

    xui.MsgboxAsync(nE , "Agregado")

End Sub


Private Sub ImageView1_Click

 

End Sub


Private Sub Button6_Click

    ExitApplication

End Sub


'Private Sub ButtonR_Click
'esta parte fue de una publicacion preguntando pero no funciono
    'Try

    'File.WriteString(File.DirInternal, $"pedido_${Ticket}.txt"$, "muchos pedidos")

        'Log("Escribiendo")

    'Catch

        'Log("Error al escribir")

    'End Try

    nE = 0

    nT = 0

    nP = 0

    nC = 0

    nCo = 0

    nB = 0

    LabelE.Text = ""

    LabelTa.Text = ""

    LabelP.Text = ""

    LabelC.Text = ""

    LabelCo.Text = ""

    LabelB.Text = ""

        LabelTotal.Text = ""

    Labeliva.Text = ""

End Sub


'Private Sub Ticket As Int
'esta parte fue de una publicacion preguntando pero no funciono

    'Return File.ListFiles(File.DirInternal).Size

'End Sub


Private Sub ButtonP_Click

    Public Te As Int

    Public Tt As Int

    Public Tp As Int

    Public Tc As Int

    Public Tco As Int

    Public Tb As Int

    Public Total As Int

    Public Total_Iva As Float

 

    Te = 30 * nE

    If Te > 0 Then

        LabelE.Text=nE & "    Enchiladas ="&Te

        Else

            LabelE.Text = ""

    End If

 

    Tt = 25 * nT

    If Tt > 0 Then

        LabelTa.Text=nT & "    Tacos Dorados ="&Tt

    Else

        LabelTa.Text = ""

    End If

 

    Tp = 50 * nP

    If Tp > 0 Then

        LabelP.Text=nP & "    Pescado ="&Tp

    Else

        LabelP.Text = ""

    End If


    Tc = 60 * nC

    If Tc > 0 Then

        LabelC.Text=nC & "    Camarones ="&Tc

    Else

        LabelC.Text = ""

    End If

 

    Tco = 15 * nCo

    If Tco > 0 Then

        LabelCo.Text=nCo & "    Coca-Cola ="&Tco

    Else

        LabelCo.Text = ""

    End If

 

    Tb = 15 * nB

    If Tb > 0 Then

        LabelB.Text=nB & "    Boing ="&Tb

    Else

        LabelB.Text = ""

    End If

 

    Total=Te+Tt+Tp+Tc+Tco+Tb

    Total_Iva=Total*1.6

 

    If Total > 0 Then

        LabelTotal.Text="Total sin IVA es  "&Total

        Labeliva.Text="Total con IVA es  "&Total_Iva

        Else

            LabelTotal.Text=""

    

    End If

 

 

End Sub
 
Top