mirror of
https://github.com/KeymonSoft/Intmex_Preventa.git
synced 2026-04-17 21:06:12 +00:00
2/9/23 - NotificationService, RespaldoDiario y DBReqServer.
- Se agregó el servicio "NotificationService" para interceptar notificaciones y por medio de un mensaje de WhatsApp (#NS http://10.0.0.205:1782), cambiar el servidor de DBReq. - Se agregó la clase de RespaldoDiario. - Se estandarizó el DBreqServer en Starter.DBReqServer.
This commit is contained in:
@@ -24,6 +24,7 @@ Version=9.85
|
|||||||
Sub Class_Globals
|
Sub Class_Globals
|
||||||
Private Root As B4XView
|
Private Root As B4XView
|
||||||
Private xui As XUI
|
Private xui As XUI
|
||||||
|
Dim s As C_Subs
|
||||||
Public login As B4XMainPage
|
Public login As B4XMainPage
|
||||||
Public principal As C_Principal
|
Public principal As C_Principal
|
||||||
Public clientes As C_Clientes
|
Public clientes As C_Clientes
|
||||||
@@ -59,7 +60,7 @@ Sub Class_Globals
|
|||||||
Dim batt As Int
|
Dim batt As Int
|
||||||
Dim skmt As SQL
|
Dim skmt As SQL
|
||||||
Dim montoActual, clientesTotal, clientesVenta, clientesVisitados,almacen, rutaPreventa As String
|
Dim montoActual, clientesTotal, clientesVenta, clientesVisitados,almacen, rutaPreventa As String
|
||||||
Dim server, fechaRuta As String
|
Dim DBReqServer, fechaRuta As String
|
||||||
Dim Logger As Boolean
|
Dim Logger As Boolean
|
||||||
Dim mac_impresora As String
|
Dim mac_impresora As String
|
||||||
Dim Phn As PhoneId
|
Dim Phn As PhoneId
|
||||||
@@ -108,6 +109,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
B4XPages.GetManager.LogEvents = True
|
B4XPages.GetManager.LogEvents = True
|
||||||
Root = Root1
|
Root = Root1
|
||||||
Root.LoadLayout("login")
|
Root.LoadLayout("login")
|
||||||
|
s.Initialize(Me, "Subs")
|
||||||
B4XPages.SetTitle(Me, "Intmex Preventa")
|
B4XPages.SetTitle(Me, "Intmex Preventa")
|
||||||
login.Initialize
|
login.Initialize
|
||||||
B4XPages.AddPage("Login", login)
|
B4XPages.AddPage("Login", login)
|
||||||
@@ -175,7 +177,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
C.Close
|
C.Close
|
||||||
' server = "http://keymon.com.mx:1782"
|
' server = "http://keymon.com.mx:1782"
|
||||||
'server = "http://201.99.139.28:1783"
|
'server = "http://201.99.139.28:1783"
|
||||||
' reqManager.Initialize(Me, server)
|
' reqManager.Initialize(Me, DBReqServer)
|
||||||
l_version.Text = Application.VersionName
|
l_version.Text = Application.VersionName
|
||||||
'este codigo es para lo del menu
|
'este codigo es para lo del menu
|
||||||
' PopupMenu.Initialize("PopupMenu", b_menu)
|
' PopupMenu.Initialize("PopupMenu", b_menu)
|
||||||
@@ -254,8 +256,8 @@ Sub B4XPage_Appear
|
|||||||
Dim ph As Phone 'Get Id Device
|
Dim ph As Phone 'Get Id Device
|
||||||
Dim DeviceID As String = ph.GetSettings("android_id").ToUpperCase
|
Dim DeviceID As String = ph.GetSettings("android_id").ToUpperCase
|
||||||
LogColor($"////////////////// DeviceID: ${DeviceID} ////////////////// "$, Colors.Blue)
|
LogColor($"////////////////// DeviceID: ${DeviceID} ////////////////// "$, Colors.Blue)
|
||||||
server = Starter.server
|
DBReqServer = Starter.DBReqServer
|
||||||
reqManager.Initialize(Me, Starter.server)
|
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||||
tgl.Initialize()
|
tgl.Initialize()
|
||||||
If Not(Starter.gps.GPSEnabled) Then
|
If Not(Starter.gps.GPSEnabled) Then
|
||||||
ToastMessageShow("Es necesario tener el GPS encendido", True)
|
ToastMessageShow("Es necesario tener el GPS encendido", True)
|
||||||
@@ -292,6 +294,26 @@ Sub B4XPage_Appear
|
|||||||
'Obtenemos el usuario registrado
|
'Obtenemos el usuario registrado
|
||||||
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
|
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
|
||||||
dameUsuario
|
dameUsuario
|
||||||
|
If Not(s.CheckNotificationAccess) Then
|
||||||
|
Msgbox2Async($"Se necesita acceso a las notificaciones, haga clic en "Aceptar" y en la siguiente pantalla permita el acceso a la aplicación "${Application.LabelName}"."$, "Permisos necesarios", "Aceptar", "Cancelar", "", Null, True)
|
||||||
|
Wait For Msgbox_Result (resultado As Int)
|
||||||
|
If resultado = DialogResponse.POSITIVE Then
|
||||||
|
Dim In As Intent
|
||||||
|
In.Initialize("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS", "")
|
||||||
|
StartActivity(In)
|
||||||
|
End If
|
||||||
|
' Private cd1 As ColorDrawable
|
||||||
|
' cd1.Initialize(Colors.red, 10dip)
|
||||||
|
' b_notifAccess.Background = cd1
|
||||||
|
' b_notifAccess.TextColor = Colors.White
|
||||||
|
' b_notifAccess.Text = "Activar Permisos"
|
||||||
|
Else
|
||||||
|
' Private cd1 As ColorDrawable
|
||||||
|
' cd1.Initialize(Colors.RGB(109, 221, 101), 10dip)
|
||||||
|
' b_notifAccess.Background = cd1
|
||||||
|
' b_notifAccess.TextColor = Colors.White
|
||||||
|
' b_notifAccess.Text = "Permisos Activos"
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||||
|
|
||||||
@@ -325,7 +347,7 @@ Sub Entrar_Click
|
|||||||
If user.Text = "ALTERNO" Then
|
If user.Text = "ALTERNO" Then
|
||||||
c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
|
c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
|
||||||
c.Position =0
|
c.Position =0
|
||||||
server = c.GetString("CAT_CO_CONFIGURACION")
|
DBReqServer = c.GetString("CAT_CO_CONFIGURACION")
|
||||||
alterno = c.GetString("CAT_CO_RESULTADO")
|
alterno = c.GetString("CAT_CO_RESULTADO")
|
||||||
c.Close
|
c.Close
|
||||||
If alterno = 1 Then
|
If alterno = 1 Then
|
||||||
@@ -337,10 +359,10 @@ Sub Entrar_Click
|
|||||||
End If
|
End If
|
||||||
c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
|
c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
|
||||||
c.Position =0
|
c.Position =0
|
||||||
server = c.GetString("CAT_CO_CONFIGURACION")
|
DBReqServer = c.GetString("CAT_CO_CONFIGURACION")
|
||||||
user.Text = server
|
user.Text = DBReqServer
|
||||||
c.Close
|
c.Close
|
||||||
' reqManager.Initialize(Me, server)
|
' reqManager.Initialize(Me, DBReqServer)
|
||||||
else if user.Text = "KMTS1" Then
|
else if user.Text = "KMTS1" Then
|
||||||
skmt.ExecNonQuery("delete from usuarioa")
|
skmt.ExecNonQuery("delete from usuarioa")
|
||||||
skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)", Array As Object(user.Text, pass.Text))
|
skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)", Array As Object(user.Text, pass.Text))
|
||||||
@@ -641,7 +663,8 @@ Sub i_engrane_Click
|
|||||||
ime.HideKeyboard
|
ime.HideKeyboard
|
||||||
lv_server.AddSingleLine("http://keymon.lat:1782")
|
lv_server.AddSingleLine("http://keymon.lat:1782")
|
||||||
If user.Text = "KMTS1" Then lv_server.AddSingleLine("http://10.0.0.205:1782")
|
If user.Text = "KMTS1" Then lv_server.AddSingleLine("http://10.0.0.205:1782")
|
||||||
l_server.Text = Starter.server
|
' lv_server.AddSingleLine("http://40.123.36.38:1782")
|
||||||
|
l_server.Text = Starter.DBReqServer
|
||||||
Subs.panelVisible(p_appUpdate,0,0)
|
Subs.panelVisible(p_appUpdate,0,0)
|
||||||
If user.Text.trim = "KMTS1" Then b_importarBD.Visible = True Else b_importarBD.Visible = False
|
If user.Text.trim = "KMTS1" Then b_importarBD.Visible = True Else b_importarBD.Visible = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -659,9 +682,10 @@ Sub Entrar_LongClick
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub lv_server_ItemClick (Position As Int, Value As Object)
|
Private Sub lv_server_ItemClick (Position As Int, Value As Object)
|
||||||
Starter.server = Value
|
Starter.DBReqServer = Value
|
||||||
l_server.Text = Value
|
l_server.Text = Value
|
||||||
Starter.reqManager.Initialize(Me, Value)
|
Starter.reinicializaReqManager(Value)
|
||||||
|
' Starter.reqManager.Initialize(Me, Value)
|
||||||
ToastMessageShow("Servidor modificado", False)
|
ToastMessageShow("Servidor modificado", False)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
s.Close
|
s.Close
|
||||||
btAdmin.Initialize("BlueTeeth")
|
btAdmin.Initialize("BlueTeeth")
|
||||||
cmp20.Initialize("Printer")
|
cmp20.Initialize("Printer")
|
||||||
reqManager.Initialize(Me, B4XPages.MainPage.SERVER)
|
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
|
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
|
||||||
Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
|
Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
|
||||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
|
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
If File.Exists(ruta, "kmt.db") = False Then
|
If File.Exists(ruta, "kmt.db") = False Then
|
||||||
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
|
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
|
||||||
End If
|
End If
|
||||||
reqManager.Initialize(Me, B4XPages.MainPage.SERVER)
|
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||||
' skmt.Initialize(ruta,"kmt.db", True)
|
' skmt.Initialize(ruta,"kmt.db", True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -310,13 +310,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
l_rutasuplencia.Visible = False
|
l_rutasuplencia.Visible = False
|
||||||
|
|
||||||
Else If s.RowCount > 0 Then
|
Else If s.RowCount > 0 Then
|
||||||
|
|
||||||
Label22.Visible = True
|
Label22.Visible = True
|
||||||
l_rutasuplencia.Visible = True
|
l_rutasuplencia.Visible = True
|
||||||
l_rutasuplencia.Text = s.GetString("RS_RUTA")
|
l_rutasuplencia.Text = s.GetString("RS_RUTA")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub B4XPage_Appear
|
Sub B4XPage_Appear
|
||||||
@@ -325,7 +322,7 @@ Sub B4XPage_Appear
|
|||||||
rd.respaldaPaquetes
|
rd.respaldaPaquetes
|
||||||
HORAINGRESO ="000000"
|
HORAINGRESO ="000000"
|
||||||
Btn_Ubicar.Left = (Root.Width/2) - (Btn_Ubicar.Width/2)
|
Btn_Ubicar.Left = (Root.Width/2) - (Btn_Ubicar.Width/2)
|
||||||
' B4XPages.MainPage.reqManager.Initialize(Me, B4XPages.MainPage.SERVER)
|
' B4XPages.MainPage.reqManager.Initialize(Me, Starter.DBReqServer)
|
||||||
PASO =0
|
PASO =0
|
||||||
If Not(Starter.gps.GPSEnabled) Then
|
If Not(Starter.gps.GPSEnabled) Then
|
||||||
If Starter.marcaCel <> "Sony" Then ToastMessageShow("Es necesario tener el GPS encendido", True)
|
If Starter.marcaCel <> "Sony" Then ToastMessageShow("Es necesario tener el GPS encendido", True)
|
||||||
@@ -1641,7 +1638,7 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub connecta_Click
|
Sub connecta_Click
|
||||||
B4XPages.MainPage.reqManager.Initialize(Me, Starter.server)
|
B4XPages.MainPage.reqManager.Initialize(Me, Starter.DBReqServer)
|
||||||
ime.HideKeyboard
|
ime.HideKeyboard
|
||||||
connecta1 = connecta1 + 1
|
connecta1 = connecta1 + 1
|
||||||
' imei = p.GetDeviceId
|
' imei = p.GetDeviceId
|
||||||
@@ -1687,18 +1684,18 @@ Sub connecta_Click
|
|||||||
ToastMessageShow("Validando Conexión." , True)
|
ToastMessageShow("Validando Conexión." , True)
|
||||||
|
|
||||||
' If connecta1 / 2 = 1 Then
|
' If connecta1 / 2 = 1 Then
|
||||||
' 'SERVER = "http://177.244.63.54:1782"
|
' 'Starter.DBReqServer = "http://177.244.63.54:1782"
|
||||||
' 'SERVER = "http://keymon.com.mx:1782"
|
' 'Starter.DBReqServer = "http://keymon.com.mx:1782"
|
||||||
' 'SERVER = "http://201.99.139.28:1782"
|
' 'Starter.DBReqServer = "http://201.99.139.28:1782"
|
||||||
'' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782"
|
'' Starter.DBReqServer = "http://187.189.244.154:1782"
|
||||||
'' SERVER = "http://10.0.0.205:1782"
|
'' Starter.DBReqServer = "http://10.0.0.205:1782"
|
||||||
' Else
|
' Else
|
||||||
' 'SERVER = "http://keymon.com.mx:1782"
|
' 'SERVER = "http://keymon.com.mx:1782"
|
||||||
' 'SERVER = "http://201.99.139.28:1782"
|
' 'SERVER = "http://201.99.139.28:1782"
|
||||||
' 'SERVER = "http://177.244.63.54:1782"
|
' 'SERVER = "http://177.244.63.54:1782"
|
||||||
'' B4XPages.MainPage.SERVER = "http://187.189.244.154:1782"
|
'' Starter.DBReqServer = "http://187.189.244.154:1782"
|
||||||
'' SERVER = "http://10.0.0.205:1782"
|
'' SERVER = "http://10.0.0.205:1782"
|
||||||
' B4XPages.MainPage.reqManager.Initialize(Me, Starter.server)
|
' B4XPages.MainPage.reqManager.Initialize(Me, Starter.DBReqServer)
|
||||||
' End If
|
' End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Sub Class_Globals
|
|||||||
Private Root As B4XView 'ignore
|
Private Root As B4XView 'ignore
|
||||||
Private xui As XUI 'ignore
|
Private xui As XUI 'ignore
|
||||||
Dim skmt, rkmt As SQL
|
Dim skmt, rkmt As SQL
|
||||||
Dim rp As RuntimePermissions
|
' Dim rp As RuntimePermissions
|
||||||
Dim safePath As String
|
Dim safePath As String
|
||||||
Dim fechaHoy As String
|
Dim fechaHoy As String
|
||||||
Dim skmtAttached As Boolean = False
|
Dim skmtAttached As Boolean = False
|
||||||
@@ -19,7 +19,7 @@ Public Sub Initialize As Object
|
|||||||
' Log("************************** " & safePath)
|
' Log("************************** " & safePath)
|
||||||
Dim Dirp As String = File.DirRootExternal
|
Dim Dirp As String = File.DirRootExternal
|
||||||
Dim Dir As String
|
Dim Dir As String
|
||||||
Dim Dir2 As String
|
' Dim Dir2 As String
|
||||||
Try
|
Try
|
||||||
File.MakeDir(Dirp,"/kmts")
|
File.MakeDir(Dirp,"/kmts")
|
||||||
Dir = "/kmts"
|
Dir = "/kmts"
|
||||||
@@ -30,7 +30,8 @@ Public Sub Initialize As Object
|
|||||||
End Try
|
End Try
|
||||||
' safePath = rp.GetSafeDirDefaultExternal("./")
|
' safePath = rp.GetSafeDirDefaultExternal("./")
|
||||||
safePath = Dirp & Dir
|
safePath = Dirp & Dir
|
||||||
rkmt.Initialize(safePath,"rkmt.km", True)
|
Private name() As String = Regex.split(" ", Application.LabelName)
|
||||||
|
rkmt.Initialize(safePath,$"${name(0)}.rkmt.km"$, True)
|
||||||
skmt.Initialize(File.DirInternal,"kmt.db", False)
|
skmt.Initialize(File.DirInternal,"kmt.db", False)
|
||||||
rkmt.ExecNonQuery($"create table if not exists pedidos (pe_folio NUMERIC, pe_desc NUMERIC, pe_costo_sin TEXT, pe_ruta TEXT, pe_cedis TEXT, pe_costo_tot NUMERIC, pe_costou NUMERIC, pe_cant NUMERIC, pe_pronombre TEXT, pe_proid TEXT, pe_cliente TEXT, pe_fecha TEXT, pe_usuario TEXT)"$)
|
rkmt.ExecNonQuery($"create table if not exists pedidos (pe_folio NUMERIC, pe_desc NUMERIC, pe_costo_sin TEXT, pe_ruta TEXT, pe_cedis TEXT, pe_costo_tot NUMERIC, pe_costou NUMERIC, pe_cant NUMERIC, pe_pronombre TEXT, pe_proid TEXT, pe_cliente TEXT, pe_fecha TEXT, pe_usuario TEXT)"$)
|
||||||
rkmt.ExecNonQuery($"create table if not exists inventarios (cat_gp_iniciativa TEXT, cat_gp_tipoprod TEXT, cat_gp_dev TEXT, cat_gp_almacen NUMERIC, cat_gp_id TEXT, cat_gp_nombre TEXT, cat_gp_imp1 TEXT, cat_gp_imp2 TEXT, cat_gp_precio TEXT, cat_gp_clasif TEXT, cat_gp_sts TEXT, cat_gp_tipo TEXT, cat_gp_subtipo TEXT, cat_gp_tipoprod2 TEXT, fecha TEXT)"$)
|
rkmt.ExecNonQuery($"create table if not exists inventarios (cat_gp_iniciativa TEXT, cat_gp_tipoprod TEXT, cat_gp_dev TEXT, cat_gp_almacen NUMERIC, cat_gp_id TEXT, cat_gp_nombre TEXT, cat_gp_imp1 TEXT, cat_gp_imp2 TEXT, cat_gp_precio TEXT, cat_gp_clasif TEXT, cat_gp_sts TEXT, cat_gp_tipo TEXT, cat_gp_subtipo TEXT, cat_gp_tipoprod2 TEXT, fecha TEXT)"$)
|
||||||
@@ -47,6 +48,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
'load the layout to Root
|
'load the layout to Root
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
'Revisa si esta montada "kmt.db" como "skmt" y si no, se monta.
|
||||||
Sub revisaSkmtAttached
|
Sub revisaSkmtAttached
|
||||||
skmtAttached = False
|
skmtAttached = False
|
||||||
Dim rs As ResultSet = rkmt.ExecQuery("SELECT * FROM pragma_database_list")
|
Dim rs As ResultSet = rkmt.ExecQuery("SELECT * FROM pragma_database_list")
|
||||||
@@ -109,7 +111,7 @@ End Sub
|
|||||||
'Agrega una columna a la tabla especificada.
|
'Agrega una columna a la tabla especificada.
|
||||||
'Hay que indicar el "tipo" de la columna (TEXT, INTEGER, ETC)
|
'Hay que indicar el "tipo" de la columna (TEXT, INTEGER, ETC)
|
||||||
'Ej. agregaColumna("TABLA", "COLUMNA", "TIPO")
|
'Ej. agregaColumna("TABLA", "COLUMNA", "TIPO")
|
||||||
Sub agregaColumna(tabla As String, columna As String, tipo As String)
|
Sub agregaColumna(tabla As String, columna As String, tipo As String) 'ignore
|
||||||
Try 'Intentamos usar "pragma_table_info" para revisar si existe la columna en la tabla
|
Try 'Intentamos usar "pragma_table_info" para revisar si existe la columna en la tabla
|
||||||
Private c As Cursor = B4XPages.MainPage.skmt.ExecQuery($"SELECT COUNT(*) AS fCol FROM pragma_table_info('${tabla}') WHERE name='${columna}'"$)
|
Private c As Cursor = B4XPages.MainPage.skmt.ExecQuery($"SELECT COUNT(*) AS fCol FROM pragma_table_info('${tabla}') WHERE name='${columna}'"$)
|
||||||
c.Position = 0
|
c.Position = 0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -17,6 +17,8 @@ ModuleBookmarks22=
|
|||||||
ModuleBookmarks23=
|
ModuleBookmarks23=
|
||||||
ModuleBookmarks24=
|
ModuleBookmarks24=
|
||||||
ModuleBookmarks25=
|
ModuleBookmarks25=
|
||||||
|
ModuleBookmarks26=
|
||||||
|
ModuleBookmarks27=
|
||||||
ModuleBookmarks3=
|
ModuleBookmarks3=
|
||||||
ModuleBookmarks4=
|
ModuleBookmarks4=
|
||||||
ModuleBookmarks5=
|
ModuleBookmarks5=
|
||||||
@@ -43,6 +45,8 @@ ModuleBreakpoints22=
|
|||||||
ModuleBreakpoints23=
|
ModuleBreakpoints23=
|
||||||
ModuleBreakpoints24=
|
ModuleBreakpoints24=
|
||||||
ModuleBreakpoints25=
|
ModuleBreakpoints25=
|
||||||
|
ModuleBreakpoints26=
|
||||||
|
ModuleBreakpoints27=
|
||||||
ModuleBreakpoints3=
|
ModuleBreakpoints3=
|
||||||
ModuleBreakpoints4=
|
ModuleBreakpoints4=
|
||||||
ModuleBreakpoints5=
|
ModuleBreakpoints5=
|
||||||
@@ -54,21 +58,23 @@ ModuleClosedNodes0=
|
|||||||
ModuleClosedNodes1=
|
ModuleClosedNodes1=
|
||||||
ModuleClosedNodes10=
|
ModuleClosedNodes10=
|
||||||
ModuleClosedNodes11=
|
ModuleClosedNodes11=
|
||||||
ModuleClosedNodes12=1
|
ModuleClosedNodes12=
|
||||||
ModuleClosedNodes13=9,11,15
|
ModuleClosedNodes13=9,11,15
|
||||||
ModuleClosedNodes14=9,10
|
ModuleClosedNodes14=9,10
|
||||||
ModuleClosedNodes15=
|
ModuleClosedNodes15=
|
||||||
ModuleClosedNodes16=
|
ModuleClosedNodes16=
|
||||||
ModuleClosedNodes17=
|
ModuleClosedNodes17=
|
||||||
ModuleClosedNodes18=3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
|
ModuleClosedNodes18=
|
||||||
ModuleClosedNodes19=
|
ModuleClosedNodes19=3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
|
||||||
ModuleClosedNodes2=
|
ModuleClosedNodes2=
|
||||||
ModuleClosedNodes20=
|
ModuleClosedNodes20=
|
||||||
ModuleClosedNodes21=2
|
ModuleClosedNodes21=
|
||||||
ModuleClosedNodes22=1
|
ModuleClosedNodes22=2
|
||||||
ModuleClosedNodes23=
|
ModuleClosedNodes23=
|
||||||
ModuleClosedNodes24=49,50,52,53,55,58,61
|
ModuleClosedNodes24=1
|
||||||
ModuleClosedNodes25=
|
ModuleClosedNodes25=
|
||||||
|
ModuleClosedNodes26=49,50,52,53,55,58,61
|
||||||
|
ModuleClosedNodes27=
|
||||||
ModuleClosedNodes3=
|
ModuleClosedNodes3=
|
||||||
ModuleClosedNodes4=
|
ModuleClosedNodes4=
|
||||||
ModuleClosedNodes5=3
|
ModuleClosedNodes5=3
|
||||||
@@ -76,6 +82,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=1
|
ModuleClosedNodes8=1
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=Starter,Service_Start,48,0,B4XMainPage,B4XPage_Appear,248,0,C_Cliente,B4XPage_Appear,223,0,C_Cliente,B4XPage_Created,199,0,C_Principal,B4XPage_Appear,316,0,C_Principal,B4XPage_Created,312,0,C_Cliente,JobDone,932,0,C_Cliente,mandaPendientes,842,0,C_Cliente,cb_factura_CheckedChange,812,0,C_Cliente,Guardar_Click,494,0
|
NavigationStack=C_Subs,mandaPendientes,592,0,B4XMainPage,B4XPage_Appear,244,1,NotificationService,Service_Destroy,72,0,NotificationService,NotiMon_NotificationPosted,83,0,B4XMainPage,i_engrane_Click,659,0,C_RespaldoDiario,Class_Globals,0,0,C_RespaldoDiario,Initialize,23,6,B4XMainPage,ocultaProgreso,653,0,B4XMainPage,lv_server_ItemClick,684,0,B4XMainPage,Entrar_LongClick,676,0,B4XMainPage,i_engrane_LongClick,672,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=2,23,12,15,13,4,24,14,8,21
|
VisibleModules=2,25,23,12,15,13,4,26,14,8,22,9,16,27
|
||||||
|
|||||||
@@ -13,15 +13,17 @@ Sub Process_Globals
|
|||||||
'These global variables will be declared once when the application starts.
|
'These global variables will be declared once when the application starts.
|
||||||
'These variables can be accessed from all modules.
|
'These variables can be accessed from all modules.
|
||||||
Public gps As GPS
|
Public gps As GPS
|
||||||
|
Dim skmt As SQL
|
||||||
|
Dim s As C_Subs
|
||||||
Dim ph As Phone
|
Dim ph As Phone
|
||||||
Public rp As RuntimePermissions
|
Public rp As RuntimePermissions
|
||||||
Public FLP As FusedLocationProvider
|
Public FLP As FusedLocationProvider
|
||||||
' Private flpStarted As Boolean
|
' Private flpStarted As Boolean
|
||||||
Dim reqManager As DBRequestManager
|
Dim reqManager As DBRequestManager
|
||||||
Dim server As String = "http://187.189.244.154:1782"
|
Dim DBReqServer As String = "http://187.189.244.154:1782"
|
||||||
' Dim server As String = "http://187.189.244.154:1783"
|
' Dim DBReqServer As String = "http://187.189.244.154:1783"
|
||||||
' Dim server As String = "http://10.0.0.205:1783"
|
' Dim DBReqServer As String = "http://10.0.0.205:1783"
|
||||||
' Dim server As String = "http://11.0.0.15:1782"
|
' Dim DBReqServer As String = "http://11.0.0.15:1782"
|
||||||
Dim Timer1 As Timer
|
Dim Timer1 As Timer
|
||||||
Dim Interval As Int = 10
|
Dim Interval As Int = 10
|
||||||
Dim ruta As String = File.DirInternal
|
Dim ruta As String = File.DirInternal
|
||||||
@@ -37,6 +39,8 @@ Sub Service_Create
|
|||||||
'This is the program entry point.
|
'This is the program entry point.
|
||||||
'This is a good place to load resources that are not specific to a single activity.
|
'This is a good place to load resources that are not specific to a single activity.
|
||||||
gps.Initialize("GPS")
|
gps.Initialize("GPS")
|
||||||
|
s.Initialize(Me, "Subs") 'Inicializamos la clase Subs
|
||||||
|
skmt = s.inicializaBD(File.DirInternal, "kmt.db")
|
||||||
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") 'Para Push FirebaseMessaging
|
' CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") 'Para Push FirebaseMessaging
|
||||||
Timer1.Initialize("Timer1", Interval * 1000)
|
Timer1.Initialize("Timer1", Interval * 1000)
|
||||||
Timer1.Enabled = True
|
Timer1.Enabled = True
|
||||||
@@ -52,7 +56,8 @@ Sub Service_Start (StartingIntent As Intent)
|
|||||||
Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
|
Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
|
||||||
Subs.revisaBD
|
Subs.revisaBD
|
||||||
' Log(marcaCel)
|
' Log(marcaCel)
|
||||||
reqManager.Initialize(Me, server)
|
If s.traeDBReqServerDeBD(skmt) <> "N/A" Then DBReqServer = s.traeDBReqServerDeBD(skmt)
|
||||||
|
reqManager.Initialize(Me, DBReqServer)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Timer1_Tick
|
Private Sub Timer1_Tick
|
||||||
@@ -75,9 +80,7 @@ End Sub
|
|||||||
Sub ENVIA_ULTIMA_GPS
|
Sub ENVIA_ULTIMA_GPS
|
||||||
Dim logger As Boolean = False
|
Dim logger As Boolean = False
|
||||||
If logger Then LogColor("Iniciamos ENVIA_ULTIMA_GPS", Colors.Magenta)
|
If logger Then LogColor("Iniciamos ENVIA_ULTIMA_GPS", Colors.Magenta)
|
||||||
Dim skmt As SQL
|
|
||||||
Dim cmd As DBCommand
|
Dim cmd As DBCommand
|
||||||
skmt.Initialize(ruta,"kmt.db", False)
|
|
||||||
' cmd.Initialize
|
' cmd.Initialize
|
||||||
' cmd.Name = "select_fechat"
|
' cmd.Name = "select_fechat"
|
||||||
' B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "fechat")
|
' B4XPages.MainPage.reqManager.ExecuteQuery(cmd , 0, "fechat")
|
||||||
@@ -114,3 +117,12 @@ Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
|
|||||||
Subs.errorLog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)", Array As Object (Subs.fechaKMT(DateTime.now), logs))
|
Subs.errorLog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)", Array As Object (Subs.fechaKMT(DateTime.now), logs))
|
||||||
Return True
|
Return True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
'Inicializa el reqServer con la dirección dada y lo guarda en CAT_VARIABLES.
|
||||||
|
Sub reinicializaReqManager(srv As String)
|
||||||
|
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", srv))
|
||||||
|
DBReqServer = srv
|
||||||
|
reqManager.Initialize(Me, srv)
|
||||||
|
' LogColor(srv, Colors.red)
|
||||||
|
End Sub
|
||||||
@@ -32,6 +32,7 @@ Version=10.2
|
|||||||
'#AdditionalJar: com.android.support:support-v4
|
'#AdditionalJar: com.android.support:support-v4
|
||||||
'#AdditionalJar: com.google.android.gms:play-services-location
|
'#AdditionalJar: com.google.android.gms:play-services-location
|
||||||
|
|
||||||
|
|
||||||
Sub Process_Globals
|
Sub Process_Globals
|
||||||
Private nid As Int = 51042
|
Private nid As Int = 51042
|
||||||
Private Tracking As Boolean
|
Private Tracking As Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user