mirror of
https://github.com/KeymonSoft/Nuevo_Torrado_V2.git
synced 2026-04-19 21:59:31 +00:00
..
This commit is contained in:
240
B4XMainPage.bas
240
B4XMainPage.bas
@@ -1,240 +0,0 @@
|
||||
B4A=true
|
||||
Group=Default Group
|
||||
ModulesStructureVersion=1
|
||||
Type=Class
|
||||
Version=9.85
|
||||
@EndOfDesignText@
|
||||
#Region Shared Files
|
||||
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\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
|
||||
|
||||
Dim principal As C_principal
|
||||
Dim datos As c_datos
|
||||
Private b_iniciar As Button
|
||||
Private Contraseña As EditText
|
||||
Private Usuario As EditText
|
||||
Dim user As String
|
||||
Dim db As SQL
|
||||
Dim reqManager As DBRequestManager
|
||||
Public updateAvailable As C_UpdateAvailable
|
||||
Private p_configuracion As Panel
|
||||
Private p_adorno As Panel
|
||||
Private et_server As EditText
|
||||
Private lv_server As ListView
|
||||
Dim Logger As Boolean
|
||||
Private b_guarda_server As Button
|
||||
Public Provider As FileProvider
|
||||
Private l_version As Label
|
||||
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)
|
||||
Root = Root1
|
||||
Root.LoadLayout("MainPage")
|
||||
principal.Initialize
|
||||
B4XPages.AddPage("principal",principal)
|
||||
datos.Initialize
|
||||
B4XPages.AddPage("datos",datos)
|
||||
updateAvailable.Initialize
|
||||
B4XPages.AddPage("updateAvailable", updateAvailable)
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
db.Initialize(Starter.rutaBD,"kmt.db",True)
|
||||
Provider.Initialize
|
||||
l_version.Text = Application.VersionName
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
If Starter.muestraProgreso = 1 Then
|
||||
muestraProgreso("Descargando actualización")
|
||||
Starter.muestraProgreso = 0
|
||||
End If
|
||||
p_configuracion.Width = Root.Width
|
||||
p_configuracion.Height = Root.Height
|
||||
p_configuracion.Visible = False
|
||||
p_adorno.Width = Root.Width * 0.85
|
||||
p_adorno.Height = Root.Height * 0.80
|
||||
|
||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
|
||||
Wait For b4xpage_PermissionResult (Permission As String, Result As Boolean)
|
||||
If Result Then
|
||||
StartService(Tracker)
|
||||
Log("Start Tracker")
|
||||
Else
|
||||
ToastMessageShow("Sin permisos para GPS", True)
|
||||
End If
|
||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION)
|
||||
Wait For b4xpage_PermissionResult (Permission As String, Result As Boolean)
|
||||
If Result Then
|
||||
StartService(Tracker)
|
||||
Log("Start Tracker")
|
||||
Else
|
||||
ToastMessageShow("Sin permisos para GPS", True)
|
||||
End If
|
||||
Log(Result)
|
||||
|
||||
If Not(Starter.GPS.GPSEnabled) Then
|
||||
ToastMessageShow("Debe Activar el GPS del Equipo.", True)
|
||||
StartActivity(Starter.GPS.LocationSettingsIntent)
|
||||
Else
|
||||
Starter.GPS.Start(0, 0)
|
||||
' If Starter.ubicacionActual.Latitude <> 0 Then GPS_LocationChanged(Starter.ubicacionActual)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
' Log(Location1.Latitude)
|
||||
End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Private Sub b_iniciar_Click
|
||||
If Usuario.Text <> "" Then
|
||||
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "select_usuario_torra"
|
||||
cmd.Parameters = Array As Object(Usuario.Text, Contraseña.Text)
|
||||
reqManager.ExecuteQuery(cmd , 0, "usuario")
|
||||
user = Usuario.Text
|
||||
Else
|
||||
MsgboxAsync("Llena los datos de acceso","Atención")
|
||||
' B4XPages.ShowPage ("principal")
|
||||
End If
|
||||
|
||||
' B4XPages.ShowPage ("principal")
|
||||
Log(Starter.latitud & Starter.longitud)
|
||||
End Sub
|
||||
|
||||
Sub JobDone(Job As HttpJob)
|
||||
If Job.Success = False Then
|
||||
ToastMessageShow("Error: " & Job.ErrorMessage, True)
|
||||
Else
|
||||
LogColor("JobDone: '" & reqManager.HandleJob(Job).tag & "' - Registros: " & reqManager.HandleJob(Job).Rows.Size, Colors.Green) 'Mod por CHV - 211110
|
||||
If Job.JobName = "DBRequest" Then
|
||||
Dim result As DBResult = reqManager.HandleJob(Job)
|
||||
If result.Tag = "usuario" Then 'query tag
|
||||
For Each records() As Object In result.Rows
|
||||
For Each k As String In result.Columns.Keys
|
||||
Log(result.Tag & ": " & k & ": " & records(result.Columns.Get(k)))
|
||||
Next
|
||||
If records(result.Columns.Get ("USUARIO")) = "OKActivo" Then
|
||||
Starter.almacen = records(result.Columns.Get ("CAT_LO_AGENCIA"))
|
||||
B4XPages.ShowPage ("principal")
|
||||
Log(Starter.almacen)
|
||||
Else
|
||||
ToastMessageShow ("Datos incorrectos",True)
|
||||
End If
|
||||
Next
|
||||
If result.Rows.Size = 0 Then
|
||||
ToastMessageShow ("Datos incorrectos",True)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
If p_configuracion.Visible = True Then
|
||||
p_configuracion.Visible = False
|
||||
Else
|
||||
B4XPages.ShowPage("Mainpage")
|
||||
End If
|
||||
|
||||
' Return True
|
||||
Return False
|
||||
End Sub
|
||||
|
||||
Private Sub ImageView5_Click
|
||||
p_configuracion.Visible = True
|
||||
lv_server.Clear
|
||||
lv_server.AddSingleLine("http://keymon.lat:1788")
|
||||
If Usuario.Text = "KMTS1" Then lv_server.AddSingleLine("http://11.0.0.196:1782")
|
||||
' l_server.Text = Starter.server
|
||||
et_server.Text = Starter.DBReqServer
|
||||
l_version.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub p_configuracion_Click
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub lv_server_ItemClick (Position As Int, Value As Object)
|
||||
Starter.DBReqServer = Value
|
||||
' l_server.Text = Value
|
||||
et_server.Text = Value
|
||||
Starter.reqManager.Initialize(Me, Value)
|
||||
Log(Value)
|
||||
ToastMessageShow("Servidor modificado", False)
|
||||
End Sub
|
||||
|
||||
Private Sub b_guarda_server_Click
|
||||
Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER"))
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",et_server.text))
|
||||
Starter.DBReqServer = et_server.text
|
||||
Log("Inicializamos reqManager con " & Starter.DBReqServer)
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
CallSubDelayed(Starter, "reinicializaReqManager")
|
||||
p_configuracion.Visible= False
|
||||
l_version.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub b_regresa_Click
|
||||
p_configuracion.Visible = False
|
||||
l_version.Visible = True
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub b_enviarbd_Click
|
||||
' copiaDB
|
||||
' Sleep(1000)
|
||||
Dim FileName As String = "kmt.db"
|
||||
'copy the shared file to the shared folder
|
||||
Log("xxxxxx:"&Provider.SharedFolder)
|
||||
Sleep(1000)
|
||||
File.Copy(File.DirInternal, FileName, Provider.SharedFolder, FileName)
|
||||
Dim email As Email
|
||||
email.To.Add("soporte@keymonsoft.com")
|
||||
email.Subject = "Envio Base de dados AREstrategicas"
|
||||
email.Attachments.Add(Provider.GetFileUri(FileName))
|
||||
' email.Attachments.Add(Provider.GetFileUri(FileName)) 'second attachment
|
||||
Dim in As Intent = email.GetIntent
|
||||
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
|
||||
StartActivity(in)
|
||||
End Sub
|
||||
|
||||
Private Sub b_actualizar_app_Click
|
||||
StartService(appUpdater)
|
||||
End Sub
|
||||
|
||||
' appUpdater - Mostramos el anuncio de que se esta descargando el nuevo apk
|
||||
Sub muestraProgreso(mensaje As String)
|
||||
ProgressDialogShow(mensaje)
|
||||
End Sub
|
||||
'
|
||||
' appUpdater - Ocultamos el anuncio de que se esta descargando el nuevo apk
|
||||
Sub ocultaProgreso
|
||||
ProgressDialogHide
|
||||
End Sub
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB |
27
ar.txt
27
ar.txt
@@ -1,27 +0,0 @@
|
||||
##########
|
||||
########## ARESTRATEGICAS
|
||||
##########
|
||||
|
||||
sql.select_usuario_AREstrategicas = select 'OK' || cat_lo_estatus as usuario, cat_lo_agencia from ARESTRATEGICAS.cat_logins where cat_lo_usuario = (?) and cat_lo_contrasena = (?)
|
||||
|
||||
sql.select_datosgenerales_AR = SELECT PR_KT_CREDITO, PR_CD_NOMBRE, PR_CD_RFC, PR_CD_CURP, PR_CD_CALLE, PR_CD_NUM_EXT, PR_CD_NUM_INT, PR_CD_ALCALDIA, PR_CD_MUNICIPIO, PR_CD_ENTIDAD, PR_CD_CP, PR_CD_SEXO, PR_CD_FECHA_NAC, PR_CD_EDAD, PR_CD_EMAIL FROM ARESTRATEGICAS.vi_informacion WHERE PR_KT_ESTATUS <> 'Retirada' and PR_KT_UASIGNADOV is not null and PR_KT_CREDITO IN (SELECT PR_KT_CREDITO FROM ARESTRATEGICAS.pr_kmt_gral WHERE PR_KT_ESTATUS<>'Retirada' and PR_KT_UASIGNADOV = ?)
|
||||
|
||||
sql.select_datosfinancieros_AR = SELECT PR_KT_CREDITO, PR_KT_PRODUCTO, PR_KT_AGENCIA, PR_CF_SALDO_TOTAL, PR_CF_LIQUIDACION, PR_CF_TOTAL_A_PAGAR_DESC, PR_CF_LIQUIDACION, PR_CA_DIAS_VENCIDOS, PR_CA_DIAS_ATRASO_ACT, PR_CA_FECHA_ATRASO, PR_CA_REFERENCIA1, PR_CA_REFERENCIA2 FROM ARESTRATEGICAS.vi_informacion WHERE PR_KT_ESTATUS <> 'Retirada' and PR_KT_UASIGNADOV is not null and PR_KT_CREDITO IN (SELECT PR_KT_CREDITO FROM ARESTRATEGICAS.pr_kmt_gral WHERE PR_KT_ESTATUS<> 'Retirada' and PR_KT_UASIGNADOV = ?)
|
||||
|
||||
sql.select_fuentes_AR = SELECT * FROM ARESTRATEGICAS.CAT_FUENTE
|
||||
|
||||
sql.select_parentesco_AR = SELECT * FROM ARESTRATEGICAS.CAT_PARENTESCO
|
||||
|
||||
sql.select_accion_AR = select distinct CAT_CO_ACCION, CAT_CO_ADESCRIPCION from ARESTRATEGICAS.cat_codigos where CAT_CO_TIPO in (2,3) order by 2
|
||||
|
||||
sql.select_resultado_MA_AR = select distinct CAT_CO_ACCION, CAT_CO_RESULTADO, CAT_CO_RDESCRIPCION from cat_codigos where CAT_CO_ACCION ='MA' order by 1
|
||||
|
||||
sql.select_resultado_VC_AR = select distinct CAT_CO_ACCION, CAT_CO_RESULTADO, CAT_CO_RDESCRIPCION from cat_codigos where CAT_CO_ACCION = 'VC' order by 1
|
||||
|
||||
sql.select_resultado_CA_AR = select distinct CAT_CO_ACCION, CAT_CO_RESULTADO, CAT_CO_RDESCRIPCION from cat_codigos where CAT_CO_ACCION ='CA' order by 1
|
||||
|
||||
sql.select_resultado_BR_AR = select distinct CAT_CO_ACCION, CAT_CO_RESULTADO, CAT_CO_RDESCRIPCION from cat_codigos where CAT_CO_ACCION ='BR' order by 1
|
||||
|
||||
sql.insert_fotos_cliente_nuevo_MARIANA = insert into MARIANA.HIST_FOTO_CLIENTES_NUEVOS (HIST_FCM_CODIGO, HIST_FCM_ALMACEN, HIST_FCM_RUTA, HIST_FCM_FOTO) VALUES(?,?,?,?)
|
||||
|
||||
sql.insert_gestion_AR = insert into ARESTRATEGICAS.TMP_HIST_VISITAS(TMP_HIST_VI_CREDITO, TMP_HIST_VI_PRODUCTO, TMP_HIST_VI_VISITADOR, TMP_HIST_VI_RESULTADO, TMP_HIST_VI_CODIGO, TMP_HIST_VI_PARENTESCO, TMP_HIST_VI_COMENTARIO, TMP_HIST_VI_DTEVISITA, TMP_HIST_VI_LONGITUD, TMP_HIST_VI_LATITUD, TMP_HIST_VI_DTECAPTURA, TMP_HIST_VI_AGENCIA, TMP_HIST_VI_DPROM, TMP_HIST_VI_MPROM, HIST_VI_TIPODOMICILIO, HIST_VI_NIVELSOCIO, HIST_VI_CARACTERISTICA, HIST_VI_NIVELES, TMP_HIST_VI_IMAGEN, TMP_HIST_VI_IMAGEN2, TMP_HIST_VI_IMAGEN3, TMP_HIST_VI_IMAGEN4, HIST_VI_NATIENDE, TMP_HIST_VI_ACCION_CODIGO, TMP_HIST_VI_ACCION, TMP_HIST_VI_DIAS_ACCION, TMP_HIST_VI_PUNTOS_REF) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
|
||||
BIN
datos-varios.png
BIN
datos-varios.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
BIN
engranes.png
BIN
engranes.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -1 +0,0 @@
|
||||
git pull
|
||||
Reference in New Issue
Block a user