mirror of
https://github.com/KeymonSoft/ADM.git
synced 2026-04-18 11:49:26 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7c890a612 |
@@ -1121,7 +1121,7 @@ Version=12.8
|
|||||||
#Region Project Attributes
|
#Region Project Attributes
|
||||||
#ApplicationLabel: ADM
|
#ApplicationLabel: ADM
|
||||||
#VersionCode: 1
|
#VersionCode: 1
|
||||||
#VersionName: 5.10.02
|
#VersionName: 5.10.03
|
||||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||||
#SupportedOrientations: portrait
|
#SupportedOrientations: portrait
|
||||||
#CanInstallToExternalStorage: False
|
#CanInstallToExternalStorage: False
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ ModuleClosedNodes16=
|
|||||||
ModuleClosedNodes17=
|
ModuleClosedNodes17=
|
||||||
ModuleClosedNodes18=
|
ModuleClosedNodes18=
|
||||||
ModuleClosedNodes19=
|
ModuleClosedNodes19=
|
||||||
ModuleClosedNodes2=
|
ModuleClosedNodes2=33
|
||||||
ModuleClosedNodes20=
|
ModuleClosedNodes20=
|
||||||
ModuleClosedNodes21=
|
ModuleClosedNodes21=
|
||||||
ModuleClosedNodes22=
|
ModuleClosedNodes22=
|
||||||
@@ -84,7 +84,7 @@ ModuleClosedNodes23=
|
|||||||
ModuleClosedNodes24=
|
ModuleClosedNodes24=
|
||||||
ModuleClosedNodes25=
|
ModuleClosedNodes25=
|
||||||
ModuleClosedNodes26=
|
ModuleClosedNodes26=
|
||||||
ModuleClosedNodes27=29
|
ModuleClosedNodes27=
|
||||||
ModuleClosedNodes28=
|
ModuleClosedNodes28=
|
||||||
ModuleClosedNodes29=
|
ModuleClosedNodes29=
|
||||||
ModuleClosedNodes3=
|
ModuleClosedNodes3=
|
||||||
@@ -93,10 +93,10 @@ ModuleClosedNodes31=
|
|||||||
ModuleClosedNodes32=15,16,17,18,19
|
ModuleClosedNodes32=15,16,17,18,19
|
||||||
ModuleClosedNodes4=
|
ModuleClosedNodes4=
|
||||||
ModuleClosedNodes5=1,3
|
ModuleClosedNodes5=1,3
|
||||||
ModuleClosedNodes6=3
|
ModuleClosedNodes6=3,29,30
|
||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=Tracker,guardaYEnviaUbicacion,307,0,MAPA_RUTAS,b_inicioVenta_Click,470,1,MAPA_RUTAS,B_VERDE_Click,440,0,MAPA_RUTAS,B_ROJO_Click,445,0,MAPA_RUTAS,B_AZUL_Click,450,0,C_Cliente,Class_Globals,0,0,C_Cliente,B4XPage_Appear,324,0,B4XMainPage,B4XPage_Created,215,0,C_Principal,b_cargar_Click,1297,0,C_Principal,JobDone,1311,2
|
NavigationStack=MAPA_RUTAS,OnInfoWindowClickListener1_click,367,0,MAPA_RUTAS,Camera1_PictureTaken,723,0,Subs,dameUsuarioDeDB,657,0,Subs,traeAlmacen,668,5,C_Clientes,b_inicioVenta_Click,614,0,Subs,bitacora,1631,0,C_Cliente,Camera1_PictureTaken,2855,0,C_Principal,b_subir_Click,832,6,Starter,mandaForma,249,0,B4XMainPage,B4XPage_Created,179,3
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=30,2,14,5,6,19,31,27,18,32
|
VisibleModules=30,2,14,5,6,19,31,27,32,21
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
|||||||
Starter.skmt.ExecNonQuery("DROP TABLE IF EXISTS HIST_SUPERVISOR")
|
Starter.skmt.ExecNonQuery("DROP TABLE IF EXISTS HIST_SUPERVISOR")
|
||||||
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CLIENTES_NUEVOS(CN_ID TEXT, CN_FECHA TEXT, CN_USER TEXT, CN_LAT TEXT, CN_LON TEXT, CN_NOMBRE TEXT, CN_DIRECCION TEXT, CN_FOTO TEXT, CN_ALMACEN TEXT, CN_RUTA TEXT,CN_GIRO TEXT)")
|
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CLIENTES_NUEVOS(CN_ID TEXT, CN_FECHA TEXT, CN_USER TEXT, CN_LAT TEXT, CN_LON TEXT, CN_NOMBRE TEXT, CN_DIRECCION TEXT, CN_FOTO TEXT, CN_ALMACEN TEXT, CN_RUTA TEXT,CN_GIRO TEXT)")
|
||||||
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTAA (RUTAA TEXT)")
|
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTAA (RUTAA TEXT)")
|
||||||
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS FOTOINICIAL (RUTAA TEXT, ALMACEN TEXT, LATITUD TEXT, LONGITUD TEXT, FECHAHORA TEXT, FOTO BLOB, FOTO2 BLOB, USUARIO TEXT)")
|
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS FOTOINICIAL (RUTAA TEXT, ALMACEN TEXT, LATITUD TEXT, LONGITUD TEXT, FECHAHORA TEXT, FOTO BLOB, FOTO2 BLOB, FOTO_NOM TEXT, FOTO_NOM2 TEXT, USUARIO TEXT)")
|
||||||
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_CUOTAS (HC_META6 TEXT, HC_META5 TEXT, HC_META4 TEXT, HC_META3 TEXT, HC_META2 TEXT, HC_META1 TEXT, HC_RUTA TEXT, HC_CUOTA1 TEXT, HC_CUOTA2 TEXT, HC_CUOTA3 TEXT, HC_CUOTA4 TEXT, HC_CUOTA5 TEXT, HC_CUOTA6 TEXT)")
|
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_CUOTAS (HC_META6 TEXT, HC_META5 TEXT, HC_META4 TEXT, HC_META3 TEXT, HC_META2 TEXT, HC_META1 TEXT, HC_RUTA TEXT, HC_CUOTA1 TEXT, HC_CUOTA2 TEXT, HC_CUOTA3 TEXT, HC_CUOTA4 TEXT, HC_CUOTA5 TEXT, HC_CUOTA6 TEXT)")
|
||||||
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_GPS (HGDATE TEXT, HGLAT TEXT, HGLON TEXT)")
|
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_GPS (HGDATE TEXT, HGLAT TEXT, HGLON TEXT)")
|
||||||
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_GIRO(GIRO TEXT)")
|
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_GIRO(GIRO TEXT)")
|
||||||
@@ -1327,3 +1327,7 @@ End Sub
|
|||||||
Private Sub p_add_monto_Click
|
Private Sub p_add_monto_Click
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ImageView1_LongClick
|
||||||
|
Starter.mandaForma(1,1,123, "1759862644988_10_cerrado.jpg")
|
||||||
|
End Sub
|
||||||
|
|||||||
@@ -2819,7 +2819,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
|
|
||||||
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(LA_RUTA, ALMACEN, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & sTime, File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD))
|
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO_NOM, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(LA_RUTA, ALMACEN, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & sTime, fototomada, Subs.traeUsuarioDeBD))
|
||||||
b_foto_inci.Text = "Foto usuario"
|
b_foto_inci.Text = "Foto usuario"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
Else If b_foto_inci.Text = "Foto usuario" Then
|
Else If b_foto_inci.Text = "Foto usuario" Then
|
||||||
@@ -2861,7 +2861,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD,LA_RUTA, ALMACEN ))
|
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO_NOM2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (fototomada, Subs.traeUsuarioDeBD,LA_RUTA, ALMACEN ))
|
||||||
b_foto_inci.Text = "Foto tienda"
|
b_foto_inci.Text = "Foto tienda"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
|
|||||||
@@ -842,7 +842,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
If nombreFoto = "inicio" Then
|
If nombreFoto = "inicio" Then
|
||||||
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(Subs.traeRuta, Subs.traeAlmacen, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & sTime, File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD))
|
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO_NOM, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(Subs.traeRuta, Subs.traeAlmacen, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & sTime, fototomada, Subs.traeUsuarioDeBD))
|
||||||
b_foto_inci.Text = "Foto usuario"
|
b_foto_inci.Text = "Foto usuario"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
Else
|
Else
|
||||||
@@ -850,9 +850,14 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
StopCamera
|
StopCamera
|
||||||
End If
|
End If
|
||||||
|
LogColor("Mandamos foto: " & fototomada, Colors.red)
|
||||||
|
Log($"${Subs.traeAlmacen}, ${Subs.traeRuta}, ${Subs.traeCliente}, ${fototomada}"$)
|
||||||
|
Starter.mandaForma(Subs.traeAlmacen, Subs.traeRuta, Subs.traeCliente, fototomada)
|
||||||
|
|
||||||
Else If b_foto_inci.Text = "Foto usuario" Then
|
Else If b_foto_inci.Text = "Foto usuario" Then
|
||||||
DateTime.DateFormat="ddMMyyyyHHmmss"
|
DateTime.DateFormat="ddMMyyyyHHmmss"
|
||||||
fototomada = fototomada = DateTime.Now & $"_${nombreFoto}.jpg"$
|
nombreFoto = "usuario"
|
||||||
|
fototomada = DateTime.Now & $"_${nombreFoto}.jpg"$
|
||||||
Dim filename As String = fototomada
|
Dim filename As String = fototomada
|
||||||
Dim dir As String = File.DirInternal
|
Dim dir As String = File.DirInternal
|
||||||
camEx.SavePictureToFile(Data, dir, filename)
|
camEx.SavePictureToFile(Data, dir, filename)
|
||||||
@@ -889,7 +894,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD,Subs.traeRuta, Subs.traeAlmacen ))
|
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO_NOM2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (fototomada, Subs.traeUsuarioDeBD,Subs.traeRuta, Subs.traeAlmacen ))
|
||||||
b_foto_inci.Text = "Foto tienda"
|
b_foto_inci.Text = "Foto tienda"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
@@ -901,6 +906,11 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Else
|
Else
|
||||||
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
LogColor("Mandamos foto: " & fototomada, Colors.red)
|
||||||
|
Log($"${Subs.traeAlmacen}, ${Subs.traeRuta}, ${Subs.traeCliente}, ${fototomada}"$)
|
||||||
|
Starter.mandaForma(Subs.traeAlmacen, Subs.traeRuta, Subs.traeCliente, fototomada)
|
||||||
|
|
||||||
' B4XPages.ShowPage("productos")
|
' B4XPages.ShowPage("productos")
|
||||||
' p_transparentePidePeso.Visible = True
|
' p_transparentePidePeso.Visible = True
|
||||||
End If
|
End If
|
||||||
@@ -953,7 +963,6 @@ Sub mandaPendientes
|
|||||||
' End If
|
' End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Sub JobDone(Job As HttpJob)
|
Sub JobDone(Job As HttpJob)
|
||||||
Log("INICA JOBDONE CLIENTES - " & Job.Tag)
|
Log("INICA JOBDONE CLIENTES - " & Job.Tag)
|
||||||
If reqManager.reqsList.IsInitialized Then 'Si tenemos lista de requests, la procesamos.
|
If reqManager.reqsList.IsInitialized Then 'Si tenemos lista de requests, la procesamos.
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ Sub b_subir_Click
|
|||||||
cuantos_noventa = D.GetString("CUANTOS_NOVENTA")
|
cuantos_noventa = D.GetString("CUANTOS_NOVENTA")
|
||||||
d.Close
|
d.Close
|
||||||
|
|
||||||
' NOVENTA
|
' FOTOINICIAL
|
||||||
c=B4XPages.MainPage.skmt.ExecQuery("SELECT * FROM FOTOINICIAL")
|
c=B4XPages.MainPage.skmt.ExecQuery("SELECT * FROM FOTOINICIAL")
|
||||||
If c.RowCount>0 Then
|
If c.RowCount>0 Then
|
||||||
For i=0 To c.RowCount -1
|
For i=0 To c.RowCount -1
|
||||||
@@ -837,7 +837,7 @@ Sub b_subir_Click
|
|||||||
foto2 = c.GetBlob("FOTO2")
|
foto2 = c.GetBlob("FOTO2")
|
||||||
cmd.Initialize
|
cmd.Initialize
|
||||||
cmd.Name = "insert_foto_ADM"
|
cmd.Name = "insert_foto_ADM"
|
||||||
cmd.Parameters = Array As Object(C.GetString("RUTAA"),C.GetString("USUARIO"),C.GetString("LONGITUD"),C.GetString("ALMACEN"),C.GetString("FECHAHORA"),C.GetString("LATITUD"),foto1,foto2)
|
cmd.Parameters = Array As Object(C.GetString("RUTAA"),C.GetString("USUARIO"),C.GetString("LONGITUD"),C.GetString("ALMACEN"),C.GetString("FECHAHORA"),C.GetString("LATITUD"),Subs.traeCliente&"_"&c.GetString("FOTO_NOM"),Subs.traeCliente&"_"&c.GetString("FOTO_NOM2"))
|
||||||
reqManager.ExecuteCommand(cmd , "inst_FOTO")
|
reqManager.ExecuteCommand(cmd , "inst_FOTO")
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
If nombreFoto = "inicio" Then
|
If nombreFoto = "inicio" Then
|
||||||
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(Subs.traeRuta, Subs.traeAlmacen, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & STIME, File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD))
|
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO_NOM, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(Subs.traeRuta, Subs.traeAlmacen, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & STIME, fototomada, Subs.traeUsuarioDeBD))
|
||||||
b_foto_inci.Text = "Foto usuario"
|
b_foto_inci.Text = "Foto usuario"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
Else
|
Else
|
||||||
@@ -476,9 +476,13 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
StopCamera
|
StopCamera
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Starter.mandaForma(Subs.traeAlmacen, Subs.traeRuta, Subs.traeCliente, fototomada)
|
||||||
|
|
||||||
Else If b_foto_inci.Text = "Foto usuario" Then
|
Else If b_foto_inci.Text = "Foto usuario" Then
|
||||||
DateTime.DateFormat="ddMMyyyyHHmmss"
|
DateTime.DateFormat="ddMMyyyyHHmmss"
|
||||||
fototomada = fototomada = DateTime.Now & $"_${nombreFoto}.jpg"$
|
nombreFoto = "usuario"
|
||||||
|
fototomada = DateTime.Now & $"_${nombreFoto}.jpg"$
|
||||||
Dim filename As String = fototomada
|
Dim filename As String = fototomada
|
||||||
Dim dir As String = File.DirInternal
|
Dim dir As String = File.DirInternal
|
||||||
camEx.SavePictureToFile(Data, dir, filename)
|
camEx.SavePictureToFile(Data, dir, filename)
|
||||||
@@ -515,7 +519,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD,Subs.traeRuta, Subs.traeAlmacen ))
|
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO_NOM2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (fototomada, Subs.traeUsuarioDeBD,Subs.traeRuta, Subs.traeAlmacen ))
|
||||||
b_foto_inci.Text = "Foto tienda"
|
b_foto_inci.Text = "Foto tienda"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
@@ -527,6 +531,10 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Else
|
Else
|
||||||
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
LogColor("Mandamos foto: " & fototomada, Colors.red)
|
||||||
|
Log($"${Subs.traeAlmacen}, ${Subs.traeRuta}, ${Subs.traeCliente}, ${fototomada}"$)
|
||||||
|
Starter.mandaForma(Subs.traeAlmacen, Subs.traeRuta, Subs.traeCliente, fototomada)
|
||||||
' B4XPages.ShowPage("productos")
|
' B4XPages.ShowPage("productos")
|
||||||
' p_transparentePidePeso.Visible = True
|
' p_transparentePidePeso.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -676,7 +676,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
If nombreFoto = "inicio" Then
|
If nombreFoto = "inicio" Then
|
||||||
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(Subs.traeRuta, Subs.traeAlmacen, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & sTime, File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD))
|
Starter.skmt.ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO_NOM, USUARIO) VALUES (?,?,?,?,?,?,?)",Array As Object(Subs.traeRuta, Subs.traeAlmacen, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, sDate & " " & sTime, fototomada, Subs.traeUsuarioDeBD))
|
||||||
b_foto_inci.Text = "Foto usuario"
|
b_foto_inci.Text = "Foto usuario"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
Else
|
Else
|
||||||
@@ -684,9 +684,13 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
StopCamera
|
StopCamera
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Starter.mandaForma(Subs.traeAlmacen, Subs.traeRuta, Subs.traeCliente, fototomada)
|
||||||
|
|
||||||
Else If b_foto_inci.Text = "Foto usuario" Then
|
Else If b_foto_inci.Text = "Foto usuario" Then
|
||||||
DateTime.DateFormat="ddMMyyyyHHmmss"
|
DateTime.DateFormat="ddMMyyyyHHmmss"
|
||||||
fototomada = fototomada = DateTime.Now & $"_${nombreFoto}.jpg"$
|
nombreFoto = "usuario"
|
||||||
|
fototomada = DateTime.Now & $"_${nombreFoto}.jpg"$
|
||||||
Dim filename As String = fototomada
|
Dim filename As String = fototomada
|
||||||
Dim dir As String = File.DirInternal
|
Dim dir As String = File.DirInternal
|
||||||
camEx.SavePictureToFile(Data, dir, filename)
|
camEx.SavePictureToFile(Data, dir, filename)
|
||||||
@@ -723,7 +727,7 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
Dim out As OutputStream = File.OpenOutput(File.DirInternal & dir & Dir2, filename, False)
|
||||||
img.WriteToStream(out, 100, "PNG")
|
img.WriteToStream(out, 100, "PNG")
|
||||||
out.Close
|
out.Close
|
||||||
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (File.ReadBytes(File.DirInternal & dir & Dir2, fototomada), Subs.traeUsuarioDeBD,Subs.traeRuta, Subs.traeAlmacen ))
|
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE FOTOINICIAL set FOTO_NOM2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ", Array As Object (fototomada, Subs.traeUsuarioDeBD,Subs.traeRuta, Subs.traeAlmacen ))
|
||||||
b_foto_inci.Text = "Foto tienda"
|
b_foto_inci.Text = "Foto tienda"
|
||||||
ChangeCamera_Click
|
ChangeCamera_Click
|
||||||
p_camara.Visible = False
|
p_camara.Visible = False
|
||||||
@@ -735,6 +739,10 @@ Sub Camera1_PictureTaken (Data() As Byte)
|
|||||||
Else
|
Else
|
||||||
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
LogColor("Mandamos foto: " & fototomada, Colors.red)
|
||||||
|
Log($"${Subs.traeAlmacen}, ${Subs.traeRuta}, ${Subs.traeCliente}, ${fototomada}"$)
|
||||||
|
Starter.mandaForma(Subs.traeAlmacen, Subs.traeRuta, Subs.traeCliente, fototomada)
|
||||||
' B4XPages.ShowPage("productos")
|
' B4XPages.ShowPage("productos")
|
||||||
' p_transparentePidePeso.Visible = True
|
' p_transparentePidePeso.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -252,3 +252,56 @@ Sub JobDone(Job As HttpJob)
|
|||||||
Log(LastException)
|
Log(LastException)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Sub mandaForma(almacen_ As String, ruta_ As String, cliente_ As String, imagen_ As String)
|
||||||
|
' 1. Inicializa un nuevo HttpJob
|
||||||
|
Dim job As HttpJob
|
||||||
|
job.Initialize("", Me)
|
||||||
|
|
||||||
|
' 2. Define la URL del servidor
|
||||||
|
Dim url As String = "https://keymon.net/ADM/POST_IMAGEN.aspx"
|
||||||
|
|
||||||
|
' 3. Crea un Map para los campos de texto del formulario
|
||||||
|
Dim params As Map
|
||||||
|
params.Initialize
|
||||||
|
params.Put("Almacen", almacen_)
|
||||||
|
params.Put("Ruta", ruta_)
|
||||||
|
params.Put("Cliente", cliente_)
|
||||||
|
params.Put("btnUpload", "Subir Imagen") ' El botón de submit también envía su valor
|
||||||
|
|
||||||
|
' --- CAMPOS OCULTOS DE ASP.NET ---
|
||||||
|
' Estos valores suelen ser dinámicos. Para este ejemplo, los ponemos fijos.
|
||||||
|
' Si falla, es posible que primero necesites hacer un GET a la página para obtener los valores actualizados.
|
||||||
|
' params.Put("__VIEWSTATE", "/wEPDwUKMjA1ODU4NjY1MGRkhSExd19qC1l3GdX6jvTnbM9pxPQR8urGAvs76UsqsDU=")
|
||||||
|
' params.Put("__VIEWSTATEGENERATOR", "6050E242")
|
||||||
|
' params.Put("__EVENTVALIDATION", "/wEdAAX5q9hoCUC745WBVO+/1ZWhraEDRZI2xn7OC3a5LAUoRlfyZCZSVcs/gLubOxTf2dCyEN4makXuwRjezU2tU1hn5vhDofrSSRcWtmHPtJVt4HHStaEfV6fkOi3uRRJDHybxwaB9FuVcVFxi7uoxeGMX")
|
||||||
|
|
||||||
|
' 4. Crea una lista de archivos a subir
|
||||||
|
Dim files As List
|
||||||
|
files.Initialize
|
||||||
|
|
||||||
|
' Creamos el objeto MultipartFileData para nuestra imagen
|
||||||
|
' KeyName: Es el atributo "name" del input en HTML ("Imagen")
|
||||||
|
' ContentType: El tipo de archivo
|
||||||
|
Dim mfd As MultipartFileData = Subs.CreateMultipartFileData(File.DirInternal&"/adm", imagen_, "Imagen", "image/jpeg")
|
||||||
|
files.Add(mfd)
|
||||||
|
|
||||||
|
' 5. Realiza la petición POST de tipo multipart
|
||||||
|
job.PostMultipart(url, params, files)
|
||||||
|
|
||||||
|
' 6. Espera a que el trabajo termine
|
||||||
|
Wait For (job) JobDone(job As HttpJob)
|
||||||
|
|
||||||
|
If job.Success Then
|
||||||
|
' El servidor respondió correctamente (HTTP 200 OK)
|
||||||
|
Log("Respuesta del servidor: " & job.GetString)
|
||||||
|
' MsgboxAsync("¡Imagen subida con éxito!", "Completado")
|
||||||
|
Else
|
||||||
|
' Hubo un error en la conexión o el servidor respondió con un error
|
||||||
|
Log("Error al subir la imagen: " & job.ErrorMessage)
|
||||||
|
' MsgboxAsync("Error: " & job.ErrorMessage, "Fallo")
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Libera los recursos del job
|
||||||
|
job.Release
|
||||||
|
End Sub
|
||||||
21
B4A/Subs.bas
21
B4A/Subs.bas
@@ -665,10 +665,12 @@ End Sub
|
|||||||
'Regresa el almacen actual de la base de datos.
|
'Regresa el almacen actual de la base de datos.
|
||||||
Sub traeAlmacen As String 'ignore
|
Sub traeAlmacen As String 'ignore
|
||||||
Private c As Cursor
|
Private c As Cursor
|
||||||
Private a As String
|
Private a As String = 0
|
||||||
c=B4XPages.MainPage.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
|
c=B4XPages.MainPage.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
|
||||||
c.Position = 0
|
If c.RowCount > 0 Then
|
||||||
a = C.GetString("ID_ALMACEN")
|
c.Position = 0
|
||||||
|
a = c.GetString("ID_ALMACEN")
|
||||||
|
End If
|
||||||
c.Close
|
c.Close
|
||||||
Return a
|
Return a
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1698,3 +1700,14 @@ Sub mandaPendientes
|
|||||||
c.Close
|
c.Close
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Función de ayuda para crear el objeto MultipartFileData de forma más limpia
|
||||||
|
Sub CreateMultipartFileData(Dir As String, FileName As String, KeyName As String, ContentType As String) As MultipartFileData
|
||||||
|
Dim mfd As MultipartFileData
|
||||||
|
mfd.Initialize
|
||||||
|
mfd.Dir = Dir
|
||||||
|
mfd.FileName = FileName
|
||||||
|
mfd.KeyName = KeyName
|
||||||
|
mfd.ContentType = ContentType
|
||||||
|
Return mfd
|
||||||
|
End Sub
|
||||||
Reference in New Issue
Block a user