Build1=Default,profina.keymon.com.mx
File1=alcancia.png
File10=durakelo1.png
File11=engrane.jpg
File12=fila.bal
File13=fondo_kmt.jpg
File14=foto.bal
File15=guardagestion.bal
File16=guna_viejo.png
File17=info_gral.bal
File18=infonavit1.jpg
File19=itembuttonblue.png
File2=alert2.png
File20=kelloggs.png
File21=keymon_logo.png
File22=kmt.db
File23=login.bal
File24=LOGO SANFER.jpg
File25=logo_exitus1.jpg
File26=Malo.jpg
File27=mapa.bal
File28=nopago.bal
File29=nuevocliente.bal
File3=alerta.jpg
File30=palomita_verde.png
File31=pedido.bal
File32=planfia_logo.png
File33=planfia_logo_old.png
File34=planfia_logo_old2.png
File35=PRODUCTOS.bal
File36=PROFINA.png
File37=qr.bal
File38=rechazo.jpg
File39=ROJO.png
File4=alerta_amarilla.png
File40=salma.jpg
File41=seleccion.bal
File42=senial.jpg
File43=sync.png
File44=tache_rojo.png
File45=tarjeta.bal
File46=telefonos.bal
File47=Tiendita.jpg
File48=VERDE.png
File5=AMARILLO.png
File6=buscar.bal
File7=carrito.png
File8=detalle_promo.bal
File9=durakelo.png
FileGroup1=Default Group
FileGroup10=Default Group
FileGroup11=Default Group
FileGroup12=Default Group
FileGroup13=Default Group
FileGroup14=Default Group
FileGroup15=Default Group
FileGroup16=Default Group
FileGroup17=Default Group
FileGroup18=Default Group
FileGroup19=Default Group
FileGroup2=Default Group
FileGroup20=Default Group
FileGroup21=Default Group
FileGroup22=Default Group
FileGroup23=Default Group
FileGroup24=Default Group
FileGroup25=Default Group
FileGroup26=Default Group
FileGroup27=Default Group
FileGroup28=Default Group
FileGroup29=Default Group
FileGroup3=Default Group
FileGroup30=Default Group
FileGroup31=Default Group
FileGroup32=Default Group
FileGroup33=Default Group
FileGroup34=Default Group
FileGroup35=Default Group
FileGroup36=Default Group
FileGroup37=Default Group
FileGroup38=Default Group
FileGroup39=Default Group
FileGroup4=Default Group
FileGroup40=Default Group
FileGroup41=Default Group
FileGroup42=Default Group
FileGroup43=Default Group
FileGroup44=Default Group
FileGroup45=Default Group
FileGroup46=Default Group
FileGroup47=Default Group
FileGroup48=Default Group
FileGroup5=Default Group
FileGroup6=Default Group
FileGroup7=Default Group
FileGroup8=Default Group
FileGroup9=Default Group
Group=Default Group
Library1=baqrcode
Library10=reflection
Library11=rspopupmenu
Library12=runtimepermissions
Library13=serial
Library14=sql
Library15=togglelibrary
Library16=zxing_scanner
Library17=printing
Library2=bitmapcreator
Library3=byteconverter
Library4=camera
Library5=core
Library6=gps
Library7=okhttputils2
Library8=phone
Library9=randomaccessfile
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="28"/>~\n~<supports-screens android:largeScreens="true" ~\n~    android:normalScreens="true" ~\n~    android:smallScreens="true" ~\n~    android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~AddApplicationText(<activity android:name="com.google.zxing.client.android.CaptureActivity"~\n~android:screenOrientation="landscape" ~\n~android:configChanges="orientation|keyboardHidden"~\n~android:theme="@android:style/Theme.NoTitleBar.Fullscreen"~\n~android:windowSoftInputMode="stateAlwaysHidden">~\n~</activity>)~\n~~\n~	  'End of default text.~\n~SetApplicationAttribute(android:usesCleartextTraffic, "true")~\n~	AddManifestText(~\n~<uses-permission~\n~  android:name="android.permission.ACCESS_FINE_LOCATION"~\n~  android:maxSdkVersion="30" />~\n~)
Module1=BUSCAR
Module10=gestion
Module11=Historico
Module12=mapas
Module13=nopago
Module14=nuevocliente
Module15=pedidos
Module16=QR_MODULE
Module17=seleccion
Module18=tarjeta
Module19=telefonos
Module2=CameraExClass
Module3=colonia
Module4=colonia2
Module5=DBRequestManager
Module6=detalle_promo
Module7=EscPosPrinter
Module8=fila
Module9=foto
NumberOfFiles=48
NumberOfLibraries=17
NumberOfModules=19
Version=12.5
@EndOfDesignText@
#Region  Project Attributes 
	#ApplicationLabel: Profina-Venta
	#VersionCode: 3
	#VersionName: PILOTO 3.08.15
	'SupportedOrientations possible values: unspecified, landscape or portrait.
	#SupportedOrientations: portrait
	#CanInstallToExternalStorage: False
	
	'###########################################################################################################
	'######################           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

