Commit inicial de Java

This commit is contained in:
2024-03-21 16:41:00 -06:00
parent 866dbd2494
commit a3b4c2fc77
27 changed files with 2725 additions and 0 deletions

24
B4J/C_Principal.bas Normal file
View File

@@ -0,0 +1,24 @@
B4J=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=10
@EndOfDesignText@
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

272
B4J/DBRequestManager.bas Normal file
View File

@@ -0,0 +1,272 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=6.8
@EndOfDesignText@
'Class module
' Requiere RandomAccessFile, CompressStrings, ByteConverter y OkhttpUtils2
Sub Class_Globals
Private mTarget As Object
Type DBResult (Tag As Object, Columns As Map, Rows As List)
Type DBCommand (Name As String, Parameters() As Object)
Private link As String
Private bc As ByteConverter
Private T_NULL = 0, T_STRING = 1, T_SHORT = 2, T_INT = 3, T_LONG = 4, T_FLOAT = 5 _
,T_DOUBLE = 6, T_BOOLEAN = 7, T_BLOB = 8 As Byte
Private VERSION As Float = 0.9
Private tempArray(1) As Object
Dim jobTagAnterior As String = "" 'Mod por CHV - 211109
End Sub
'Target - The module that handles JobDone (usually Me).
'ConnectorLink - URL of the Java server.
Public Sub Initialize (Target As Object, ConnectorLink As String)
mTarget = Target
link = ConnectorLink
End Sub
'Sends a query request.
'Command - Query name and parameters.
'Limit - Maximum rows to return or 0 for no limit.
'Tag - An object that will be returned in the result.
'Timeout - The http request timeout in ms, or 0 if default (30 secs)
Public Sub ExecuteQuery(Command As DBCommand, Limit As Int, Tag As Object, Timeout As Int) 'Mod por CHV, agregué el parametro Timeout - 211229
Dim j As HttpJob
Dim ms As OutputStream
Dim out2 As OutputStream = StartJob(j,ms, Tag)
WriteObject(Command.Name, out2)
WriteInt(Limit, out2)
WriteList(Command.Parameters, out2)
out2.Close
j.PostBytes(link & "?method=query", ms.ToBytesArray)
If Timeout <> 0 Then j.GetRequest.Timeout = Timeout
End Sub
'Executes a batch of (non-select) commands.
'ListOfCommands - List of the commands that will be executes.
'Tag - An object that will be returned in the result.
Public Sub ExecuteBatch(ListOfCommands As List, Tag As Object)
Dim j As HttpJob
Dim ms As OutputStream
Dim out2 As OutputStream = StartJob(j,ms, Tag)
WriteInt(ListOfCommands.Size, out2)
For Each Command As DBCommand In ListOfCommands
WriteObject(Command.Name, out2)
WriteList(Command.Parameters, out2)
Next
out2.Close
j.PostBytes(link & "?method=batch", ms.ToBytesArray)
End Sub
'Similar to ExecuteBatch. Sends a single command.
Public Sub ExecuteCommand(Command As DBCommand, Tag As Object)
ExecuteBatch(Array As DBCommand(Command), Tag)
End Sub
Private Sub StartJob(j As HttpJob, MemoryStream As OutputStream, Tag As Object) As OutputStream
j.Initialize("DBRequest", mTarget)
j.Tag = Tag
MemoryStream.InitializeToBytesArray(0)
Dim compress As CompressedStreams
Dim out As OutputStream = compress.WrapOutputStream(MemoryStream, "gzip")
WriteObject(VERSION, out)
Return out
End Sub
Private Sub WriteList(Parameters As List, out As OutputStream)
Dim data() As Byte
If Parameters = Null Or Parameters.IsInitialized = False Then
Dim Parameters As List
Parameters.Initialize
End If
data = bc.IntsToBytes(Array As Int(Parameters.Size))
out.WriteBytes(data, 0, data.Length)
For Each o As Object In Parameters
WriteObject(o, out)
Next
End Sub
Private Sub WriteObject(o As Object, out As OutputStream)
Dim data() As Byte
tempArray(0) = o
If tempArray(0) = Null Then
out.WriteBytes(Array As Byte(T_NULL), 0, 1)
Else If tempArray(0) Is Short Then
out.WriteBytes(Array As Byte(T_SHORT), 0, 1)
data = bc.ShortsToBytes(Array As Short(o))
Else If tempArray(0) Is Int Then
out.WriteBytes(Array As Byte(T_INT), 0, 1)
data = bc.IntsToBytes(Array As Int(o))
Else If tempArray(0) Is Float Then
out.WriteBytes(Array As Byte(T_FLOAT), 0, 1)
data = bc.FloatsToBytes(Array As Float(o))
Else If tempArray(0) Is Double Then
out.WriteBytes(Array As Byte(T_DOUBLE), 0, 1)
data = bc.DoublesToBytes(Array As Double(o))
Else If tempArray(0) Is Long Then
out.WriteBytes(Array As Byte(T_LONG), 0, 1)
data = bc.LongsToBytes(Array As Long(o))
Else If tempArray(0) Is Boolean Then
out.WriteBytes(Array As Byte(T_BOOLEAN), 0, 1)
Dim b As Boolean = 0
Dim data(1) As Byte
If b Then data(0) = 1 Else data(0) = 0
Else If GetType(tempArray(0)) = "[B" Then
data = o
out.WriteBytes(Array As Byte(T_BLOB), 0, 1)
WriteInt(data.Length, out)
Else 'If o Is String Then (treat all other values as string)
out.WriteBytes(Array As Byte(T_STRING), 0, 1)
data = bc.StringToBytes(o, "UTF8")
WriteInt(data.Length, out)
End If
If data.Length > 0 Then out.WriteBytes(data, 0, data.Length)
End Sub
Private Sub ReadObject(In As InputStream) As Object
Dim data(1) As Byte
In.ReadBytes(data, 0, 1)
Select data(0)
Case T_NULL
Return Null
Case T_SHORT
Dim data(2) As Byte
Return bc.ShortsFromBytes(ReadBytesFully(In, data, data.Length))(0)
Case T_INT
Dim data(4) As Byte
Return bc.IntsFromBytes(ReadBytesFully(In, data, data.Length))(0)
Case T_LONG
Dim data(8) As Byte
Return bc.LongsFromBytes(ReadBytesFully(In, data, data.Length))(0)
Case T_FLOAT
Dim data(4) As Byte
Return bc.FloatsFromBytes(ReadBytesFully(In, data, data.Length))(0)
Case T_DOUBLE
Dim data(8) As Byte
Return bc.DoublesFromBytes(ReadBytesFully(In, data, data.Length))(0)
Case T_BOOLEAN
Dim b As Byte = ReadByte(In)
Return b = 1
Case T_BLOB
Dim len As Int = ReadInt(In)
Dim data(len) As Byte
Return ReadBytesFully(In, data, data.Length)
Case Else
Dim len As Int = ReadInt(In)
Dim data(len) As Byte
ReadBytesFully(In, data, data.Length)
Return BytesToString(data, 0, data.Length, "UTF8")
End Select
End Sub
Private Sub ReadBytesFully(In As InputStream, Data() As Byte, Len As Int) As Byte()
Dim count = 0, read As Int
Do While count < Len And read > -1
read = In.ReadBytes(Data, count, Len - count)
count = count + read
Loop
Return Data
End Sub
Private Sub WriteInt(i As Int, out As OutputStream)
Dim data() As Byte
data = bc.IntsToBytes(Array As Int(i))
out.WriteBytes(data, 0, data.Length)
End Sub
Private Sub ReadInt(In As InputStream) As Int
Dim data(4) As Byte
Return bc.IntsFromBytes(ReadBytesFully(In, data, data.Length))(0)
End Sub
Private Sub ReadByte(In As InputStream) As Byte
Dim data(1) As Byte
In.ReadBytes(data, 0, 1)
Return data(0)
End Sub
'Handles the Job result and returns a DBResult.
Public Sub HandleJob(Job As HttpJob) As DBResult
Dim start As Long = DateTime.Now 'ignore
Dim In As InputStream = Job.GetInputStream
Dim cs As CompressedStreams
In = cs.WrapInputStream(In, "gzip")
Dim serverVersion As Float = ReadObject(In) 'ignore
Dim method As String = ReadObject(In)
Dim table As DBResult
table.Initialize
table.Columns.Initialize
table.rows.Initialize
table.Tag = Job.Tag
If jobTagAnterior <> Job.Tag Then Log("HandleJob: '"&Job.Tag&"'") 'Mod por CHV - 211109
jobTagAnterior = Job.Tag 'Mod por CHV - 211109
If method = "query" Then
Dim numberOfColumns As Int = ReadInt(In)
For i = 0 To numberOfColumns - 1
table.Columns.Put(ReadObject(In), i)
Next
Do While ReadByte(In) = 1
Dim rowObjects(numberOfColumns) As Object
table.rows.Add(rowObjects)
For col = 0 To numberOfColumns - 1
Dim o As Object = ReadObject(In)
rowObjects(col) = o
Next
Loop
Else If method = "batch" Then
table.Columns.Put("AffectedRows", 0)
Dim rows As Int = ReadInt(In)
For i = 0 To rows - 1
table.rows.Add(Array As Object(ReadInt(In)))
Next
End If
In.Close
' Log("HandleJob: " & (DateTime.Now - start))'Comentado por CHV - 211112
Return table
End Sub
'Reads a file and returns the file as a bytes array.
Public Sub FileToBytes(Dir As String, FileName As String) As Byte()
Dim out As OutputStream
out.InitializeToBytesArray(0)
Dim In As InputStream = File.OpenInput(Dir, FileName)
File.Copy2(In, out)
out.Close
Return out.ToBytesArray
End Sub
'Converts an image to a bytes array (for BLOB fields).
'Public Sub ImageToBytes(Image As Bitmap) As Byte()
' Dim out As OutputStream
' out.InitializeToBytesArray(0)
' Image.WriteToStream(out, 100, "JPEG")
' out.Close
' Return out.ToBytesArray
'End Sub
''Converts a bytes array to an image (for BLOB fields).
'Public Sub BytesToImage(bytes() As Byte) As Bitmap
' Dim In As InputStream
' In.InitializeFromBytesArray(bytes, 0, bytes.Length)
' Dim bmp As Bitmap
' bmp.Initialize2(In)
' Return bmp
'End Sub
'Prints the table to the logs.
Public Sub PrintTable(Table As DBResult)
Log("Tag: " & Table.Tag & ", Columns: " & Table.Columns.Size & ", Rows: " & Table.Rows.Size)
Dim sb As StringBuilder
sb.Initialize
For Each col In Table.Columns.Keys
sb.Append(col).Append(TAB)
Next
Log(sb.ToString)
For Each row() As Object In Table.Rows
Dim sb As StringBuilder
sb.Initialize
For Each record As Object In row
sb.Append(record).Append(TAB)
Next
' ToastMessageShow(sb.ToString, True)
Next
End Sub

