mirror of
https://github.com/KeymonSoft/Mariana.git
synced 2026-04-20 22:29:29 +00:00
- Se agregó nuevamente la opción de importar la base de datos directamente desde Whatsapp, hay que ingresar al engrane con el usuario KMTS1.
- Se cambio el nombre del archivo que se envia por WhatsApp cuando se envia la base de datos, ahora es kmt_mariana.db
This commit is contained in:
@@ -92,6 +92,8 @@ Sub Class_Globals
|
||||
Dim MES1 As ManageExternalStorage
|
||||
Dim device As Phone
|
||||
Private b_importarBD As Button
|
||||
Private p_importarBDWA As Panel
|
||||
Dim cb_importarBDWA As CheckBox
|
||||
End Sub
|
||||
|
||||
Public Sub Initialize
|
||||
@@ -181,6 +183,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_PROMOS_RUTA (CPR_IDALMACEN TEXT, CPR_RUTA TEXT, CPR_PROMO TEXT, CPR_CANT INT)")
|
||||
|
||||
Subs.agregaColumna("PEDIDO", "PE_ENVIO_OK", "TEXT")
|
||||
|
||||
'Revisamos si se disparo el intent de cargar la base de datos desde WhatApp.
|
||||
If s.traeUsarIntentBDWA Then s.importaBDDesdeWhatsApp
|
||||
|
||||
Try 'Intentamos usar "pragma_table_info" para revisar si existe la columna "CAT_CL_DIASEMANA" en la tabla
|
||||
c=Starter.skmt.ExecQuery("SELECT COUNT(*) AS fCol FROM pragma_table_info('kmt_info') WHERE name='CAT_CL_DIASEMANA'")
|
||||
c.Position = 0
|
||||
@@ -710,6 +716,14 @@ Sub i_engrane_Click
|
||||
If user.Text = "KMTS1" Then lv_server.AddSingleLine("http://10.0.0.205:1781")
|
||||
' l_server.Text = Starter.DBReqServer
|
||||
et_server.Text = Starter.DBReqServer
|
||||
Log(222)
|
||||
cb_importarBDWA.Checked = s.traeUsarIntentBDWA
|
||||
Log(333)
|
||||
If user.Text.Trim = "KMTS1" Then
|
||||
p_importarBDWA.Visible = True
|
||||
Else
|
||||
p_importarBDWA.Visible = False
|
||||
End If
|
||||
If user.Text = "KMTS1" Then b_importarBD.Visible = True Else b_importarBD.Visible = False
|
||||
Subs.panelVisible(p_appUpdate,0,0)
|
||||
End Sub
|
||||
@@ -755,11 +769,11 @@ Private Sub b_envioBD_Click
|
||||
'copy the shared file to the shared folder
|
||||
Log("xxxxxx:"&Provider.SharedFolder)
|
||||
Sleep(1000)
|
||||
File.Copy(File.DirInternal, FileName, Provider.SharedFolder, FileName)
|
||||
File.Copy(File.DirInternal, FileName, Provider.SharedFolder, "kmt.mariana.db")
|
||||
Dim email As Email
|
||||
email.To.Add("cheveguerra@gmail.com")
|
||||
email.Subject = "subject"
|
||||
email.Attachments.Add(Provider.GetFileUri(FileName))
|
||||
email.Attachments.Add(Provider.GetFileUri("kmt.mariana.db"))
|
||||
' email.Attachments.Add(Provider.GetFileUri(FileName)) 'second attachment
|
||||
Dim in As Intent = email.GetIntent
|
||||
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
|
||||
@@ -783,4 +797,10 @@ Private Sub b_importarBD_Click
|
||||
File.Copy(Result.Dir, Result.FileName, File.DirInternal, "kmt.db") 'Copia la base de datos seleccionada al directorio interno.
|
||||
Starter.skmt.Initialize(Starter.ruta,"kmt.db", True) 'Reiniciliza la base de datos con la recien importada.
|
||||
ToastMessageShow("¡BD importada!", False)
|
||||
End Sub
|
||||
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