#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region
#Region Service Attributes
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.
    Dim reqManager As DBRequestManager
	Dim ruta As String
	Dim tipov As String
	Dim mac_impresora As String
	Private Serial1 As Serial

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.
    Dim skmt As SQL
	Dim user As EditText
	Dim pass As EditText
	Dim c As Cursor
	Dim existe As String
	Dim paso1 As String
	Dim IMEI As String
	Dim g As GPS
	Dim server As String
	Dim alterno As String
	Private b_menu As Button
    Dim PopupMenu As RSPopupMenu
	Dim cmd As DBCommand

	Private PDF As Button
	Private IMEN As EditText
	Private Entrar As Button
	Private Panel1 As Panel
	Private ImageView4 As ImageView
	Private E_SERVER As EditText
	Private B_SERVER As Button
	Private B_FECHA As Button
	Private CUANTOS As String
	
	Private ListView1 As ListView
	Private E_MAC_IMP As EditText
	Dim rp As RuntimePermissions
End Sub

Sub Activity_Create(FirstTime As Boolean)
	
	
	   ruta = File.DirInternal

	If(FirstTime) Then
	 g.Initialize("GPS")
	End If
  	 
	' se crea o no el archivo de la base de ddatos de kmt
	'NOTAS SI SE MODIFICA LA ESTRUCTURA SE QUITA EL IF Y SE VA DIRECTO A LA SENTENCIA FILE.COPY PARA QUE 
	'TOME LA NUEVA ESTRUCTURA ES MUY IMPORTANTE TENER EL IF DE LO CONTRARIO SOLO LO ESCRIBE UNA VEZ Y LO BORRA
	'SI SE REGRESA A ESTE ACTIVIDAD.
	If File.Exists(ruta, "kmt.db") = False Then
		File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
	End If
	skmt.Initialize(ruta,"kmt.db", True)
	'c=skmt.ExecQuery2("select COUNT(*) AS CUANTOS from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
    'c.Position =0 
    
	'If c.GetString("CUANTOS") = 0 Then
	'skmt.ExecNonQuery2("INSERT INTO CAT_CODIGOS (CAT_CO_PONDERACION, CAT_CO_ACCION, CAT_CO_RESULTADO, CAT_CO_CONFIGURACION) VALUES (?,?,?,?)", Array As Object ("1","1","SERVER","http://masternoc.mx:1783"))
	'skmt.ExecNonQuery2("INSERT INTO CAT_CODIGOS (CAT_CO_PONDERACION, CAT_CO_ACCION, CAT_CO_RESULTADO, CAT_CO_CONFIGURACION) VALUES (?,?,?,?)", Array As Object ("0","2","SERVER","http://masternoc1.mx:1783"))
    
    'End If
	'c.Close
	'c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
    'c.Position =0 
	'server = c.GetString("CAT_CO_CONFIGURACION")
	'c.Close
    'server = "http://201.99.139.28:1782"
	'server = "http://177.244.63.54:1782"
	'server = "http://keymon.com.mx:1782"
	server = "http://keymon.lat:1781"
	'server = "http://38.123.201.97:1782"
	
	Dim sDate,sTime As String
	DateTime.DateFormat = "yyyyMMdd"
	sDate=DateTime.Date(DateTime.Now)
		If sDate = "20190523" Then
		skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER"))

		skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",server))
			
	End If

	
	c=skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
	c.Position =0
	If c.GetString("CUANTOS") = 0 Then
		skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",server))
	Else
		c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
		c.Position =0
		server = c.GetString("CAT_VA_VALOR")
	End If
	
	skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)")
	skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CLIENTES_GPS(CLIENTE TEXT, LAT TEXT, LON TEXT)")
	skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS TMP_PROMO_ESP_REGALO(CLIENTE TEXT, MONTO TEXT, REGALO TEXT)")
	
	
	If FirstTime Then
		reqManager.Initialize(Me, server)
	End If
	Activity.LoadLayout("login")
	Dim P As PhoneId