BIN
B4J/Files/MainPage.bjl Normal file

Binary file not shown.

BIN
B4J/Files/candado.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
B4J/Files/engrane.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
B4J/Files/engranes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
B4J/Files/errorLog.db Normal file

Binary file not shown.

BIN
B4J/Files/kmt.db Normal file

Binary file not shown.

BIN
B4J/Files/login.bjl Normal file

Binary file not shown.

BIN
B4J/Files/logolanter.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
B4J/Files/logolanter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
B4J/Files/logolanter2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
B4J/Files/mesasItem.bjl Normal file

Binary file not shown.

BIN
B4J/Files/usuario.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

1566
B4J/Subs.bas Normal file

File diff suppressed because it is too large Load Diff

100
B4J/lanterna.b4j Normal file
View File

@@ -0,0 +1,100 @@
AppType=JavaFX
Build1=Default,b4j.example
File1=candado.png
File10=logolanter_192x192.png
File11=logolanter2.bmp
File12=logolanternegro.bmp
File13=logolanternegro.png
File14=logolanternegro2.bmp
File15=MainPage.bjl
File16=mesasItem.bjl
File17=usuario.png
File2=engrane.png
File3=engrane_fondoblanco.png
File4=engranes.png
File5=errorLog.db
File6=kmt.db
File7=login.bjl
File8=logolanter.bmp
File9=logolanter.png
FileGroup1=Default Group
FileGroup10=Default Group
FileGroup11=Default Group
FileGroup12=Default Group
FileGroup13=Default Group
FileGroup14=Default Group
FileGroup15=New Group
FileGroup16=Default Group
FileGroup17=Default Group
FileGroup2=Default Group
FileGroup3=Default Group
FileGroup4=Default Group
FileGroup5=Default Group
FileGroup6=Default Group
FileGroup7=Default Group
FileGroup8=Default Group
FileGroup9=Default Group
Group=Default Group
Library1=b4xpages
Library10=jstringutils
Library11=wobblemenu
Library12=xcustomlistview
Library2=byteconverter
Library3=compressstrings
Library4=jcore
Library5=jfx
Library6=jokhttputils2
Library7=jrandomaccessfile
Library8=json
Library9=jsql
Module1=|relative|..\B4XMainPage
Module2=C_Principal
Module3=DBRequestManager
Module4=Subs
NumberOfFiles=17
NumberOfLibraries=12
NumberOfModules=4
Version=10
@EndOfDesignText@
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#AdditionalJar: sqlite-jdbc-3.7.2.jar
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
' Log(MainForm.Width)
MainForm.Show
Dim PagesManager As B4XPagesManager
PagesManager.Initialize(MainForm)
End Sub
'Template version: B4J-1.0
#Region Delegates
Sub MainForm_FocusChanged (HasFocus As Boolean)
B4XPages.Delegate.MainForm_FocusChanged(HasFocus)
End Sub
Sub MainForm_Resize (Width As Double, Height As Double)
B4XPages.Delegate.MainForm_Resize(Width, Height)
End Sub
Sub MainForm_Closed
B4XPages.Delegate.MainForm_Closed
End Sub
Sub MainForm_CloseRequest (EventData As Event)
B4XPages.Delegate.MainForm_CloseRequest(EventData)
End Sub
Public Sub MainForm_IconifiedChanged (Iconified As Boolean)
B4XPages.Delegate.MainForm_IconifiedChanged(Iconified)
End Sub
#End Region

