# Conflicts:
#	Durakelo_reparto.b4a.meta
This commit is contained in:
cvaldes1201
2023-11-20 08:42:28 -06:00
16 changed files with 60 additions and 17 deletions

View File

@@ -24,7 +24,7 @@ Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim trabajar As Button
dim ime as ime
Dim c As Cursor
Dim d As Cursor
Dim b As Cursor
@@ -93,6 +93,9 @@ Sub Globals
Dim HORAINGRESO As String
Private p_cargando As Panel
Private p_cargando2 As Panel
Private l_cargando As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
@@ -176,7 +179,7 @@ Sub Activity_Create(FirstTime As Boolean)
skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_VALOR,CAT_VA_DESCRIPCION) VALUES (?,?)" , Array As String(DateTime.Time(DateTime.Now),"HoraIngreso"))
End If
DateTime.TimeFormat = "HH:mm:ss"
p_cargando2.Left = (Activity.Width / 2) - (p_cargando2.Width / 2)
End Sub
Sub IsConnectedToInternet As Boolean
@@ -195,6 +198,7 @@ End Sub
Sub Activity_Resume
Log("eresume")
c=skmt.ExecQuery("select noversion from version")
c.Position=0
HORAINGRESO ="000000"
@@ -221,6 +225,7 @@ Sub Activity_Resume
Listo5 = 0
inve = 0
img2.Visible =False
p_cargando.Visible = False
End If
DateTime.DateFormat = "MM/dd/yyyy"
fecha=DateTime.Date(DateTime.Now)
@@ -474,7 +479,10 @@ Sub Subir_Click
End Sub
Sub cargar_Click
img2.Visible =True
' img2.Visible =True
p_cargando.Visible = True
p_cargando.Elevation = 100
p_cargando.BringToFront
EJECUTANDO = 1
'c=skmt.ExecQuery("CREATE TABLE kmt_info (pr_cd_credito NUMERIC,pr_cd_nombre TEXT,pr_cd_calle TEXT,pr_cd_numero TEXT,pr_cd_num_int TEXT,pr_cd_entrecalle1 TEXT,pr_cd_entrecalle2 TEXT,pr_cd_colonia TEXT,pr_cd_poblacion TEXT,pr_cd_edo TEXT,pr_cd_cp TEXT,pr_cd_zona TEXT,pr_cf_credito NUMERIC,pr_cf_saldotot NUMERIC,pr_cf_saldooper NUMERIC,pr_cf_saldof1 NUMERIC, pr_cf_penalizacion NUMERIC)")
@@ -624,7 +632,9 @@ Sub cargar_Click
'cmd.Parameters = Array As Object(usuario)
'reqManager.ExecuteQuery(cmd , 0, "telefonos")
ToastMessageShow("Se Actualizaran los datos, Este proceso podria tardar hasta un minuto, gracias" , True)
l_cargando.Text = $"Procesos pendientes: ${reqManager.reqsList.Size}"$
End Sub
Sub JobDone(Job As HttpJob)
If reqManager.reqsList.IsInitialized Then 'Si tenemos lista de requests, la procesamos.
If reqManager.reqsList.IndexOf(Job.tag) <> -1 Then
@@ -668,6 +678,7 @@ Sub JobDone(Job As HttpJob)
ToastMessageShow("Datos Actualizados." , True)
Activity_Resume
img2.Visible=False
p_cargando.Visible = False
EJECUTANDO=0
End If
End If
@@ -697,6 +708,7 @@ Sub JobDone(Job As HttpJob)
ToastMessageShow("Datos Actualizados." , True)
Activity_Resume
img2.Visible=False
p_cargando.Visible = False
EJECUTANDO=0
End If
End If
@@ -726,11 +738,13 @@ Sub JobDone(Job As HttpJob)
ToastMessageShow("Datos Actualizados." , True)
Activity_Resume
img2.Visible=False
p_cargando.Visible = False
EJECUTANDO=0
Else If Listo4 = 1 And Listo3 = 1 And inve = 1 Then
ToastMessageShow("Datos Actualizados." , True)
Activity_Resume
img2.Visible=False
p_cargando.Visible = False
EJECUTANDO=0
End If
End If
@@ -763,6 +777,7 @@ Sub JobDone(Job As HttpJob)
ToastMessageShow("Datos Actualizados." , True)
Activity_Resume
img2.Visible=False
p_cargando.Visible = False
EJECUTANDO=0
End If
End If
@@ -773,7 +788,7 @@ Sub JobDone(Job As HttpJob)
If RESULT.Tag = "punteo" Then 'query tag
Log("punteo")
For Each records() As Object In RESULT.Rows
Log("punteo2")
' Log("punteo2")
Dim HV_CLIENTE As String = records(RESULT.Columns.Get("HV_CLIENTE"))
Dim HV_LONG As String = records(RESULT.Columns.Get("HV_LONG"))
Dim HV_LAT As String = records(RESULT.Columns.Get("HV_LAT"))
@@ -811,6 +826,7 @@ Sub JobDone(Job As HttpJob)
ToastMessageShow("Datos Actualizados." , True)
Activity_Resume
img2.Visible=False
p_cargando.Visible = False
EJECUTANDO=0
End If
End If
@@ -929,6 +945,8 @@ Sub JobDone(Job As HttpJob)
End If
Job.Release
End If
LogColor($"${reqManager.reqsList.Size}${CRLF}${list2text(reqManager.reqsList)}"$, Colors.Red)
l_cargando.Text = $"Procesos pendientes: ${reqManager.reqsList.Size}${CRLF}${CRLF}${list2text(reqManager.reqsList)}"$
End Sub
Sub Activity_KeyPress (key As Int) As Boolean
@@ -943,6 +961,7 @@ Sub Activity_KeyPress (key As Int) As Boolean
End Sub
Sub connecta_Click
ime.HideKeyboard
imei = "" 'p.GetDeviceId
conn = "1"
Dim cmd As DBCommand
@@ -986,6 +1005,7 @@ End Sub
Sub inv_Click
img2.Visible =True
p_cargando.Visible = True
EJECUTANDO = 1
inve = 1
skmt.ExecNonQuery("delete from cat_gunaprod")
@@ -1028,6 +1048,7 @@ Sub t1_tick
cmd.Parameters = Array As Object(ALMACEN,l_ruta.text)
reqManager.ExecuteQuery(cmd , 0, "valida_pedidoc")
img2.Visible=False
p_cargando.Visible = False
t1.Enabled = False
End Sub
@@ -1090,4 +1111,20 @@ Sub e_ruta_TextChanged (Old As String, New As String)
Catch
Log(LastException)
End Try
End Sub
Private Sub p_cargando_Click
End Sub
Sub list2text(a As List)
Private elTexto As String = ""
For i = 0 To a.Size - 1
If i > 0 Then
elTexto = elTexto & ", " & a.Get(i)
Else
elTexto = elTexto & a.Get(i)
End If
Next
Return elTexto
End Sub