'	user.Text = P.GetDeviceId
'	IMEI = P.GetDeviceId
'	IMEI = ""
'este codigo es para lo del menu
  PopupMenu.Initialize("PopupMenu", b_menu)
    PopupMenu.AddMenuItem(0, 0, "View")
    PopupMenu.AddMenuItem(1, 1, "Edit")
    PopupMenu.AddMenuItem(2, 2, "Details")
    PopupMenu.AddMenuItem(3, 3, "Remove")
' menu fin
End Sub

Sub Activity_PermissionResult (Permission As String, Result As Boolean)
    If Permission = rp.PERMISSION_ACCESS_COARSE_LOCATION Then
        Result = True
  End If
End Sub

Sub Activity_Resume
	rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
	
	server = "http://keymon.lat:1781"
	'server = "http://201.99.139.28:1782"
	'server = "http://177.244.63.54:1782"
	'server = "http://38.123.201.97:1782"
		reqManager.Initialize(Me, server)
		
		
	If g.GPSEnabled=False Then
    	  ToastMessageShow("Habilitar el GPS", True)
    	  StartActivity(g.LocationSettingsIntent)
    Else
    	  g.Start(0,0)
    End If
	'	 user.Text ="GPS"
	c=skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA"))
	c.Position =0 
	If c.GetString("CUANTOS") = 0 Then
		cmd.Initialize
	cmd.Name = "select_fecha"
	reqManager.ExecuteQuery(cmd , 0, "fecha")
	
		Msgbox("AJUSTAR FECHA","AVISO")
		Activity_Resume
	Else
	c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("FECHA"))
	c.Position =0 
	Dim sDate,sTime As String

		DateTime.DateFormat = "yyyyMMdd"
		sDate=DateTime.Date(DateTime.Now)

		If c.GetString("CAT_VA_VALOR") > sDate Then
		Msgbox("AJUSTAR LA FECHA YA QUE ES MENOR AL SISTEMA" ,"AVISO")
		Activity_Resume
		End If	
	End If
	c.Close
	c=skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("CODIGO"))
	c.Position =0
	CUANTOS = c.GetString("CUANTOS") 
	
	c.Close
	If CUANTOS > 0 Then
	c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("CODIGO"))
	c.Position =0
	If c.GetString("CAT_VA_VALOR") = "743" Then
		Entrar.Visible = True
	End If
	c.Close
	Else
		skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("CODIGO","743"))

	End If
	
	c=skmt.ExecQuery2("select COUNT(*) AS CUANTOS  from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP"))
	c.Position =0
	If c.GetString("CUANTOS") = 0 Then
		skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MACIMP","0"))
	End If
	skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER"))
	skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",server))
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub Entrar_Click
    If user.Text = "ALTERNO" Then
	c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
	
    c.Position =0 
	server = c.GetString("CAT_CO_CONFIGURACION")
	alterno = c.GetString("CAT_CO_RESULTADO")
	c.Close
	If alterno = 1 Then
	skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 1 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 2", Array As String ("SERVER"))
	skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 0 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 1", Array As String ("SERVER"))
	Else if alterno = 2 Then
	skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 1 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 1", Array As String ("SERVER"))
	skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 0 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 2", Array As String ("SERVER"))
	End If
	c=skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?", Array As String("SERVER"))
    c.Position =0 
	server = c.GetString("CAT_CO_CONFIGURACION")
	user.Text = server
	c.Close
	reqManager.Initialize(Me, server)
	else if user.Text = "ROOT" Then
	skmt.ExecNonQuery("delete from usuarioa")
	  skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)", Array As Object(user.Text, pass.Text))
	  	
	skmt.ExecNonQuery("delete from cat_almacen")
	  skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)", Array As Object (pass.Text))

       skmt.ExecNonQuery("delete from VERSION")
	       
		  skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object ("2.1"))
	
	StartActivity(seleccion)
	
	
		
	End If
	
	
	
    c=skmt.ExecQuery2("select count(*) as EXISTE1 from usuarioa where usuario = ?", Array As String(user.Text))
	c.Position=0
	existe = c.GetString("EXISTE1")
    
	'existe = 1
	If existe = 0 Then
	'skmt.ExecNonQuery("delete from usuarioa")

    Dim cmd As DBCommand
	cmd.Initialize
	cmd.Name = "select_usuario_guna_PRO"
	cmd.Parameters = Array As Object(user.Text, pass.Text)
	reqManager.ExecuteQuery(cmd , 0, "usuario")
	
	Dim cmd As DBCommand
	cmd.Initialize
	cmd.Name = "select_version_PRO"
	reqManager.ExecuteQuery(cmd , 0, "version")
	
	
	Else
	StartActivity(seleccion)
	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 = "version" Then 'query tag
         For Each records() As Object In result.Rows
           skmt.ExecNonQuery("delete from VERSION")
		   Dim CAT_VE_VERSION As String = records(result.Columns.Get("CAT_VE_VERSION"))
           
		  skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)", Array As Object (CAT_VE_VERSION))
	       
         Next
       End If
	 End If 
	 
	 If Job.JobName = "DBRequest" Then
       Dim result As DBResult = reqManager.HandleJob(Job)
       If result.Tag = "agencia" Then 'query tag
         For Each records() As Object In result.Rows
           
		   	Dim ID_ALMACEN As String = records(result.Columns.Get("ID_ALMACEN"))
			
	      
		   
         Next
        
	   End If
	 End If
	 
	 If Job.JobName = "DBRequest" Then
       Dim result As DBResult = reqManager.HandleJob(Job)
       If result.Tag = "fecha" Then 'query tag
         For Each records() As Object In result.Rows
           
		   	Dim FECHA_HOY As String = records(result.Columns.Get("FECHA"))
		  skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("FECHA"))
		  skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("FECHA",FECHA_HOY))
	      
        Next
        
	   End If
	 End If
	 
	 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"))
           Dim ID_ALMACEN As String = records(result.Columns.Get("CAT_LO_AGENCIA"))
