mirror of
https://github.com/KeymonSoft/Guna_Picking.git
synced 2026-04-17 19:36:50 +00:00
Commit inicial
This commit is contained in:
125
B4XMainPage.bas
Normal file
125
B4XMainPage.bas
Normal file
@@ -0,0 +1,125 @@
|
||||
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=..\..\gitpull.bat
|
||||
'###########################################################################################################
|
||||
'###################### PUSH #############################################################
|
||||
'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\
|
||||
'###########################################################################################################
|
||||
#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 seleccion As C_seleccion
|
||||
Dim picking As C_picking
|
||||
Dim reqManager As DBRequestManager
|
||||
Dim paso1 As String
|
||||
Private Insesion As Button
|
||||
Private Contraseña As EditText
|
||||
Dim Usuario As EditText
|
||||
Dim ID_ALMACEN As String
|
||||
Dim user As String
|
||||
Dim almacen As C_almacen
|
||||
Dim c As Cursor
|
||||
Dim d As Cursor
|
||||
Dim terminar As C_terminar
|
||||
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")
|
||||
seleccion.Initialize
|
||||
B4XPages.AddPage("seleccion",seleccion)
|
||||
terminar.Initialize
|
||||
B4XPages.AddPage("termino",terminar)
|
||||
almacen.Initialize
|
||||
B4XPages.AddPage("almacen",almacen)
|
||||
picking.Initialize
|
||||
B4XPages.AddPage("picking",picking)
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
|
||||
End Sub
|
||||
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
|
||||
|
||||
Private Sub Insesion_Click
|
||||
|
||||
If Usuario.Text <> "" Then
|
||||
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "select_usuario_guna_PICKING"
|
||||
cmd.Parameters = Array As Object(Usuario.Text, Contraseña.Text)
|
||||
reqManager.ExecuteQuery(cmd , 0, "usuario")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub JobDone(Job As HttpJob)
|
||||
If Job.Success = False Then
|
||||
|
||||
ToastMessageShow("Error: " & Job.ErrorMessage, True)
|
||||
|
||||
Else
|
||||
|
||||
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
|
||||
Dim name As String = records(result.Columns.Get("USUARIO"))
|
||||
ID_ALMACEN = records(result.Columns.Get("CAT_LO_AGENCIA"))
|
||||
user = records(result.Columns.Get("CAT_LO_USUARIO"))
|
||||
Log(user)
|
||||
Next
|
||||
paso1 = 1
|
||||
End If
|
||||
End If
|
||||
Job.Release
|
||||
|
||||
|
||||
|
||||
If paso1 = 1 Then
|
||||
If name = "OKActivo" Then
|
||||
c = Starter.skmt.ExecQuery("SELECT CUENTA FROM CUENTAA WHERE ESTATUS = 1")
|
||||
d = Starter.skmt.ExecQuery("SELECT CAT_DF_ID, CAT_DF_NOMBRE, CAT_DF_ORDEN, CAT_DF_RUTAO, CAT_DF_PIEZAS, CAT_DF_CAJAS, CAT_DF_BLISTER FROM CAT_DETALLEFOLIO WHERE CAT_DF_ESTATUS = 0")
|
||||
c.Position = 0
|
||||
d.Position = 0
|
||||
If d.RowCount = 0 And c.RowCount >= 1 Then
|
||||
B4XPages.ShowPage ("termino")
|
||||
|
||||
Else If c.RowCount >= 1 Then
|
||||
B4XPages.ShowPage ("picking")
|
||||
Else
|
||||
B4XPages.ShowPage ("almacen")
|
||||
End If
|
||||
Else If name = "OKExpirado" Then
|
||||
Msgbox("Usuario Expirado llamar al administrador","") 'ignore
|
||||
Else If name = "OKCancelado" Then
|
||||
Msgbox("Usuario Cancelado llamar al administrador","") 'ignore
|
||||
Else
|
||||
Msgbox("Usuario o password No validos","") 'ignore
|
||||
End If
|
||||
paso1 = 0
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Reference in New Issue
Block a user