18
B4J/lanterna.b4j.meta Normal file
View File

@@ -0,0 +1,18 @@
ModuleBookmarks0=
ModuleBookmarks1=
ModuleBookmarks2=
ModuleBookmarks3=
ModuleBookmarks4=
ModuleBreakpoints0=
ModuleBreakpoints1=
ModuleBreakpoints2=
ModuleBreakpoints3=
ModuleBreakpoints4=
ModuleClosedNodes0=
ModuleClosedNodes1=40,41
ModuleClosedNodes2=
ModuleClosedNodes3=
ModuleClosedNodes4=
NavigationStack=Main,Process_Globals,8,0,B4XMainPage,b_cerrarApp_Click,620,0,B4XMainPage,Class_Globals,96,0,Subs,revisaMaxPromosProdsFijosPorInventario2,1008,0,Visual Designer,login.bjl,-100,6,B4XMainPage,b_cerrarCerrar_Click,651,0,B4XMainPage,b_abrirMesa_Click,586,0,B4XMainPage,lv_categorias_MouseClicked,607,0,B4XMainPage,lv_categorias_SelectedIndexChanged,605,6,B4XMainPage,llenaProdsLL,530,0,B4XMainPage,p_mesasItem_MouseClicked,524,0
SelectedBuild=0
VisibleModules=1,4,2,3

9
B4J/lanterna.meta Normal file
View File

@@ -0,0 +1,9 @@
ModuleBookmarks0=
ModuleBookmarks1=
ModuleBreakpoints0=
ModuleBreakpoints1=
ModuleClosedNodes0=1,4
ModuleClosedNodes1=1
NavigationStack=Main,MainForm_IconifiedChanged,37,0,Main,AppStart,14,6,B4XMainPage,Button1_Click,19,0,B4XMainPage,Initialize,9,0,B4XMainPage,B4XPage_Created,18,0,B4XMainPage,Class_Globals,7,0
SelectedBuild=0
VisibleModules=1

681
B4XMainPage.bas Normal file
View File