'		   Dim IMEI_BASE As String = records(result.Columns.Get("CAT_LO_IDTELEFONO")) 
		   

         Next
		 paso1 = 1
       End If
	 End If
	 
	 
	 
   Job.Release
     
	End If
	If paso1 =1 Then
	 If name = "OKActivo" & IMEI Then
	  skmt.ExecNonQuery("delete from usuarioa")
	  skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)", Array As Object(user.Text, pass.Text))
	  skmt.ExecNonQuery("delete from cat_almacen")
			skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)", Array As Object (ID_ALMACEN))
			skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("NUMERO_PEDIDO"))
			skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("NUMERO_PEDIDO",0))
		

	  StartActivity(seleccion) 
	 Else If name  = "OKExpirado"& IMEI Then
		Msgbox("Usuario Expirado llamar al administrador","")
	 Else If name = "OKCancelado"& IMEI Then
	    Msgbox("Usuario Cancelado llamar al administrador","")
	 Else
	   Msgbox("Usuario o password No validos","")
	 End If
	 paso1 = 0
End If
	
End Sub

Sub Activity_KeyPress (key As Int) As Boolean
    ' BACK key pressed
    If key=KeyCodes.KEYCODE_BACK Then
            ' I want to capture the key here so I return True
			'StartActivity(Main)
			ExitApplication
            'Return True
    End If
    ' Returning False signals the system to handle the key
    Return False
