mirror of
https://github.com/KeymonSoft/Mariana_Censos.git
synced 2026-04-21 22:59:29 +00:00
27/9/23 - Lista clientes y dia de visita
- Se cambio el listview de clientes por un customListView y se agrego el estatus en esa lista. - Se modificó el config.Properties para que traiga el dia de visita y NO el dia de sicronización.de los clientes nuevos.
This commit is contained in:
@@ -12,12 +12,11 @@ End Sub
|
||||
Sub Class_Globals
|
||||
Private Root As B4XView 'ignore
|
||||
Private xui As XUI 'ignore
|
||||
|
||||
' Dim skmt As SQL
|
||||
Dim c As Cursor
|
||||
Dim c2 As Cursor
|
||||
Dim s As Cursor
|
||||
Dim ListView1 As ListView
|
||||
' Dim ListView1 As ListView
|
||||
Dim entro As String
|
||||
Dim gest As Button
|
||||
Dim lfila As Label
|
||||
@@ -28,10 +27,14 @@ Sub Class_Globals
|
||||
' Dim sc As Zxing_scanner
|
||||
Dim CODIGO As String
|
||||
Dim STIME As String
|
||||
|
||||
Dim ruta As String
|
||||
Dim q_buscar As String
|
||||
Private p_clientes As Panel
|
||||
Private p_clienteItem As Panel
|
||||
Private l_clienteItem As Label
|
||||
Private l_estatus As Label
|
||||
Private clv_clientes As CustomListView
|
||||
Private l_clienteItem2 As Label
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -68,35 +71,62 @@ Sub B4XPage_Appear
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
colonia = 0
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO, CAT_CL_SECUENCIA from kmt_info where gestion = 0 ORDER BY CAT_CL_SECUENCIA, CAT_CL_CODIGO")
|
||||
ListView1.Clear
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO, CAT_CL_SECUENCIA, CAT_CL_ESTATUS from kmt_info where gestion = 0 ORDER BY CAT_CL_SECUENCIA, CAT_CL_CODIGO")
|
||||
' ListView1.Clear
|
||||
clv_clientes.Clear
|
||||
' Log("LIMPIAMOS LISTVIEW")
|
||||
lfila.Text = "NOMBRE"
|
||||
If c.RowCount>0 Then
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 14
|
||||
label1.TextColor = Colors.Black
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 14
|
||||
label2.TextColor = Colors.Black
|
||||
label2.Height = 50dip
|
||||
label2.Width = ListView1.Width * 0.99
|
||||
ListView1.TwoLinesLayout.ItemHeight = 70dip
|
||||
If c.RowCount > 0 Then
|
||||
' Dim label1 As Label
|
||||
' label1 = ListView1.TwoLinesLayout.Label
|
||||
' label1.TextSize = 14
|
||||
' label1.TextColor = Colors.Black
|
||||
' Dim label2 As Label
|
||||
' label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
' label2.TextSize = 14
|
||||
' label2.TextColor = Colors.Black
|
||||
' label2.Height = 50dip
|
||||
' label2.Width = ListView1.Width * 0.99
|
||||
' ListView1.TwoLinesLayout.ItemHeight = 70dip
|
||||
clv_clientes.GetBase.SetLayoutAnimated(0, 0, clv_clientes.AsView.top, Root.Width - 50, Root.Height * 0.75) 'Cambiamos el tamaño y posición de la lista de clientes
|
||||
clv_clientes.Base_Resize(clv_clientes.GetBase.Width, clv_clientes.GetBase.Height) 'Cambiamos el tamaño del panel interno de la lista para que ajuste al nuevo tamaño.
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
' Log($"${c.GetString("CAT_CL_CODIGO")}, ${c.GetString("CAT_CL_NOMBRE")}"$)
|
||||
ListView1.AddTwoLines(c.GetString("CAT_CL_CODIGO") & " - " & c.GetString("CAT_CL_SECUENCIA"), c.GetString("CAT_CL_NOMBRE") & ", " & c.GetString("CAT_CL_CALLE"))
|
||||
' ListView1.AddTwoLines(c.GetString("CAT_CL_CODIGO") & " - " & c.GetString("CAT_CL_SECUENCIA"), c.GetString("CAT_CL_NOMBRE") & ", " & c.GetString("CAT_CL_CALLE"))
|
||||
clv_clientes.Add(CreateListItem(c.GetString("CAT_CL_CODIGO") & " - " & c.GetString("CAT_CL_SECUENCIA"), c.GetString("CAT_CL_NOMBRE") & ", " & c.GetString("CAT_CL_CALLE"), c.GetString("CAT_CL_ESTATUS"), clv_clientes.AsView.Width, 70dip), c.GetString("CAT_CL_CODIGO") & " - " & c.GetString("CAT_CL_SECUENCIA"))
|
||||
Next
|
||||
End If
|
||||
c.Close
|
||||
p_clientes.Height = Root.Height
|
||||
ListView1.Height = Root.Height * 0.75
|
||||
' ListView1.Height = Root.Height * 0.75
|
||||
entro = "4"
|
||||
End Sub
|
||||
|
||||
Sub ListView1_ItemClick (Position As Int, Value As Object)
|
||||
Sub CreateListItem(text1 As String, text2 As String, text3 As String, Width As Int, Height As Int) As Panel
|
||||
Dim p As B4XView = xui.CreatePanel("")
|
||||
' p.SetLayoutAnimated(0, 0, 0, Width, Height)
|
||||
p.LoadLayout("clientesItem")
|
||||
p_clienteItem.Width = Width
|
||||
p.Height = Height
|
||||
|
||||
l_clienteItem.Text = text1
|
||||
l_clienteItem2.Text = text2
|
||||
l_estatus.Text = text3
|
||||
' p_prods.Color = bc
|
||||
' l_prodX.TextColor = tc
|
||||
' l_prodX.TextSize = 15
|
||||
' p_prods.Height = Height
|
||||
' l_prodX.Height = Height
|
||||
' l_prodX.Text = Text&CRLF&"# " & inv & " $ " & precioU
|
||||
' l_prodX.Tag = $"ID: ${prodId}${CRLF}${Text}${CRLF}Precio: $$1.2{precioU}${CRLF}Inv: ${inv} pzs"$
|
||||
' l_pCant.Tag = precioU&"|"&inv&"|"&prodId
|
||||
' et_pCant.Tag = precioU&"|"&inv&"|"&prodId
|
||||
' et_pCant.BringToFront
|
||||
Return p
|
||||
End Sub
|
||||
|
||||
Sub clv_clientes_ItemClick (index As Int, Value As Object)
|
||||
Private value2() As String = Regex.Split(" - ", Value)
|
||||
If colonia = 0 Then
|
||||
colonia = value2(0)
|
||||
@@ -105,23 +135,27 @@ Sub ListView1_ItemClick (Position As Int, Value As Object)
|
||||
|
||||
If entro = "2" Then
|
||||
c2=B4XPages.MainPage.skmt.ExecQuery2("select CAT_CL_CALLE, CAT_CL_COLONIA, count(*) as cuantos from kmt_info where gestion = 0 and CAT_CL_COLONIA = ? GROUP BY CAT_CL_CALLE, CAT_CL_COLONIA order by CAT_CL_CALLE ", Array As String(value2(0)))
|
||||
ListView1.Clear
|
||||
' ListView1.Clear
|
||||
clv_clientes.Clear
|
||||
lfila.text = "Calle"
|
||||
If c2.RowCount>0 Then
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position=i
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CALLE"),c2.GetString("cuantos") )
|
||||
' ListView1.AddTwoLines(c2.GetString("CAT_CL_CALLE"),c2.GetString("cuantos") )
|
||||
clv_clientes.Add(CreateListItem(c2.GetString("CAT_CL_CALLE"), c2.GetString("cuantos"), "", clv_clientes.AsView.Width, 70dip), c2.GetString("CAT_CL_CALLE"))
|
||||
Next
|
||||
End If
|
||||
entro = "3"
|
||||
Else If entro = "3" Then
|
||||
c2=B4XPages.MainPage.skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where gestion = 0 and CAT_CL_CALLE = ? AND CAT_CL_COLONIA = ? order by CAT_CL_NOMBRE ", Array As String(value2(0), colonia))
|
||||
ListView1.Clear
|
||||
' ListView1.Clear
|
||||
clv_clientes.Clear
|
||||
lfila.text = "Nombre"
|
||||
If c2.RowCount>0 Then
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position=i
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE"))
|
||||
' ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE"))
|
||||
clv_clientes.Add(CreateListItem(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE"), "", clv_clientes.AsView.Width, 70dip), c2.GetString("CAT_CL_CODIGO"))
|
||||
Next
|
||||
End If
|
||||
entro = "4"
|
||||
@@ -170,23 +204,25 @@ Sub BUSCA_TextChanged (Old As String, New As String)
|
||||
' Log("BUSCA_TEXTCHANGED")
|
||||
q_buscar = "%" & busca.Text & "%"
|
||||
c2=B4XPages.MainPage.skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where (CAT_CL_NOMBRE like ? OR CAT_CL_CODIGO LIKE ? OR CAT_CL_CALLE LIKE ?)and gestion = 0 order by CAT_CL_NOMBRE ", Array As String(q_buscar,q_buscar,q_buscar))
|
||||
ListView1.Clear
|
||||
' ListView1.Clear
|
||||
clv_clientes.Clear
|
||||
lfila.text = "Nombre y Calle"
|
||||
' Log("=========================================================================")
|
||||
If c2.RowCount > 0 Then
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 14
|
||||
label1.TextColor = Colors.DarkGray
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 14
|
||||
label2.TextColor = Colors.DarkGray
|
||||
' Dim label1 As Label
|
||||
' label1 = ListView1.TwoLinesLayout.Label
|
||||
' label1.TextSize = 14
|
||||
' label1.TextColor = Colors.DarkGray
|
||||
' Dim label2 As Label
|
||||
' label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
' label2.TextSize = 14
|
||||
' label2.TextColor = Colors.DarkGray
|
||||
' ListView1.TwoLinesLayout.ItemHeight = 350dip
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position=i
|
||||
' Log($"${c2.GetString("CAT_CL_CODIGO")} - ${c2.GetString("CAT_CL_NOMBRE")}"$)
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
' ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
clv_clientes.Add(CreateListItem(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"), "", clv_clientes.AsView.Width, 70dip), c2.GetString("CAT_CL_CODIGO"))
|
||||
Next
|
||||
End If
|
||||
entro = "4"
|
||||
@@ -241,4 +277,4 @@ End Sub
|
||||
|
||||
Private Sub p_clientes_Click
|
||||
'Nada aqui, solo esta para que los clics no se pasen hacia atras.
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user