@@ -0,0 +1,681 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=9.85
@EndOfDesignText@
#Region Shared Files
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
'###########################################################################################################
'###################### PULL #############################################################
'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=git&Args=pull
'###########################################################################################################
'###################### PUSH #############################################################
'Ctrl + click ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=github&Args=..\..\
'###########################################################################################################
'###################### PUSH TORTOISE GIT #########################################################
'Ctrl + click ide://run?file=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe&Args=TortoiseGitProc&Args=/command:commit&Args=/path:"./../../"&Args=/closeonend:2
'###########################################################################################################
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Public login As B4XMainPage
Public principal As C_Principal
Private i_logo As ImageView
Private p_configuracion As Pane
Private p_login As Pane
Private b_regresar As Button
Private b_entrar As Button
Private b_envioBD As Button
Private b_server As Button
Private ImageView4 As ImageView
Private ImageView2 As ImageView
Private Panel3 As Pane
Private Label1 As Label
Private i_conf As B4XView
' Private i_conf As ImageView
Private b_cargaProductos As Button
Private ListView1 As ListView
Private E_SERVER As TextField
Dim reqManager As DBRequestManager
Private l_version As Label
Private p_botones As Pane
Private Label3 As Label
Private p_server As Pane
Dim atrasPresionado As Boolean = False
Dim skmt As SQL
Dim DBReqServer As String = "http://keymon.lat:1782"
Dim logger As Boolean = True
Dim ticketActual, mesaActual, meseroActual, comensalesActuales, totalActual As String
Private i_password As ImageView
Private pass As TextField
Private user As TextField
Private i_usuario As ImageView
Private Panel1 As Pane
Private Panel2 As Pane
Private lv_server As ListView
Private p_conf2 As Pane
Private WobbleMenu1 As WobbleMenu
Private p_mesas As Pane
Private clv_mesas As CustomListView
Private l_mesas As Label
Private p_mesas2 As Pane
Dim listaProds, listaHints, listaHintsM, list_prodsPedido As List
Dim listaFormasDePagoCB, listaFormaDePago, listaMontoDePago, listaTickets As List
Dim fx As JFX
Dim reiniciarlistaProds As Boolean = False 'ignore
Private p_mesasItem As Pane
Private l_estatus As Label
Private l_mesaX As Label
Dim formasDePago As Int = 1
Dim tipoPago As String = "VENTA"
Dim nivelActual As String = "VENTA"
Private lv_categorias As ListView
Private p_mesa As Pane
Private p_renombraVarios As Pane
Private l_mesa As Label
Private b_abrirMesa As Button
Private p_mesaCampos As Pane
Private p_mesaAbierta As Pane
Private l_comensalesAbierta As Label
Private l_meseroAbierta As Label
Private l_comensalesAbierta2 As Label
Private l_meseroAbierta2 As Label
Private b_mesaEditar As Button
Private clv_prods_ll As CustomListView
Private p_botonesProds As Pane
Private b_mesaCerrar As Button
Private b_imprimirTicket As Button
Private b_regresarProds As Button
Private cb_comensales As ComboBox
Private cb_mesero As ComboBox
Private b_back As Button
Private p_mesa2 As Pane
Private p_cerrarApp As Pane
Private b_cerrarApp As Button
Private l_cerrarApp As Label
Private p_cerrarApp As Pane
Private b_cerrarApp As Button
Private b_cerrarCerrar As Button
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
B4XPages.GetManager.LogEvents = True
If Not(File.Exists(File.DirApp, "kmt.db")) Then
File.Copy(File.DirAssets, "kmt.db", File.DirApp, "kmt.db")
Log("copiamos kmt.db de "&File.DirAssets & " a " & File.DirApp)
End If
If Not(skmt.IsInitialized) Then
skmt.InitializeSQLite(File.DirApp, "kmt.db", True)
End If
Subs.revisaBD
Root = Root1
Root.LoadLayout("login")
login.Initialize
B4XPages.AddPage("Login", login)
principal.Initialize
B4XPages.AddPage("Principal", principal)
Subs.agregaColumna("cat_gunaprod", "CAT_PT_DESC", "TEXT")
Subs.agregaColumna("cat_gunaprod", "CAT_PS_DESC", "TEXT")
Subs.agregaColumna("cat_gunaprod", "CAT_PS_DESC", "TEXT")
Subs.agregaColumna("cat_gunaprod", "CAT_GP_FECHA", "TEXT")
Subs.agregaColumna("cat_gunaprod", "CAT_GP_FECHA_MOD", "TEXT")
skmt.ExecNonQuery("delete from cuentaa")
skmt.ExecNonQuery("insert into cuentaa (cuenta) values ('123456')")
skmt.ExecNonQuery("delete from cat_almacen")
skmt.ExecNonQuery("insert into cat_almacen (id_almacen) values ('1')")
l_version.Text = "3.03.13" 'Application.VersionName
' p_configuracion.Height = Root.Height : p_configuracion.width = Root.width
cb_comensales.Items.AddAll(Array As String(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20))
cb_mesero.Items.AddAll(Subs.traeMeserosLista)
reqManager.Initialize(Me, DBReqServer)
' Subs.centraEtiqueta(Label3, p_configuracion.Width)
' Subs.centraPanel(p_server, p_configuracion.Width)
' Subs.centraPanel(p_botones, p_configuracion.Width)
i_logo.Left = (Root.Width / 2) - (i_logo.Width / 2)
' Subs.centraPanel(Panel3, p_configuracion.Width)
Private x As ResultSet = skmt.ExecQuery($"select * from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'DESCUENTO X EFECTIVO'"$)
' Log(x.IsInitialized)
If Not(x.IsInitialized) Then 'Insertamos el descuento para efectivo por default.
skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("DESCUENTO X EFECTIVO","10"))
End If
Subs.centraImagen(i_logo, Root.Width)
Subs.centraPanel(Panel3, Root.Width)
i_conf.Left = Root.Width - 100dip
p_login.SetSize(Root.Width, Root.Height)
Subs.centraPanel(p_conf2, Root.Width)
p_mesas.Top = 0 : p_mesas.left = 0 : p_mesas.SetSize(Root.Width, Root.Height)
WobbleMenu1.SetVisible(False, False)
b_back.Visible = False
End Sub
Private Sub B4XPage_CloseRequest As ResumableSub
' BACK key pressed
'Return True to close, False to cancel
Log("BACK")
' If p_mesa.Visible Then
' p_mesa.Visible = False
' p_mesas.Visible = True
' Else If p_mesas.Visible Then
' p_mesas.Visible = False
' b_back.Visible = False
' else if p_configuracion.Visible Then
' p_configuracion.Visible = False
' Return False
' Else
Subs.centraPanel(p_cerrarApp, Root.Width)
p_cerrarApp.Visible = True
' If atrasPresionado Then ExitApplication 'Solo salimos de la aplicación si se presiona 'Atras' 2 veces seguidas.
atrasPresionado = True
' End If
Return False
End Sub
Sub B4XPage_Resize (Width As Double, Height As Double)
' Log($"${Width}|${Height}"$)
p_configuracion.Top = 0 : p_configuracion.left = 0
p_login.Top = 0 : p_login.left = 0
p_login.SetSize(Width, Height)
p_configuracion.SetSize(Width, Height)
p_mesas.SetSize(Width, Height)
Subs.centraPanel(Panel3, Root.Width)
Subs.muestraPane(p_mesa, Root)
Subs.muestraPane(p_mesas, Root)
Subs.centraPanel(p_mesas2, Root.Width)
Subs.centraPanel(p_mesa2, Width)
Subs.centraImagen(i_logo, Root.Width)
i_conf.Left = Root.Width - 100dip
Subs.centraPanel(p_conf2, Root.Width)
' p_login.PrefWidth = Root.Width
' p_login.SetSize(Width, Height)
' p_login.prefHeight = Root.Height
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub i_logo_Click
End Sub
Private Sub b_regresar_Click
p_configuracion.Visible = False
' Subs.panelVisible(p_login, 0, 0)
p_login.Visible = True
End Sub
Private Sub b_entrar_Click
' B4XPages.ShowPage("principal")
' Log(3)
b_back.Visible = True
Subs.centraPanel(p_mesas2, Root.Width)
p_mesas.Visible = True
Subs.muestraPane(p_mesas, Root)
LlenaMesas(Null, Null)
End Sub
Private Sub b_server_Click
If E_SERVER.Text <> "" Then
DBReqServer = E_SERVER.text
skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER"))
skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER", DBReqServer))
p_configuracion.Visible = False
reqManager.Initialize(Me, DBReqServer)
reqManager.Initialize(Me, DBReqServer)
p_configuracion.Visible = False
p_login.Visible = True
Else
' ToastMessageShow("Por favor ingrese la direccion del servidor", True)
End If
End Sub
Private Sub b_envioBD_Click
End Sub
Private Sub i_conf_Click
' ListView1.clear
Dim Label1 As Label
' Label1 = ListView1.SingleLineLayout.Label
' Label1 = ListView1.
' Label1.TextSize = 20
' Label1.TextColor = Colors.Black
' ListView1.AddSingleLine("http://keymon.lat:1782")
' p_configuracion.Width = Root.Width
' p_configuracion.Height = Root.Height
' p_configuracion.BringToFront
' Subs.panelVisible(p_configuracion, 0, 0)
End Sub
Private Sub b_cargaProductos_Click
Log(DBReqServer)
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "selectProds_Lanter"
reqManager.ExecuteQuery(cmd , 0, "selectProds", 0)
cmd.Initialize
cmd.Name = "selectMesas_Lanter"
reqManager.ExecuteQuery(cmd , 0, "selectMesas", 0)
cmd.Initialize
cmd.Name = "selectMeseros_Lanter"
reqManager.ExecuteQuery(cmd , 0, "selectMeseros", 0)
End Sub
Private Sub ListView1_ItemClick (Position As Int, Value As Object)
DBReqServer = Value
E_SERVER.Text = Value
End Sub
Sub JobDone(Job As HttpJob)
Log("JOBDONE MAINPAGE")
If Job.Tag.As(String).StartsWith("_KMS_") Then Job.tag = Job.Tag.As(String).SubString(16)
If Job.Success = False Then
' ToastMessageShow("Error: " & Job.ErrorMessage, True)
Else
If logger Then Log("JobDone: '" & reqManager.HandleJob(Job).tag & "' - Registros: " & reqManager.HandleJob(Job).Rows.Size) 'Mod por CHV - 211110
If Job.JobName = "DBRequest" Then
Dim result As DBResult = reqManager.HandleJob(Job)
If result.Tag = "selectProds" Then 'query tag
skmt.ExecNonQuery("delete from cat_gunaprod")
skmt.BeginTransaction
For Each records() As Object In result.Rows
Dim CAT_GP_ID As String = records(result.Columns.Get("CAT_GP_ID"))
Dim CAT_GP_NOMBRE As String = records(result.Columns.Get("CAT_GP_NOMBRE"))
Dim CAT_GP_PRECIO As String = records(result.Columns.Get("CAT_GP_PRECIO"))
Dim CAT_GP_ALMACEN As String = 10000 'records(result.Columns.Get("CAT_GP_ALMACEN"))
Dim CAT_GP_IMG() As Byte = records(result.Columns.Get("CAT_GP_IMG"))
Dim CAT_GP_FECHA As String = records(result.Columns.Get("CAT_GP_FECHA"))
Dim CAT_GP_FECHA_MOD As String = records(result.Columns.Get("CAT_GP_FECHA_MOD"))
Dim CAT_GP_CLASIF As String = records(result.Columns.Get("CAT_GP_CLASIF"))
skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD, CAT_GP_CLASIF) VALUES (?,?,?,?,?,?,?,?)", Array As Object (CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD,CAT_GP_CLASIF))
Next
For v = 1 To 20 'Agregamos productos varios (editables)
skmt.ExecNonQuery2("INSERT INTO CAT_GUNAPROD(CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_PRECIO,CAT_GP_ALMACEN,CAT_GP_IMG,CAT_GP_FECHA,CAT_GP_FECHA_MOD, CAT_GP_CLASIF) VALUES (?,?,?,?,?,?,?,?)", Array As Object ($"VAR${NumberFormat2(v, 2, 0, 0, False)}"$,$"Alimentos Varios ${NumberFormat2(v, 2, 0, 0, False)}"$,"1","10000",Null,"2024-02-04 17:00:00","2024-02-04 17:00:00","Varios"))
Next
skmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!!
End If
If result.Tag = "selectMesas" Then 'query tag
skmt.ExecNonQuery("delete from CAT_MESAS")
skmt.BeginTransaction
For Each records() As Object In result.Rows
Dim M_ID As String = records(result.Columns.Get("M_ID"))
Dim M_NOMBRE As String = records(result.Columns.Get("M_NOMBRE"))
Dim M_NUMERO As String = records(result.Columns.Get("M_NUMERO"))
Dim M_ZONA As String = records(result.Columns.Get("M_ZONA"))
skmt.ExecNonQuery2("INSERT INTO CAT_MESAS(M_ID, M_NUMERO, M_NOMBRE, M_ZONA) VALUES (?,?,?,?)", Array As Object (M_ID, M_NUMERO, M_NOMBRE, M_ZONA))
Next
skmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!!
End If
If result.Tag = "selectMeseros" Then 'query tag
skmt.ExecNonQuery("delete from CAT_MESEROS")
skmt.BeginTransaction
For Each records() As Object In result.Rows
Dim MS_ID As String = records(result.Columns.Get("MS_ID"))
Dim MS_NOMBRE As String = records(result.Columns.Get("MS_NOMBRE"))
Dim MS_MESAS_ASIGNADAS As String = records(result.Columns.Get("MS_MESAS_ASIGNADAS"))
skmt.ExecNonQuery2("INSERT INTO CAT_MESEROS(MS_ID, MS_NOMBRE, MS_MESAS_ASIGNADAS) VALUES (?,?,?)", Array As Object (MS_ID, MS_NOMBRE, MS_MESAS_ASIGNADAS))
Next
skmt.TransactionSuccessful 'Si no se pone TransactionSuccessful no se escribe NADA!!
' If B4XPages.MainPage.principal.cb_mesero.IsInitialized Then B4XPages.MainPage.principal.cb_mesero.SetItems(Subs.traeMeserosLista)
End If
End If
End If
' ToastMessageShow("¡Información cargada!", False)
Job.Release
End Sub
Private Sub b_entrar_LongClick
End Sub
Private Sub user_TextChanged (Old As String, New As String)
If New = "KMTS1" Then i_conf.Visible = True Else i_conf.Visible = False
End Sub
Private Sub i_password_MouseClicked (EventData As MouseEvent)
End Sub
Private Sub i_conf_MouseClicked (EventData As MouseEvent)
p_configuracion.Top = 0 : p_configuracion.left = 0
p_configuracion.Visible = True
lv_server.Items.Clear
lv_server.Items.Add("http://keymon.lat:1782")
Private c As ResultSet = skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
Do While c.NextRow
E_SERVER.Text = c.GetString("CAT_VA_VALOR")
Loop
End Sub
Private Sub lv_server_SelectedIndexChanged(Index As Int)
' Log($"LV clicked ${Index}"$)
' Log(lv_server.SelectedItem)
End Sub
Private Sub lv_server_MouseClicked (EventData As MouseEvent)
' Log($"LV mouse clicked ${EventData}"$)
Dim jo As JavaObject = EventData
Dim target As JavaObject = jo.RunMethod("getTarget", Null)
' Log(GetType(target))
If GetType(target) = "com.sun.javafx.scene.control.LabeledText" Then 'Traemos el valor de la opcion seleccionada.
Dim text As String = target.RunMethod("getText", Null)
' Log($"LV mouse clicked |${text}|"$)
E_SERVER.Text = text
End If
End Sub
Private Sub WobbleMenu1_Tab1Click
End Sub
Private Sub clv_mesas_ItemClick (Index As Int, Value As Object)
Log(Index)
End Sub
Sub LlenaMesas(p As ResultSet, extra As String) 'ignore
Private o As ResultSet = skmt.ExecQuery("select count(PT_TICKET) as ordenes from PEDIDO_TICKET where PT_PAGO <> 'VENTA'")
' o.Position = 0
Private cuantasOrdenes As Int = 0
Do While o.NextRow
cuantasOrdenes = o.GetInt("ordenes")
Loop
' Log(cuantasOrdenes)
If cuantasOrdenes > 0 Then WobbleMenu1.SetBadge(3, cuantasOrdenes, fx.Colors.From32Bit(0xFFFFFFFF), fx.Colors.From32Bit(0xFFFF0000)) Else WobbleMenu1.RemoveBadge(3)
Dim p As ResultSet = skmt.ExecQuery($"select *, IFNULL(M_ESTATUS, 'CERRADA') as ESTATUS2, IFNULL(M_MESERO, 'NINGUNO') as MESERO, IFNULL(M_COMENSALES, 0) as COMENSALES from cat_mesas"$)
' Log(p.RowCount)
' PCLVM.Commit
clv_mesas.Clear
Private m_mesas As Map
m_mesas.Initialize
' clv_mesas.GetBase.SetLayoutAnimated(0,0,0,
Do While p.NextRow
' Log($"${p.GetString("M_ID")} - ${p.GetString("M_NOMBRE")} - ${p.GetString("ESTATUS2")}"$)
Private SUBTOTAL2 As String = "0"
Private NO_ARTS2 As String = "0"
' Log(p.GetString("ESTATUS2"))
If p.GetString("ESTATUS2") = "ABIERTA" Then
' Log($"PT_TICKET = '${p.GetString("M_TICKET")}' and PT_MESA = '${p.GetString("M_ID")}"$)
Private pt As ResultSet = skmt.ExecQuery($"select ifnull(sum(PT_MONTO),0) as SUBTOTAL, ifnull(sum(PT_NOART), 0) as NO_ARTS from PEDIDO_TICKET where PT_TICKET = '${p.GetString("M_TICKET")}' and PT_MESA = '${p.GetString("M_ID")}' and PT_PAGO = 'VENTA'"$)
Do While pt.NextRow
SUBTOTAL2 = pt.GetString("SUBTOTAL")
NO_ARTS2 = pt.GetString("NO_ARTS")
Loop
End If
' Log($"${SUBTOTAL2}, ${NO_ARTS2}"$)
Dim tempMap As Map = CreateMap("id":p.GetString("M_ID"), "numero":p.GetString("M_NUMERO"), "nombre":p.GetString("M_NOMBRE"), "zona":p.GetString("M_ZONA"), "ticket":p.GetString("M_TICKET"), "estatus":p.GetString("ESTATUS2"), "mesero":p.GetString("MESERO"), "comensales":p.GetString("COMENSALES"), "subtotal":SUBTOTAL2, "articulos":NO_ARTS2)
' m_mesas.Put(p.GetString("M_ID"), tempMap)
Private Pnl As B4XView = xui.CreatePanel("")
Pnl.SetLayoutAnimated(0, 0, 0, clv_mesas.AsView.Width, 80dip)
clv_mesas.Add(Pnl, tempMap)
' listaHintsM.Add($"Mesa ${p.GetString("M_ID")}"$)
Loop
p.Close
' PCLVM.B4XSeekBar1.MaxValue = clv_mesas.Size
' PCLVM.B4XSeekBar1.MinValue = 0
' PCLVM.B4XSeekBar1.Interval = clv_mesas.Size/20
' PCLVM.B4XSeekBar1.Value = clv_mesas.Size
' PCLVM.B4XSeekBar1.Update
reiniciarlistaProds = False
End Sub
Private Sub clv_mesas_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
' Log($"clv_mesa_VisibleRangeChanged : ${FirstIndex}, ${LastIndex} "$)
Dim ExtraSize As Int = 30 'List size
Private m As Map
For i = Max(0, FirstIndex - ExtraSize) To Min(LastIndex + ExtraSize, clv_mesas.Size - 1)
Dim Pnl As B4XView = clv_mesas.GetPanel(i)
m = clv_mesas.GetValue(i)
If i > FirstIndex - ExtraSize And i < LastIndex + ExtraSize Then
If Pnl.NumberOfViews = 0 Then 'Add each item/layout to the list/main layout
Pnl.LoadLayout("mesasItem")
' p_mesasItem.Width = Root.Width * 0.99
' l_mesaX.SetTextSizeAnimated(0, 13)
l_estatus.text = "DISPONIBLE"
l_mesaX.TextSize = 16
l_estatus.Left = clv_mesas.AsView.Width - 111dip
If m.Get("estatus") = "ABIERTA" Then l_estatus.Text = "ABIERTA"
' Log(m)
p_mesasItem.PrefHeight = 80dip
If l_estatus.text = "ABIERTA" Then
l_mesaX.Text = $"Mesa ${m.Get("id")}${CRLF}Comensales ${m.Get("comensales")} - Mesero ${m.Get("mesero")}${CRLF}Subtotal. $${NumberFormat2(m.Get("subtotal"), 1,2,2,True)} - Articulos: ${m.Get("articulos")}"$
Else
l_mesaX.Text = $"Mesa ${m.Get("id")}"$
End If
' Log(p_mesasItem.As(B4XView).GetView(0).As(Label).text)
l_mesaX.Tag = m
p_mesasItem.Tag = m
p_mesasItem.PrefHeight = 130dip
End If
Else 'Not visible
' If Pnl.NumberOfViews > 0 Then
' Pnl.RemoveAllViews 'Remove none visable item/layouts from the list/main layout
' End If
End If
Next
End Sub
Sub muestraCats
Private lasCats As List = Subs.traeCategorias
nivelActual = "Cats"
lv_categorias.items.Clear
For cat = 0 To lasCats.Size - 1
lv_categorias.Items.add(lasCats.get(cat))
Next
End Sub
'Entramos a la mesa seleccionada.
Private Sub p_mesasItem_MouseClicked(EventData As MouseEvent)
Subs.muestraPane(p_mesa, Root)
p_mesa.Visible = True
' Subs.centraEtiqueta(l_mesa, Root.Width)
' Subs.centraPanel(p_mesaCampos, Root.Width)
' Subs.centraBoton(b_abrirMesa, Root.Width)
Subs.centraPanel(p_mesa2, Root.Width)
listaFormasDePagoCB.Initialize
listaFormaDePago.Initialize
listaMontoDePago.Initialize
listaTickets.Initialize
formasDePago = 1
tipoPago = "VENTA"
muestraCats
clv_prods_ll.AsView.Visible = False
lv_categorias.Visible = True
' Log(Sender.As(Panel).tag)
b_abrirMesa.Text = "Abrir Mesa"
' Subs.panelVisible(p_mesa, 0, 0)
Private m As Map = Sender.As(Pane).tag
mesaActual = m.Get("id")
meseroActual = m.Get("mesero")
ticketActual = m.Get("ticket")
comensalesActuales = m.Get("comensales")
totalActual = m.Get("subtotal")
l_mesa.Text = $"MESA NO. ${m.Get("id")}"$
' Log(m)
b_mesaCerrar.Tag = m
skmt.ExecNonQuery("delete from cuentaa")
skmt.ExecNonQuery($"insert into cuentaa (cuenta) values ('${m.Get("ticket")}')"$)
llenaProdsLL(Null, Null)
p_mesas.Visible = False
cb_mesero.SelectedIndex = 0
' cb_pago.SelectedIndex = 0
cb_comensales.SelectedIndex = 0
' Private mesero As String = Subs.traeMesero(m.Get("id"))
If m.Get("mesero") <> "NINGUNO" Then cb_mesero.SelectedIndex = cb_mesero.Items.IndexOf(m.Get("mesero"))
If m.Get("comensales") <> "0" Then cb_comensales.SelectedIndex = cb_comensales.Items.IndexOf(m.Get("comensales"))
' Log(Subs.traeMesaEstatus(m.Get("id")))
If Subs.traeMesaEstatus(m.Get("id")) = "CERRADA" Then
p_mesaCampos.Visible = True
b_abrirMesa.Visible = True
p_mesaAbierta.Visible = False
Else
p_mesaCampos.Visible = False
b_abrirMesa.Visible = False
p_mesaAbierta.Visible = True
' p_mesaAbierta.BringToFront
l_meseroAbierta2.Text = m.Get("mesero")
l_comensalesAbierta2.Text = m.Get("comensales")
End If
Private tm As Map = CreateMap("ticket":m.Get("ticket"), "pago":tipoPago)
listaTickets.Initialize
listaTickets.Add(tm) 'Agregamos el ticket y pago a la lista para imprimir el ticket con estos datos al llamar b_imprimirTicket_Click
End Sub
Sub llenaProdsLL(p As ResultSet, extra As String)
End Sub
Private Sub b_regresarProds_Click
End Sub
Private Sub b_imprimirTicket_Click
End Sub
Private Sub b_mesaCerrar_Click
End Sub
Private Sub clv_prods_ll_ItemClick (Index As Int, Value As Object)
End Sub
Private Sub clv_prods_ll_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
End Sub
Private Sub b_mesaEditar_Click
End Sub
Private Sub b_abrirMesa_Click
If cb_mesero.SelectedIndex <> 0 Then
Private c As ResultSet = skmt.ExecQuery($"select M_ESTATUS from CAT_MESAS where M_ID = '${mesaActual}' and M_ESTATUS = 'ABIERTA'"$)
Private cont As Int = 0
Do While c.NextRow
cont = cont + 1
skmt.ExecNonQuery($"update CAT_MESAS set M_MESERO = '${cb_mesero.Value}', M_COMENSALES = '${cb_comensales.value}' where M_ID = '${mesaActual}'"$)
Log($"update CAT_MESAS set M_MESERO = '${cb_mesero.value}', M_COMENSALES = '${cb_comensales.value}' where M_ID = '${mesaActual}'"$)
Loop
If cont = 0 Then
ticketActual = Subs.traeConsecutivoTicket("ABIERTA", "PENDIENTE")
skmt.ExecNonQuery($"update CAT_MESAS set M_TICKET = '${Subs.traeConsecutivoTicket("ABIERTA", "PENDIENTE")}', M_ESTATUS = 'ABIERTA', M_MESERO = '${cb_mesero.value}', M_COMENSALES = '${cb_comensales.value}' where M_ID = '${mesaActual}'"$)
' Log($"update CAT_MESAS set M_TICKET = '${Starter.ticketActual}', M_ESTATUS = 'ABIERTA', M_MESERO = '${cb_mesero.SelectedItem}', M_COMENSALES = '${cb_comensales.SelectedItem}' where M_ID = '${Starter.mesaActual}'"$)
End If
meseroActual = cb_mesero.value
comensalesActuales = cb_comensales.value
skmt.ExecNonQuery($"delete from usuarioa"$)
skmt.ExecNonQuery($"insert into usuarioa (usuario) values ('${cb_mesero.value}')"$)
llenaProdsLL(Null, Null)
l_comensalesAbierta2.Text = cb_comensales.value
l_meseroAbierta2.Text = cb_mesero.value
p_mesaCampos.Visible = False
b_abrirMesa.Visible = False
p_mesaAbierta.Visible = True
Else
' ToastMessageShow("Es necesario seleccionar un mesero", False)
End If
End Sub
Private Sub lv_categorias_SelectedIndexChanged(Index As Int)
Private selected As String = lv_categorias.SelectedItem
Log(selected)
If selected <> "null" Then
If nivelActual = "Cats" Then
Private lasCats As List = Subs.traeSubCategorias(selected)
Log(lasCats)
nivelActual = "SubCats"
lv_categorias.Items.Clear
For cat = 0 To lasCats.Size - 1
Log(lasCats.get(cat))
lv_categorias.items.Add(lasCats.get(cat))
Next
Else
Log(99)
lv_categorias.Visible = False
clv_prods_ll.AsView.Visible = True
Private c As ResultSet = skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_GP_IMG from cat_gunaprod where CAT_GP_PRECIO > 0 And CAT_GP_CLASIF <> 'PROMOS' and CAT_GP_CLASIF = '${selected}' order by CAT_GP_NOMBRE"$)
llenaProdsLL(c, Null)
End If
End If
End Sub
Private Sub lv_categorias_MouseClicked (EventData As MouseEvent)
' Log("ITEM CLICKED")
' Dim jo As JavaObject = EventData
' Dim target As JavaObject = jo.RunMethod("getTarget", Null)
'' Log(GetType(target))
' If GetType(target) = "com.sun.javafx.scene.control.LabeledText" Then 'Traemos el valor de la opcion seleccionada.
' Dim text As String = target.RunMethod("getText", Null)
' Log($"LV mouse clicked |${text}|"$)
'' E_SERVER.Text = text
' End If
' If nivelActual = "Cats" Then
' Private lasCats As List = Subs.traeSubCategorias(Value)
' nivelActual = "SubCats"
' lv_categorias.Clear
' For cat = 0 To lasCats.Size - 1
' lv_categorias.AddSingleLine(lasCats.get(cat))
' Next
' Else
' lv_categorias.Visible = False
' clv_prods_ll.AsView.Visible = True
' Private c As ResultSet = skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_GP_IMG from cat_gunaprod where CAT_GP_PRECIO > 0 And CAT_GP_CLASIF <> 'PROMOS' and CAT_GP_CLASIF = '${Value}' order by CAT_GP_NOMBRE"$)
' llenaProdsLL(c, Null)
' End If
End Sub
Private Sub cb_comensales_SelectedIndexChanged(Index As Int, Value As Object)
End Sub
Private Sub cb_mesero_SelectedIndexChanged(Index As Int, Value As Object)
Log(cb_mesero.SelectedIndex)
Log(cb_mesero.Value)
End Sub
Private Sub b_back_Click
' B4XPage_CloseRequest
Log("BACK")
' Log(atrasPresionado
If p_mesa.Visible Then
p_mesa.Visible = False
p_mesas.Visible = True
Else If p_mesas.Visible Then
p_mesas.Visible = False
b_back.Visible = False
else if p_configuracion.Visible Then
p_configuracion.Visible = False
Return False
Else
If atrasPresionado Then ExitApplication 'Solo salimos de la aplicación si se presiona 'Atras' 2 veces seguidas.
' ToastMessageShow("Presiona 'Atras' nuevamente para salir de la aplicación.", False)
atrasPresionado = True
End If
End Sub
Private Sub b_cerrarApp_Click
ExitApplication
End Sub
Private Sub b_cerrarCerrar_Click
p_cerrarApp.Visible = False
End Sub

