mirror of
https://github.com/KeymonSoft/Intmex_Preventa.git
synced 2026-04-17 21:06:12 +00:00
V_FINAL
This commit is contained in:
@@ -34,6 +34,9 @@ Sub Class_Globals
|
||||
Private direccion As Label
|
||||
Private cxc As Label
|
||||
Private p_datosclie As Panel
|
||||
Private b_buscar As Button
|
||||
Private CHECK As Int
|
||||
Private l_baseodia As Label
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -66,6 +69,8 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
l_baseodia.Text = "Clientes del día de visita"
|
||||
CHECK = 0
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
colonia = 0
|
||||
@@ -178,41 +183,79 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
End Sub
|
||||
|
||||
Sub BUSCA_TextChanged (Old As String, New As String)
|
||||
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
|
||||
lfila.text = "Nombre y Calle"
|
||||
If CHECK = 0 Then
|
||||
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
|
||||
lfila.text = "Nombre y Calle"
|
||||
|
||||
CustomListView1.Clear
|
||||
For i = 0 To c2.RowCount - 1
|
||||
c2.Position = i
|
||||
CustomListView1.Add(CreateListItem(c2.GetString("CAT_CL_NOMBRE"),c2.GetString("CAT_CL_CALLE"),c2.GetString("CAT_CL_CODIGO")),i)
|
||||
d = B4XPages.MainPage.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c2.GetString("CAT_CL_CODIGO")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
cxc.Visible = False
|
||||
Else
|
||||
cxc.Visible = True
|
||||
End If
|
||||
d.Close
|
||||
Next
|
||||
|
||||
|
||||
If c2.RowCount>0 Then
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position=i
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 9
|
||||
label1.TextColor = Colors.White
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 17
|
||||
label2.TextColor = Colors.White
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
CustomListView1.Clear
|
||||
For i = 0 To c2.RowCount - 1
|
||||
c2.Position = i
|
||||
CustomListView1.Add(CreateListItem(c2.GetString("CAT_CL_NOMBRE"),c2.GetString("CAT_CL_CALLE"),c2.GetString("CAT_CL_CODIGO")),i)
|
||||
d = B4XPages.MainPage.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c2.GetString("CAT_CL_CODIGO")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
cxc.Visible = False
|
||||
Else
|
||||
cxc.Visible = True
|
||||
End If
|
||||
d.Close
|
||||
Next
|
||||
|
||||
|
||||
If c2.RowCount>0 Then
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position=i
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 9
|
||||
label1.TextColor = Colors.White
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 17
|
||||
label2.TextColor = Colors.White
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
Next
|
||||
End If
|
||||
entro = "4"
|
||||
c2.Close
|
||||
Else If CHECK = 1 Then
|
||||
q_buscar = "%" & busca.Text & "%"
|
||||
c2=B4XPages.MainPage.skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info2 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
|
||||
lfila.text = "Nombre y Calle"
|
||||
|
||||
CustomListView1.Clear
|
||||
For i = 0 To c2.RowCount - 1
|
||||
c2.Position = i
|
||||
CustomListView1.Add(CreateListItem(c2.GetString("CAT_CL_NOMBRE"),c2.GetString("CAT_CL_CALLE"),c2.GetString("CAT_CL_CODIGO")),i)
|
||||
d = B4XPages.MainPage.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c2.GetString("CAT_CL_CODIGO")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
cxc.Visible = False
|
||||
Else
|
||||
cxc.Visible = True
|
||||
End If
|
||||
d.Close
|
||||
Next
|
||||
|
||||
|
||||
If c2.RowCount>0 Then
|
||||
For i=0 To c2.RowCount -1
|
||||
c2.Position=i
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 9
|
||||
label1.TextColor = Colors.White
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 17
|
||||
label2.TextColor = Colors.White
|
||||
ListView1.AddTwoLines(c2.GetString("CAT_CL_CODIGO"), c2.GetString("CAT_CL_NOMBRE") &" CALLE: "& c2.GetString("CAT_CL_CALLE"))
|
||||
Next
|
||||
End If
|
||||
entro = "4"
|
||||
c2.Close
|
||||
End If
|
||||
entro = "4"
|
||||
c2.Close
|
||||
End Sub
|
||||
|
||||
Sub b_qr_Click
|
||||
@@ -314,4 +357,87 @@ Private Sub p_datosclie_Click
|
||||
|
||||
|
||||
' Log(Sender.As(Panel).tag)
|
||||
End Sub
|
||||
|
||||
Private Sub b_buscar_Click
|
||||
Log(CHECK)
|
||||
If CHECK = 0 Then
|
||||
l_baseodia.Text = "Clientes de base de datos"
|
||||
CHECK = 1
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
colonia = 0
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info2 where gestion = 0 ORDER BY CAT_CL_CODIGO")
|
||||
ListView1.Clear
|
||||
lfila.Text = "NOMBRE"
|
||||
ListView1.Clear
|
||||
CustomListView1.Clear
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
CustomListView1.Add(CreateListItem(c.GetString("CAT_CL_NOMBRE"),c.GetString("CAT_CL_CALLE"),c.GetString("CAT_CL_CODIGO")),i)
|
||||
d = B4XPages.MainPage.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c.GetString("CAT_CL_CODIGO")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
cxc.Visible = False
|
||||
Else
|
||||
cxc.Visible = True
|
||||
End If
|
||||
d.Close
|
||||
Next
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 13
|
||||
label1.TextColor = Colors.Black
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 13
|
||||
label2.TextColor = Colors.Black
|
||||
ListView1.AddTwoLines(c.GetString("CAT_CL_CODIGO"), c.GetString("CAT_CL_NOMBRE"))
|
||||
Next
|
||||
End If
|
||||
c.Close
|
||||
entro = "4"
|
||||
|
||||
Else If CHECK = 1 Then
|
||||
l_baseodia.Text = "Clientes del día de visita"
|
||||
CHECK = 0
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
colonia = 0
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where gestion = 0 ORDER BY CAT_CL_CODIGO")
|
||||
ListView1.Clear
|
||||
lfila.Text = "NOMBRE"
|
||||
ListView1.Clear
|
||||
CustomListView1.Clear
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
CustomListView1.Add(CreateListItem(c.GetString("CAT_CL_NOMBRE"),c.GetString("CAT_CL_CALLE"),c.GetString("CAT_CL_CODIGO")),i)
|
||||
d = B4XPages.MainPage.skmt.ExecQuery($"select CLIENTE FROM ABONOSP WHERE CLIENTE = '${c.GetString("CAT_CL_CODIGO")}'"$)
|
||||
If d.RowCount = 0 Then
|
||||
cxc.Visible = False
|
||||
Else
|
||||
cxc.Visible = True
|
||||
End If
|
||||
d.Close
|
||||
Next
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Dim label1 As Label
|
||||
label1 = ListView1.TwoLinesLayout.Label
|
||||
label1.TextSize = 13
|
||||
label1.TextColor = Colors.Black
|
||||
Dim label2 As Label
|
||||
label2 = ListView1.TwoLinesLayout.SecondLabel
|
||||
label2.TextSize = 13
|
||||
label2.TextColor = Colors.Black
|
||||
ListView1.AddTwoLines(c.GetString("CAT_CL_CODIGO"), c.GetString("CAT_CL_NOMBRE"))
|
||||
Next
|
||||
End If
|
||||
c.Close
|
||||
entro = "4"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Reference in New Issue
Block a user