End Sub


Sub GPS_LocationChanged (Location1 As Location)
If user.text = "GPS" Then

'user.Text=Location1.ConvertToMinutes(Location1.Latitude)
'pass.text=Location1.ConvertToMinutes(Location1.Longitude)

user.Text=Location1.Latitude
pass.text=Location1.Longitude

'btnTakePicture.Enabled = True
's.ExecNonQuery2("INSERT INTO  HIST_GPS (HGDATE,HGLAT, HGLON) VALUES(?,?,?) ", Array As Object (sDate & sTime, lat_gps, lon_gps))
End If
End Sub
public Sub Initialize
'Initialize the PopupMenu
  
End Sub

 

Sub PopupMenu_Dismiss
    ToastMessageShow("PopupMenu dismissed", False)
End Sub

Sub PopupMenu_MenuItemClick (ItemId As Int) As Boolean
    ToastMessageShow("Item " & ItemId & " clicked.", False)
    Return False
End Sub

Sub b_menu_Click
    PopupMenu.Show
	
End Sub

Sub PDF_Click

End Sub


Sub IMEN_EnterPressed
	If IMEN.Text <> "0" Then
		skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("CODIGO"))
		skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("CODIGO",IMEN.TEXT))
		skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("RUTA"))
		skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("RUTA",user.TEXT))
	
	End If
	IMEN.Visible =False
	If IMEN.Text = "743" Then
	Entrar.Visible = True
	End If
	
	
End Sub

Sub user_EnterPressed
 If user.Text = "CODIGO" Then
IMEN.Visible = True
user.Text = ""
End If		
End Sub

Sub ImageView4_Click
	
	Entrar.Visible = False
	'server = "http://201.99.139.28:1782"
	'server = "http://177.244.63.54:1782"
	'server = "http://keymon.com.mx:1782"
	server = "http://keymon.lat:1781"
	ListView1.Clear
	Dim label1 As Label
	label1 = ListView1.SingleLineLayout.Label
	label1.TextSize = 20
	label1.TextColor = Colors.Black
	ListView1.AddSingleLine("http://keymon.lat:1781")
'	ListView1.AddSingleLine("http://177.244.63.54:1782")
'	ListView1.AddSingleLine("http://keymon.com.mx:1782")
	
	
	c=skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER"))
	c.Position =0
	E_SERVER.text = c.GetString("CAT_VA_VALOR")
	Panel1.Visible = True
End Sub

Sub B_SERVER_Click
	skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("SERVER"))
	skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("SERVER",E_SERVER.text))
	Panel1.Visible = False
	Entrar.Visible = True
	   
End Sub

Sub B_FECHA_Click
	
	
	skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("MACIMP"))
	skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("MACIMP","0"))
	Panel1.Visible = False
	
	
	
	    
End Sub

Sub ListView1_ItemClick (Position As Int, Value As Object)
	E_SERVER.text = Value
End Sub