BIN
B4i/Files/mainpage.bil Normal file

Binary file not shown.

View File

@@ -0,0 +1,46 @@
Build1=Default,b4i.example
File1=MainPage.bil
FileGroup1=Default Group
Group=Default Group
Library1=icore
Library2=b4xpages
Module1=|relative|..\B4XMainPage
NumberOfFiles=1
NumberOfLibraries=2
NumberOfModules=1
Version=6.5
@EndOfDesignText@
'Code module
#Region Project Attributes
#ApplicationLabel: B4i Example
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 11
#End Region
Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Dim PagesManager As B4XPagesManager
PagesManager.Initialize(NavControl)
End Sub
'Template version: B4i-1.0
#Region Delegates
Private Sub Application_Background
B4XPages.Delegate.Activity_Pause
End Sub
Private Sub Application_Foreground
B4XPages.Delegate.Activity_Resume
End Sub
#End Region

View File

@@ -0,0 +1,9 @@
ModuleBookmarks0=
ModuleBookmarks1=
ModuleBreakpoints0=
ModuleBreakpoints1=
ModuleClosedNodes0=1,4
ModuleClosedNodes1=1
NavigationStack=Main,Application_Start,25,4,Main,Application_Foreground,34,0,Main,Process_Globals,13,0,Visual Designer,MainPage.bil,-100,1,B4XMainPage,Initialize,9,0,B4XMainPage,Button1_Click,19,0,B4XMainPage,B4XPage_Created,10,1,B4XMainPage,Class_Globals,11,0
SelectedBuild=0
VisibleModules=1