mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-20 11:39:13 +00:00
- Se agregó la opcion de importar la base de datos directamente desde Whatsapp, hay que ingresar al engrane con el usuario KMTS1.
This commit is contained in:
@@ -113,6 +113,10 @@ Sub Class_Globals
|
||||
Private l_cartaPorte As Label
|
||||
Private et_maxClientesNuevos As EditText
|
||||
Private l_maxClientesNuevos As Label
|
||||
Dim in As Intent
|
||||
Dim intentUsado As Boolean = False
|
||||
Private p_importarBDWA As Panel
|
||||
Private cb_importarBDWA As CheckBox
|
||||
End Sub
|
||||
|
||||
Public Sub Initialize
|
||||
@@ -339,6 +343,37 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
End Sub
|
||||
|
||||
Sub B4XPage_Appear
|
||||
Log("LLAMAMOS traeUsarIntentBDWA")
|
||||
If kh.traeUsarIntentBDWA Then
|
||||
Private tmpBDWA As Boolean = kh.traeUsarIntentBDWA
|
||||
If Not(in.IsInitialized) Then in = B4XPages.GetNativeParent(Me).GetStartingIntent
|
||||
If Not(intentUsado) And in <> Null Then
|
||||
' Log(in)
|
||||
intentUsado = True
|
||||
' Log(in.As(String))
|
||||
If in.GetData <> Null Then
|
||||
Dim XmlData As String
|
||||
XmlData = in.GetData
|
||||
' ToastMessageShow(XmlData, False)
|
||||
' Send_Make_somthing(in)
|
||||
' Activity.Finish
|
||||
Try
|
||||
Dim OutStr As OutputStream = File.OpenOutput(File.DirInternal,"kmt.db",False)
|
||||
Dim InStr As InputStream = File.OpenInput("ContentDir",XmlData)
|
||||
File.Copy2(InStr,OutStr)
|
||||
LogColor("BD copiada a interna.", Colors.Blue)
|
||||
OutStr.Close
|
||||
If in.As(String).Contains("whatsapp") Then ToastMessageShow("BD cargada desde Whatsapp", False)
|
||||
Catch
|
||||
Log(LastException)
|
||||
End Try
|
||||
' ExitApplication
|
||||
End If
|
||||
End If
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'")
|
||||
Starter.skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('IMPORTAR_BD_WA', '${tmpBDWA}')"$)
|
||||
|
||||
End If
|
||||
MES1.Initialize(Me, "MES1")
|
||||
Log("SDK: " & device.SdkVersion)
|
||||
' Get the device SDK version
|
||||
@@ -371,6 +406,8 @@ Sub B4XPage_Appear
|
||||
kh.SetButtonTintList(cb_cartaPorte, Colors.LightGray, Colors.RGB(43, 154, 211))
|
||||
cb_geocerca.Checked = kh.traeUsarGeocerca
|
||||
cb_cartaPorte.Checked = kh.traeUsarCartaPorte
|
||||
' Log("LLAMAMOS traeUsarIntentBDWA")
|
||||
cb_importarBDWA.Checked = kh.traeUsarIntentBDWA
|
||||
et_maxClientesNuevos.Text = kh.traeMaxClientesNuevos
|
||||
' server = "http://keymon.com.mx:1782"
|
||||
' server = "http://201.99.139.28:1782"
|
||||
@@ -623,7 +660,13 @@ Sub i_engranes_Click
|
||||
Panel1.Top = (Root.Height/2) - (Panel1.Height/2)
|
||||
Panel1.Elevation = 100
|
||||
Panel1.BringToFront
|
||||
If user.Text = "KMTS1" Then b_importarBD.Visible = True Else b_importarBD.Visible = False
|
||||
If user.Text.Trim = "KMTS1" Then
|
||||
b_importarBD.Visible = True
|
||||
p_importarBDWA.Visible = True
|
||||
Else
|
||||
b_importarBD.Visible = False
|
||||
p_importarBDWA.Visible = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub i_engranes_LongClick
|
||||
@@ -844,3 +887,9 @@ Private Sub b_aceptarExtras_Click
|
||||
et_geocerca.Text = ""
|
||||
p_extras.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub cb_importarBDWA_CheckedChange(Checked As Boolean)
|
||||
' LogColor($"cb_importarBDWA_CheckedChange = ${Checked}"$, Colors.Red)
|
||||
Starter.skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'")
|
||||
Starter.skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('IMPORTAR_BD_WA', '${Checked}')"$)
|
||||
End Sub
|
||||
Reference in New Issue
Block a user