package medicomed.keymon.com.mx;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class b4xmainpage extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "medicomed.keymon.com.mx.b4xmainpage");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", medicomed.keymon.com.mx.b4xmainpage.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public String _sdate = "";
public String _stime = "";
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public medicomed.keymon.com.mx.c_subs _s = null;
public medicomed.keymon.com.mx.b4xmainpage _login = null;
public medicomed.keymon.com.mx.c_principal _principal = null;
public medicomed.keymon.com.mx.c_clientes _clientes = null;
public medicomed.keymon.com.mx.c_cliente _cliente = null;
public medicomed.keymon.com.mx.c_productos _productos = null;
public medicomed.keymon.com.mx.c_updateavailable _updateavailable = null;
public medicomed.keymon.com.mx.c_mapas _mapas = null;
public medicomed.keymon.com.mx.c_nuevocliente _nuevocliente = null;
public medicomed.keymon.com.mx.c_ticketsdia _ticketsdia = null;
public medicomed.keymon.com.mx.c_noventa _noventa = null;
public medicomed.keymon.com.mx.c_nota _nota = null;
public medicomed.keymon.com.mx.c_pedidos _pedidos = null;
public medicomed.keymon.com.mx.c_promos _promos = null;
public medicomed.keymon.com.mx.c_historico _historico = null;
public medicomed.keymon.com.mx.fileprovider _provider = null;
public medicomed.keymon.com.mx.dbrequestmanager _reqmanager = null;
public String _v = "";
public String _ruta = "";
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public String _lat_gps = "";
public String _lon_gps = "";
public String _usuario = "";
public int _batt = 0;
public anywheresoftware.b4a.sql.SQL _skmt = null;
public String _montoactual = "";
public String _clientestotal = "";
public String _clientesventa = "";
public String _clientesvisitados = "";
public String _almacen = "";
public String _rutapreventa = "";
public String _dbreqserver = "";
public String _fecharuta = "";
public boolean _logger = false;
public String _mac_impresora = "";
public anywheresoftware.b4a.phone.Phone.PhoneId _phn = null;
public anywheresoftware.b4a.objects.EditTextWrapper _user = null;
public anywheresoftware.b4a.objects.EditTextWrapper _pass = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public String _existe = "";
public String _paso1 = "";
public anywheresoftware.b4a.objects.LabelWrapper _imen = null;
public String _imei = "";
public String _alterno = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_menu = null;
public com.rootsoft.rspopupmenu.RSPopupMenu _popupmenu = null;
public medicomed.keymon.com.mx.dbrequestmanager._dbcommand _cmd = null;
public anywheresoftware.b4a.objects.ButtonWrapper _pdf = null;
public batteryprogressviewwrapper.batteryprogressviewWrapper _bpv1 = null;
public int[] _batterystatus = null;
public medicomed.keymon.com.mx.batteryutilities _bu = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_apk = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _i_engrane = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_main = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_appupdate = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_regesar = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_version = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _imageview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _entrar = null;
public String _tipo_venta = "";
public boolean _bterminarclicked = false;
public anywheresoftware.b4a.objects.ListViewWrapper _lv_server = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_server = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_enviarbd = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_importarbd = null;
public anywheresoftware.b4a.objects.IME _ime = null;
public medicomed.keymon.com.mx.manageexternalstorage _mes1 = null;
public anywheresoftware.b4a.phone.Phone _device = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_server = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_guardar = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel11 = null;
public b4a.example3.customlistview _clv_pick_ciego = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_pick_ciego = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_pick_ciego = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_pick_ciego = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_ciego = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel4 = null;
public String _q_buscar = "";
public anywheresoftware.b4a.objects.EditTextWrapper _et_buspc = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _d = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _a = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _f = null;
public String _idenviar = "";
public anywheresoftware.b4a.objects.EditTextWrapper _et_codigo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_cancelarcodigo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_aceptar = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_validacion = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_recarga = null;
public String _recarga = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_add_monto = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_can_monto = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_aceptar_monto = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_add_monto = null;
public b4a.example.dateutils _dateutils = null;
public medicomed.keymon.com.mx.main _main = null;
public medicomed.keymon.com.mx.starter _starter = null;
public medicomed.keymon.com.mx.appupdater _appupdater = null;
public medicomed.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public medicomed.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public medicomed.keymon.com.mx.subs _subs = null;
public medicomed.keymon.com.mx.notificationservice _notificationservice = null;
public medicomed.keymon.com.mx.pendientes _pendientes = null;
public medicomed.keymon.com.mx.tracker _tracker = null;
public medicomed.keymon.com.mx.newinst2 _newinst2 = null;
public medicomed.keymon.com.mx.b4xpages _b4xpages = null;
public medicomed.keymon.com.mx.b4xcollections _b4xcollections = null;
public medicomed.keymon.com.mx.httputils2service _httputils2service = null;
public medicomed.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _b_aceptar_click() throws Exception{
 //BA.debugLineNum = 1154;BA.debugLine="Private Sub b_aceptar_Click";
 //BA.debugLineNum = 1155;BA.debugLine="f=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_CL";
_f = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info")));
 //BA.debugLineNum = 1156;BA.debugLine="f.Position=0";
_f.setPosition((int) (0));
 //BA.debugLineNum = 1158;BA.debugLine="a=B4XPages.MainPage.skmt.ExecQuery(\"select ID_ALM";
_a = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 1159;BA.debugLine="If a.RowCount>0 Then";
if (_a.getRowCount()>0) { 
 //BA.debugLineNum = 1160;BA.debugLine="a.Position=0";
_a.setPosition((int) (0));
 };
 //BA.debugLineNum = 1162;BA.debugLine="Log(a.GetString(\"ID_ALMACEN\"))";
__c.LogImpl("77077896",_a.GetString("ID_ALMACEN"),0);
 //BA.debugLineNum = 1163;BA.debugLine="Log(f.GetString(\"CAT_CL_RUTA\"))";
__c.LogImpl("77077897",_f.GetString("CAT_CL_RUTA"),0);
 //BA.debugLineNum = 1170;BA.debugLine="f.Close";
_f.Close();
 //BA.debugLineNum = 1171;BA.debugLine="a.Close";
_a.Close();
 //BA.debugLineNum = 1172;BA.debugLine="End Sub";
return "";
}
public String  _b_aceptar_monto_click() throws Exception{
 //BA.debugLineNum = 1174;BA.debugLine="Private Sub B_Aceptar_Monto_Click";
 //BA.debugLineNum = 1238;BA.debugLine="End Sub";
return "";
}
public String  _b_apk_click() throws Exception{
 //BA.debugLineNum = 869;BA.debugLine="Sub b_apk_Click";
 //BA.debugLineNum = 870;BA.debugLine="StartService(appUpdater)";
__c.StartService(ba,(Object)(_appupdater.getObject()));
 //BA.debugLineNum = 871;BA.debugLine="End Sub";
return "";
}
public String  _b_arqueocieego_click() throws Exception{
 //BA.debugLineNum = 936;BA.debugLine="Private Sub b_arqueocieego_Click";
 //BA.debugLineNum = 937;BA.debugLine="c = skmt.ExecQuery(\"SELECT * FROM CAT_GUNAPROD\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("SELECT * FROM CAT_GUNAPROD")));
 //BA.debugLineNum = 938;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 939;BA.debugLine="Subs.panelVisible(p_validacion,0,0)";
_subs._panelvisible /*String*/ (ba,_p_validacion,(int) (0),(int) (0));
 //BA.debugLineNum = 940;BA.debugLine="recarga = \"0\"";
_recarga = "0";
 }else {
 //BA.debugLineNum = 942;BA.debugLine="MsgboxAsync(\"No hay ruta cargada, favor de carga";
__c.MsgboxAsync(BA.ObjectToCharSequence("No hay ruta cargada, favor de cargar día"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 944;BA.debugLine="End Sub";
return "";
}
public String  _b_can_monto_click() throws Exception{
 //BA.debugLineNum = 1244;BA.debugLine="Private Sub B_Can_Monto_Click";
 //BA.debugLineNum = 1245;BA.debugLine="p_add_monto.Visible = False";
_p_add_monto.setVisible(__c.False);
 //BA.debugLineNum = 1246;BA.debugLine="End Sub";
return "";
}
public String  _b_cancelarcodigo_click() throws Exception{
 //BA.debugLineNum = 1240;BA.debugLine="Private Sub b_cancelarcodigo_Click";
 //BA.debugLineNum = 1241;BA.debugLine="p_validacion.Visible = False";
_p_validacion.setVisible(__c.False);
 //BA.debugLineNum = 1242;BA.debugLine="End Sub";
return "";
}
public String  _b_cargarmonto_click() throws Exception{
 //BA.debugLineNum = 1277;BA.debugLine="Private Sub b_CargarMonto_Click";
 //BA.debugLineNum = 1278;BA.debugLine="c = skmt.ExecQuery(\"SELECT *  FROM kmt_info\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("SELECT *  FROM kmt_info")));
 //BA.debugLineNum = 1279;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1280;BA.debugLine="If c.RowCount < 0 Or c.RowCount = 0 Then";
if (_c.getRowCount()<0 || _c.getRowCount()==0) { 
 //BA.debugLineNum = 1281;BA.debugLine="MsgboxAsync(\"No hay ruta cargada, favor de carga";
__c.MsgboxAsync(BA.ObjectToCharSequence("No hay ruta cargada, favor de cargar día"),BA.ObjectToCharSequence("Atención"),ba);
 }else {
 //BA.debugLineNum = 1283;BA.debugLine="Subs.panelVisible(p_add_monto,0,0)";
_subs._panelvisible /*String*/ (ba,_p_add_monto,(int) (0),(int) (0));
 };
 //BA.debugLineNum = 1285;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1286;BA.debugLine="End Sub";
return "";
}
public String  _b_enviarbd_click() throws Exception{
 //BA.debugLineNum = 918;BA.debugLine="Private Sub b_enviarbd_Click";
 //BA.debugLineNum = 920;BA.debugLine="End Sub";
return "";
}
public void  _b_enviobd_click() throws Exception{
ResumableSub_b_envioBD_Click rsub = new ResumableSub_b_envioBD_Click(this);
rsub.resume(ba, null);
}
public static class ResumableSub_b_envioBD_Click extends BA.ResumableSub {
public ResumableSub_b_envioBD_Click(medicomed.keymon.com.mx.b4xmainpage parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.b4xmainpage parent;
String _filename = "";
anywheresoftware.b4a.phone.Phone.Email _email = null;
anywheresoftware.b4a.objects.IntentWrapper _in = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = -1;
 //BA.debugLineNum = 1251;BA.debugLine="Dim FileName As String = \"kmt.db\"";
_filename = "kmt.db";
 //BA.debugLineNum = 1253;BA.debugLine="Log(\"xxxxxx:\"&Provider.SharedFolder)";
parent.__c.LogImpl("77340037","xxxxxx:"+parent._provider._sharedfolder /*String*/ ,0);
 //BA.debugLineNum = 1254;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 1;
return;
case 1:
//C
this.state = -1;
;
 //BA.debugLineNum = 1255;BA.debugLine="File.Copy(File.DirInternal, FileName, Provider.Sh";
parent.__c.File.Copy(parent.__c.File.getDirInternal(),_filename,parent._provider._sharedfolder /*String*/ ,_filename);
 //BA.debugLineNum = 1256;BA.debugLine="Dim email As Email";
_email = new anywheresoftware.b4a.phone.Phone.Email();
 //BA.debugLineNum = 1257;BA.debugLine="email.To.Add(\"soporte@keymonsoft.com\")";
_email.To.Add((Object)("soporte@keymonsoft.com"));
 //BA.debugLineNum = 1258;BA.debugLine="email.Subject = \"Envio Base de datos medicomed\"";
_email.Subject = "Envio Base de datos medicomed";
 //BA.debugLineNum = 1259;BA.debugLine="email.Attachments.Add(Provider.GetFileUri(FileNam";
_email.Attachments.Add(parent._provider._getfileuri /*Object*/ (_filename));
 //BA.debugLineNum = 1261;BA.debugLine="Dim in As Intent = email.GetIntent";
_in = new anywheresoftware.b4a.objects.IntentWrapper();
_in = (anywheresoftware.b4a.objects.IntentWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.IntentWrapper(), (android.content.Intent)(_email.GetIntent()));
 //BA.debugLineNum = 1262;BA.debugLine="in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION";
_in.setFlags((int) (1));
 //BA.debugLineNum = 1263;BA.debugLine="StartActivity(in)";
parent.__c.StartActivity(ba,(Object)(_in.getObject()));
 //BA.debugLineNum = 1264;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b_guardar_click() throws Exception{
 //BA.debugLineNum = 931;BA.debugLine="Private Sub b_guardar_Click";
 //BA.debugLineNum = 932;BA.debugLine="Starter.reinicializaReqManager(et_server.Text.Tri";
_starter._reinicializareqmanager /*String*/ (_et_server.getText().trim());
 //BA.debugLineNum = 933;BA.debugLine="p_appUpdate.Visible = False";
_p_appupdate.setVisible(__c.False);
 //BA.debugLineNum = 934;BA.debugLine="End Sub";
return "";
}
public void  _b_importarbd_click() throws Exception{
ResumableSub_b_importarBD_Click rsub = new ResumableSub_b_importarBD_Click(this);
rsub.resume(ba, null);
}
public static class ResumableSub_b_importarBD_Click extends BA.ResumableSub {
public ResumableSub_b_importarBD_Click(medicomed.keymon.com.mx.b4xmainpage parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.b4xmainpage parent;
medicomed.keymon.com.mx.filehandler _fh = null;
medicomed.keymon.com.mx.filehandler._loadresult _result = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = -1;
 //BA.debugLineNum = 923;BA.debugLine="Private FH As FileHandler";
_fh = new medicomed.keymon.com.mx.filehandler();
 //BA.debugLineNum = 924;BA.debugLine="FH.Initialize";
_fh._initialize /*String*/ (ba);
 //BA.debugLineNum = 925;BA.debugLine="Wait For (FH.Load) Complete (Result As LoadResult";
parent.__c.WaitFor("complete", ba, this, _fh._load /*anywheresoftware.b4a.keywords.Common.ResumableSubWrapper*/ ());
this.state = 1;
return;
case 1:
//C
this.state = -1;
_result = (medicomed.keymon.com.mx.filehandler._loadresult) result[0];
;
 //BA.debugLineNum = 926;BA.debugLine="File.Copy(Result.Dir, Result.FileName, File.DirIn";
parent.__c.File.Copy(_result.Dir /*String*/ ,_result.FileName /*String*/ ,parent.__c.File.getDirInternal(),"kmt.db");
 //BA.debugLineNum = 927;BA.debugLine="B4XPages.MainPage.skmt.Initialize(Starter.ruta,\"k";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(parent._starter._ruta /*String*/ ,"kmt.db",parent.__c.True);
 //BA.debugLineNum = 928;BA.debugLine="ToastMessageShow(\"¡BD importada!\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("¡BD importada!"),parent.__c.False);
 //BA.debugLineNum = 929;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _complete(medicomed.keymon.com.mx.filehandler._loadresult _result) throws Exception{
}
public String  _b_menu_click() throws Exception{
 //BA.debugLineNum = 795;BA.debugLine="Sub b_menu_Click";
 //BA.debugLineNum = 796;BA.debugLine="PopupMenu.Show";
_popupmenu.Show();
 //BA.debugLineNum = 797;BA.debugLine="End Sub";
return "";
}
public String  _b_pc_env_click() throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _itempanel = null;
anywheresoftware.b4a.objects.B4XViewWrapper _innerpanel = null;
anywheresoftware.b4a.objects.B4XViewWrapper _edittext = null;
String _inputtext = "";
anywheresoftware.b4a.objects.B4XViewWrapper _idlabel = null;
String _idtext = "";
String[] _idparts = null;
 //BA.debugLineNum = 1025;BA.debugLine="Private Sub B_PC_ENV_Click";
 //BA.debugLineNum = 1027;BA.debugLine="Dim sDate, sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 1028;BA.debugLine="DateTime.DateFormat = \"dd/MM/yyyy\"";
__c.DateTime.setDateFormat("dd/MM/yyyy");
 //BA.debugLineNum = 1029;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 1030;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1031;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1034;BA.debugLine="For i = 0 To CLV_PICK_CIEGO.Size - 1";
{
final int step6 = 1;
final int limit6 = (int) (_clv_pick_ciego._getsize()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
 //BA.debugLineNum = 1036;BA.debugLine="Dim itemPanel As B4XView = CLV_PICK_CIEGO.GetPan";
_itempanel = new anywheresoftware.b4a.objects.B4XViewWrapper();
_itempanel = _clv_pick_ciego._getpanel(_i);
 //BA.debugLineNum = 1037;BA.debugLine="Dim innerPanel As B4XView = itemPanel.GetView(0)";
_innerpanel = new anywheresoftware.b4a.objects.B4XViewWrapper();
_innerpanel = _itempanel.GetView((int) (0));
 //BA.debugLineNum = 1038;BA.debugLine="Dim editText As B4XView = innerPanel.GetView(1)";
_edittext = new anywheresoftware.b4a.objects.B4XViewWrapper();
_edittext = _innerpanel.GetView((int) (1));
 //BA.debugLineNum = 1039;BA.debugLine="Dim inputText As String = editText.As(EditText).";
_inputtext = ((anywheresoftware.b4a.objects.EditTextWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.EditTextWrapper(), (android.widget.EditText)(_edittext.getObject()))).getText();
 //BA.debugLineNum = 1042;BA.debugLine="If Regex.IsMatch(\"^[0]+$\", inputText) Or inputTe";
if (__c.Regex.IsMatch("^[0]+$",_inputtext) || (_inputtext).equals("")) { 
 //BA.debugLineNum = 1043;BA.debugLine="inputText = \"0\"";
_inputtext = "0";
 };
 //BA.debugLineNum = 1047;BA.debugLine="Dim idLabel As B4XView = innerPanel.GetView(0)";
_idlabel = new anywheresoftware.b4a.objects.B4XViewWrapper();
_idlabel = _innerpanel.GetView((int) (0));
 //BA.debugLineNum = 1048;BA.debugLine="Dim idText As String = idLabel.As(Label).Text";
_idtext = ((anywheresoftware.b4a.objects.LabelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.LabelWrapper(), (android.widget.TextView)(_idlabel.getObject()))).getText();
 //BA.debugLineNum = 1049;BA.debugLine="Dim idParts() As String = Regex.Split(CRLF, idTe";
_idparts = __c.Regex.Split(__c.CRLF,_idtext);
 //BA.debugLineNum = 1051;BA.debugLine="f=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_C";
_f = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info")));
 //BA.debugLineNum = 1052;BA.debugLine="f.Position=0";
_f.setPosition((int) (0));
 //BA.debugLineNum = 1054;BA.debugLine="a=B4XPages.MainPage.skmt.ExecQuery(\"select ID_AL";
_a = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 1055;BA.debugLine="If a.RowCount>0 Then";
if (_a.getRowCount()>0) { 
 //BA.debugLineNum = 1056;BA.debugLine="a.Position=0";
_a.setPosition((int) (0));
 };
 //BA.debugLineNum = 1061;BA.debugLine="If inputText <> 0 Then";
if ((_inputtext).equals(BA.NumberToString(0)) == false) { 
 //BA.debugLineNum = 1062;BA.debugLine="c = Starter.skmt.ExecQuery2(\"SELECT * FROM PICK";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM PICK_CIEGO where PC_ID_PROD = ?",new String[]{_idparts[(int) (0)]})));
 //BA.debugLineNum = 1063;BA.debugLine="If c.RowCount = 0 Then";
if (_c.getRowCount()==0) { 
 //BA.debugLineNum = 1065;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO PICK_CIEGO(PC_";
_skmt.ExecNonQuery2("INSERT INTO PICK_CIEGO(PC_ID_PROD, PC_NOM_PROD, PC_CANT, PC_ALMACEN, PC_RUTA, PC_FECHA) VALUES(?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_idparts[(int) (0)],_idparts[(int) (1)],_inputtext,_a.GetString("ID_ALMACEN"),_f.GetString("CAT_CL_RUTA"),_sdate+" "+_stime}));
 }else {
 //BA.debugLineNum = 1067;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"Update P";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("Update PICK_CIEGO set PC_CANT = ?  WHERE PC_ID_PROD = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_inputtext,_idparts[(int) (0)]}));
 };
 };
 //BA.debugLineNum = 1070;BA.debugLine="f.Close";
_f.Close();
 //BA.debugLineNum = 1071;BA.debugLine="a.Close";
_a.Close();
 }
};
 //BA.debugLineNum = 1074;BA.debugLine="et_buspc.Text = \"\"";
_et_buspc.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 1075;BA.debugLine="CLV_PICK_CIEGO.Clear";
_clv_pick_ciego._clear();
 //BA.debugLineNum = 1077;BA.debugLine="End Sub";
return "";
}
public String  _b_recarga_click() throws Exception{
 //BA.debugLineNum = 1266;BA.debugLine="Private Sub b_recarga_Click";
 //BA.debugLineNum = 1267;BA.debugLine="c = skmt.ExecQuery(\"SELECT * FROM CAT_GUNAPROD\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("SELECT * FROM CAT_GUNAPROD")));
 //BA.debugLineNum = 1268;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1269;BA.debugLine="Subs.panelVisible(p_validacion,0,0)";
_subs._panelvisible /*String*/ (ba,_p_validacion,(int) (0),(int) (0));
 //BA.debugLineNum = 1270;BA.debugLine="recarga = \"1\"";
_recarga = "1";
 }else {
 //BA.debugLineNum = 1272;BA.debugLine="MsgboxAsync(\"No hay ruta cargada, favor de carga";
__c.MsgboxAsync(BA.ObjectToCharSequence("No hay ruta cargada, favor de cargar día"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 1274;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1275;BA.debugLine="End Sub";
return "";
}
public String  _b_regesar_click() throws Exception{
 //BA.debugLineNum = 897;BA.debugLine="Sub b_regesar_Click";
 //BA.debugLineNum = 898;BA.debugLine="Subs.panelVisible(p_Main,0,0)";
_subs._panelvisible /*String*/ (ba,_p_main,(int) (0),(int) (0));
 //BA.debugLineNum = 899;BA.debugLine="End Sub";
return "";
}
public void  _b_terpc_click() throws Exception{
ResumableSub_b_terpc_Click rsub = new ResumableSub_b_terpc_Click(this);
rsub.resume(ba, null);
}
public static class ResumableSub_b_terpc_Click extends BA.ResumableSub {
public ResumableSub_b_terpc_Click(medicomed.keymon.com.mx.b4xmainpage parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.b4xmainpage parent;
int _resultado = 0;
int _i = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _itempanel = null;
anywheresoftware.b4a.objects.B4XViewWrapper _innerpanel = null;
anywheresoftware.b4a.objects.B4XViewWrapper _edittext = null;
String _inputtext = "";
anywheresoftware.b4a.objects.B4XViewWrapper _idlabel = null;
String _idtext = "";
String[] _idparts = null;
int step12;
int limit12;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 1080;BA.debugLine="Msgbox2Async(\"Una vez enviada la información no p";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("Una vez enviada la información no podras hacer modificaciones"),BA.ObjectToCharSequence("Atención"),"SI","","",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 1081;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 33;
return;
case 33:
//C
this.state = 1;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 1082;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 1:
//if
this.state = 32;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 1083;BA.debugLine="Msgbox2Async(\"Estas seguro de enviar la informac";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("Estas seguro de enviar la información?"),BA.ObjectToCharSequence("Atención"),"SI","","NO",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 1084;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 34;
return;
case 34:
//C
this.state = 4;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 1085;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 4:
//if
this.state = 31;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 6;
}else {
this.state = 30;
}if (true) break;

case 6:
//C
this.state = 7;
 //BA.debugLineNum = 1087;BA.debugLine="Dim sDate, sTime As String";
parent._sdate = "";
parent._stime = "";
 //BA.debugLineNum = 1088;BA.debugLine="DateTime.DateFormat = \"dd/MM/yyyy\"";
parent.__c.DateTime.setDateFormat("dd/MM/yyyy");
 //BA.debugLineNum = 1089;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
parent.__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 1090;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1091;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1093;BA.debugLine="For i = 0 To CLV_PICK_CIEGO.Size - 1";
if (true) break;

case 7:
//for
this.state = 28;
step12 = 1;
limit12 = (int) (parent._clv_pick_ciego._getsize()-1);
_i = (int) (0) ;
this.state = 35;
if (true) break;

case 35:
//C
this.state = 28;
if ((step12 > 0 && _i <= limit12) || (step12 < 0 && _i >= limit12)) this.state = 9;
if (true) break;

case 36:
//C
this.state = 35;
_i = ((int)(0 + _i + step12)) ;
if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 1095;BA.debugLine="Dim itemPanel As B4XView = CLV_PICK_CIEGO.GetP";
_itempanel = new anywheresoftware.b4a.objects.B4XViewWrapper();
_itempanel = parent._clv_pick_ciego._getpanel(_i);
 //BA.debugLineNum = 1096;BA.debugLine="Dim innerPanel As B4XView = itemPanel.GetView(";
_innerpanel = new anywheresoftware.b4a.objects.B4XViewWrapper();
_innerpanel = _itempanel.GetView((int) (0));
 //BA.debugLineNum = 1097;BA.debugLine="Dim editText As B4XView = innerPanel.GetView(1";
_edittext = new anywheresoftware.b4a.objects.B4XViewWrapper();
_edittext = _innerpanel.GetView((int) (1));
 //BA.debugLineNum = 1098;BA.debugLine="Dim inputText As String = editText.As(EditText";
_inputtext = ((anywheresoftware.b4a.objects.EditTextWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.EditTextWrapper(), (android.widget.EditText)(_edittext.getObject()))).getText();
 //BA.debugLineNum = 1101;BA.debugLine="If Regex.IsMatch(\"^[0]+$\", inputText) Or input";
if (true) break;

case 10:
//if
this.state = 13;
if (parent.__c.Regex.IsMatch("^[0]+$",_inputtext) || (_inputtext).equals("")) { 
this.state = 12;
}if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 1102;BA.debugLine="inputText = \"0\"";
_inputtext = "0";
 if (true) break;

case 13:
//C
this.state = 14;
;
 //BA.debugLineNum = 1106;BA.debugLine="Dim idLabel As B4XView = innerPanel.GetView(0)";
_idlabel = new anywheresoftware.b4a.objects.B4XViewWrapper();
_idlabel = _innerpanel.GetView((int) (0));
 //BA.debugLineNum = 1107;BA.debugLine="Dim idText As String = idLabel.As(Label).Text";
_idtext = ((anywheresoftware.b4a.objects.LabelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.LabelWrapper(), (android.widget.TextView)(_idlabel.getObject()))).getText();
 //BA.debugLineNum = 1108;BA.debugLine="Dim idParts() As String = Regex.Split(CRLF, id";
_idparts = parent.__c.Regex.Split(parent.__c.CRLF,_idtext);
 //BA.debugLineNum = 1110;BA.debugLine="f=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
parent._f = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info")));
 //BA.debugLineNum = 1111;BA.debugLine="f.Position=0";
parent._f.setPosition((int) (0));
 //BA.debugLineNum = 1113;BA.debugLine="a=B4XPages.MainPage.skmt.ExecQuery(\"select ID_";
parent._a = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 1114;BA.debugLine="If a.RowCount>0 Then";
if (true) break;

case 14:
//if
this.state = 17;
if (parent._a.getRowCount()>0) { 
this.state = 16;
}if (true) break;

case 16:
//C
this.state = 17;
 //BA.debugLineNum = 1115;BA.debugLine="a.Position=0";
parent._a.setPosition((int) (0));
 if (true) break;

case 17:
//C
this.state = 18;
;
 //BA.debugLineNum = 1117;BA.debugLine="Log(a.GetString(\"ID_ALMACEN\"))";
parent.__c.LogImpl("77012390",parent._a.GetString("ID_ALMACEN"),0);
 //BA.debugLineNum = 1118;BA.debugLine="Log(f.GetString(\"CAT_CL_RUTA\"))";
parent.__c.LogImpl("77012391",parent._f.GetString("CAT_CL_RUTA"),0);
 //BA.debugLineNum = 1119;BA.debugLine="If inputText <> 0 Then";
if (true) break;

case 18:
//if
this.state = 27;
if ((_inputtext).equals(BA.NumberToString(0)) == false) { 
this.state = 20;
}if (true) break;

case 20:
//C
this.state = 21;
 //BA.debugLineNum = 1120;BA.debugLine="c = Starter.skmt.ExecQuery2(\"SELECT * FROM PI";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM PICK_CIEGO where PC_ID_PROD = ?",new String[]{_idparts[(int) (0)]})));
 //BA.debugLineNum = 1121;BA.debugLine="If c.RowCount = 0 Then";
if (true) break;

case 21:
//if
this.state = 26;
if (parent._c.getRowCount()==0) { 
this.state = 23;
}else {
this.state = 25;
}if (true) break;

case 23:
//C
this.state = 26;
 //BA.debugLineNum = 1123;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO PICK_CIEGO(P";
parent._skmt.ExecNonQuery2("INSERT INTO PICK_CIEGO(PC_ID_PROD, PC_NOM_PROD, PC_CANT, PC_ALMACEN, PC_RUTA, PC_FECHA) VALUES(?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_idparts[(int) (0)],_idparts[(int) (1)],_inputtext,parent._a.GetString("ID_ALMACEN"),parent._f.GetString("CAT_CL_RUTA"),parent._sdate+" "+parent._stime}));
 if (true) break;

case 25:
//C
this.state = 26;
 //BA.debugLineNum = 1125;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"Update";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("Update PICK_CIEGO set PC_CANT = ?  WHERE PC_ID_PROD = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_inputtext,_idparts[(int) (0)]}));
 if (true) break;

case 26:
//C
this.state = 27;
;
 if (true) break;

case 27:
//C
this.state = 36;
;
 //BA.debugLineNum = 1128;BA.debugLine="f.Close";
parent._f.Close();
 //BA.debugLineNum = 1129;BA.debugLine="a.Close";
parent._a.Close();
 //BA.debugLineNum = 1130;BA.debugLine="Log(\"Processed item \" & i)";
parent.__c.LogImpl("77012403","Processed item "+BA.NumberToString(_i),0);
 if (true) break;
if (true) break;

case 28:
//C
this.state = 31;
;
 //BA.debugLineNum = 1132;BA.debugLine="Log(\"Finished processing all items\")";
parent.__c.LogImpl("77012405","Finished processing all items",0);
 //BA.debugLineNum = 1133;BA.debugLine="P_CIEGO.Visible = False";
parent._p_ciego.setVisible(parent.__c.False);
 //BA.debugLineNum = 1134;BA.debugLine="et_buspc.Text = \"\"";
parent._et_buspc.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 1135;BA.debugLine="CLV_PICK_CIEGO.Clear";
parent._clv_pick_ciego._clear();
 if (true) break;

case 30:
//C
this.state = 31;
 if (true) break;

case 31:
//C
this.state = 32;
;
 if (true) break;

case 32:
//C
this.state = -1;
;
 //BA.debugLineNum = 1152;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _msgbox_result(int _resultado) throws Exception{
}
public void  _b4xpage_appear() throws Exception{
ResumableSub_B4XPage_Appear rsub = new ResumableSub_B4XPage_Appear(this);
rsub.resume(ba, null);
}
public static class ResumableSub_B4XPage_Appear extends BA.ResumableSub {
public ResumableSub_B4XPage_Appear(medicomed.keymon.com.mx.b4xmainpage parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.b4xmainpage parent;
anywheresoftware.b4a.phone.Phone _ph = null;
String _deviceid = "";

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 314;BA.debugLine="Log(recarga)";
parent.__c.LogImpl("75177345",parent._recarga,0);
 //BA.debugLineNum = 315;BA.debugLine="If Starter.muestraProgreso = 1 Then";
if (true) break;

case 1:
//if
this.state = 4;
if ((parent._starter._muestraprogreso /*String*/ ).equals(BA.NumberToString(1))) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 316;BA.debugLine="muestraProgreso(\"Descargando actualización\")";
parent._muestraprogreso("Descargando actualización");
 //BA.debugLineNum = 317;BA.debugLine="Starter.muestraProgreso = 0";
parent._starter._muestraprogreso /*String*/  = BA.NumberToString(0);
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 319;BA.debugLine="Dim ph As Phone 'Get Id Device";
_ph = new anywheresoftware.b4a.phone.Phone();
 //BA.debugLineNum = 320;BA.debugLine="Dim DeviceID As String = ph.GetSettings(\"android_";
_deviceid = _ph.GetSettings("android_id").toUpperCase();
 //BA.debugLineNum = 321;BA.debugLine="LogColor($\"//////////////////   DeviceID: ${Devic";
parent.__c.LogImpl("75177352",("//////////////////   DeviceID: "+parent.__c.SmartStringFormatter("",(Object)(_deviceid))+" ////////////////// "),parent.__c.Colors.Blue);
 //BA.debugLineNum = 322;BA.debugLine="DBReqServer = Starter.DBReqServer";
parent._dbreqserver = parent._starter._dbreqserver /*String*/ ;
 //BA.debugLineNum = 323;BA.debugLine="reqManager.Initialize(Me, Starter.DBReqServer)";
parent._reqmanager._initialize /*String*/ (ba,parent,parent._starter._dbreqserver /*String*/ );
 //BA.debugLineNum = 324;BA.debugLine="Log(\"|\"&Starter.DBReqServer&\"|\")";
parent.__c.LogImpl("75177355","|"+parent._starter._dbreqserver /*String*/ +"|",0);
 //BA.debugLineNum = 325;BA.debugLine="tgl.Initialize()";
parent._tgl.Initialize(ba);
 //BA.debugLineNum = 326;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (true) break;

case 5:
//if
this.state = 8;
if (parent.__c.Not(parent._starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
this.state = 7;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 327;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),parent.__c.True);
 //BA.debugLineNum = 328;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 19;
return;
case 19:
//C
this.state = 8;
;
 //BA.debugLineNum = 329;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
parent.__c.StartActivity(ba,(Object)(parent._starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 331;BA.debugLine="c=skmt.ExecQuery2(\"select count(*) as CUANTOS fro";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select count(*) as CUANTOS from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"FECHA"})));
 //BA.debugLineNum = 332;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 333;BA.debugLine="If c.GetString(\"CUANTOS\") = 0 Then";
if (true) break;

case 9:
//if
this.state = 18;
if ((parent._c.GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
this.state = 11;
}else {
this.state = 13;
}if (true) break;

case 11:
//C
this.state = 18;
 //BA.debugLineNum = 334;BA.debugLine="LogColor($\"No hay fecha: ${c.GetString(\"CUANTOS\"";
parent.__c.LogImpl("75177365",("No hay fecha: "+parent.__c.SmartStringFormatter("",(Object)(parent._c.GetString("CUANTOS")))+""),parent.__c.Colors.Red);
 //BA.debugLineNum = 335;BA.debugLine="cmd.Initialize";
parent._cmd.Initialize();
 //BA.debugLineNum = 336;BA.debugLine="cmd.Name = \"select_fecha\"";
parent._cmd.Name /*String*/  = "select_fecha";
 //BA.debugLineNum = 337;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"fecha\")";
parent._reqmanager._executequery /*String*/ (parent._cmd,(int) (0),(Object)("fecha"));
 //BA.debugLineNum = 338;BA.debugLine="Msgbox(\"AJUSTAR FECHA\",\"AVISO\") 'Ignore";
parent.__c.Msgbox(BA.ObjectToCharSequence("AJUSTAR FECHA"),BA.ObjectToCharSequence("AVISO"),ba);
 //BA.debugLineNum = 339;BA.debugLine="B4XPage_Appear";
parent._b4xpage_appear();
 if (true) break;

case 13:
//C
this.state = 14;
 //BA.debugLineNum = 342;BA.debugLine="c=skmt.ExecQuery2(\"select CAT_VA_VALOR from CAT_";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"FECHA"})));
 //BA.debugLineNum = 343;BA.debugLine="c.Position =0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 344;BA.debugLine="Dim sDate, sTime As String";
parent._sdate = "";
parent._stime = "";
 //BA.debugLineNum = 345;BA.debugLine="DateTime.DateFormat = \"yyyyMMdd\"";
parent.__c.DateTime.setDateFormat("yyyyMMdd");
 //BA.debugLineNum = 346;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 351;BA.debugLine="If c.GetString(\"CAT_VA_VALOR\") > sDate Then";
if (true) break;

case 14:
//if
this.state = 17;
if ((double)(Double.parseDouble(parent._c.GetString("CAT_VA_VALOR")))>(double)(Double.parseDouble(parent._sdate))) { 
this.state = 16;
}if (true) break;

case 16:
//C
this.state = 17;
 //BA.debugLineNum = 352;BA.debugLine="Msgbox(\"AJUSTAR LA FECHA YA QUE ES MENOR AL SIS";
parent.__c.Msgbox(BA.ObjectToCharSequence("AJUSTAR LA FECHA YA QUE ES MENOR AL SISTEMA"),BA.ObjectToCharSequence("AVISO"),ba);
 //BA.debugLineNum = 353;BA.debugLine="B4XPage_Appear";
parent._b4xpage_appear();
 if (true) break;

case 17:
//C
this.state = 18;
;
 if (true) break;

case 18:
//C
this.state = -1;
;
 //BA.debugLineNum = 356;BA.debugLine="bu.Initialize";
parent._bu._initialize /*String*/ (ba);
 //BA.debugLineNum = 357;BA.debugLine="batterystatus = bu.BatteryInformation";
parent._batterystatus = parent._bu._getbatteryinformation /*int[]*/ ();
 //BA.debugLineNum = 360;BA.debugLine="dameUsuario";
parent._dameusuario();
 //BA.debugLineNum = 381;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest() throws Exception{
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(medicomed.keymon.com.mx.b4xmainpage parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.b4xmainpage parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 756;BA.debugLine="Log(\"closreq\")";
parent.__c.LogImpl("75373953","closreq",0);
 //BA.debugLineNum = 757;BA.debugLine="Sleep(0)";
parent.__c.Sleep(ba,this,(int) (0));
this.state = 14;
return;
case 14:
//C
this.state = 1;
;
 //BA.debugLineNum = 759;BA.debugLine="If p_add_monto.IsInitialized And p_add_monto.Visi";
if (true) break;

case 1:
//if
this.state = 10;
if (parent._p_add_monto.IsInitialized() && parent._p_add_monto.getVisible()) { 
this.state = 3;
}else if(parent._p_validacion.IsInitialized() && parent._p_validacion.getVisible()) { 
this.state = 5;
}else if(parent._p_ciego.IsInitialized() && parent._p_ciego.getVisible()) { 
this.state = 7;
}else if(parent._p_appupdate.IsInitialized() && parent._p_appupdate.getVisible()) { 
this.state = 9;
}if (true) break;

case 3:
//C
this.state = 10;
 //BA.debugLineNum = 760;BA.debugLine="p_add_monto.Visible = False";
parent._p_add_monto.setVisible(parent.__c.False);
 //BA.debugLineNum = 761;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 5:
//C
this.state = 10;
 //BA.debugLineNum = 763;BA.debugLine="p_validacion.Visible = False";
parent._p_validacion.setVisible(parent.__c.False);
 //BA.debugLineNum = 764;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 7:
//C
this.state = 10;
 //BA.debugLineNum = 766;BA.debugLine="MsgboxAsync(\"Debes de terminar el proceso para r";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence("Debes de terminar el proceso para regresar a la pantalla principal"),BA.ObjectToCharSequence("Atención"),ba);
 //BA.debugLineNum = 767;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 769;BA.debugLine="p_appUpdate.Visible = False";
parent._p_appupdate.setVisible(parent.__c.False);
 //BA.debugLineNum = 770;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;
;
 //BA.debugLineNum = 772;BA.debugLine="If Not(p_appUpdate.Visible) Then";

case 10:
//if
this.state = 13;
if (parent.__c.Not(parent._p_appupdate.getVisible())) { 
this.state = 12;
}if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 773;BA.debugLine="Log(\"ExitApplication\")";
parent.__c.LogImpl("75373970","ExitApplication",0);
 //BA.debugLineNum = 774;BA.debugLine="ExitApplication";
parent.__c.ExitApplication();
 if (true) break;

case 13:
//C
this.state = -1;
;
 //BA.debugLineNum = 776;BA.debugLine="Return True";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.True));return;};
 //BA.debugLineNum = 777;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
ResumableSub_B4XPage_Created rsub = new ResumableSub_B4XPage_Created(this,_root1);
rsub.resume(ba, null);
}
public static class ResumableSub_B4XPage_Created extends BA.ResumableSub {
public ResumableSub_B4XPage_Created(medicomed.keymon.com.mx.b4xmainpage parent,anywheresoftware.b4a.objects.B4XViewWrapper _root1) {
this.parent = parent;
this._root1 = _root1;
}
medicomed.keymon.com.mx.b4xmainpage parent;
anywheresoftware.b4a.objects.B4XViewWrapper _root1;
String _permission = "";
boolean _result = false;
int _sdkversion = 0;
anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
int _res = 0;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 131;BA.debugLine="B4XPages.GetManager.LogEvents = True";
parent._b4xpages._getmanager /*medicomed.keymon.com.mx.b4xpagesmanager*/ (ba)._logevents /*boolean*/  = parent.__c.True;
 //BA.debugLineNum = 132;BA.debugLine="Root = Root1";
parent._root = _root1;
 //BA.debugLineNum = 133;BA.debugLine="Root.LoadLayout(\"login\")";
parent._root.LoadLayout("login",ba);
 //BA.debugLineNum = 134;BA.debugLine="s.Initialize(Me, \"Subs\")";
parent._s._initialize /*Object*/ (ba,parent,"Subs");
 //BA.debugLineNum = 135;BA.debugLine="B4XPages.SetTitle(Me, \"Medicomed\")";
parent._b4xpages._settitle /*String*/ (ba,parent,(Object)("Medicomed"));
 //BA.debugLineNum = 136;BA.debugLine="login.Initialize";
parent._login._initialize /*String*/ (ba);
 //BA.debugLineNum = 137;BA.debugLine="B4XPages.AddPage(\"Login\", login)";
parent._b4xpages._addpage /*String*/ (ba,"Login",(Object)(parent._login));
 //BA.debugLineNum = 138;BA.debugLine="principal.Initialize";
parent._principal._initialize /*Object*/ (ba);
 //BA.debugLineNum = 139;BA.debugLine="B4XPages.AddPage(\"Principal\", principal)";
parent._b4xpages._addpage /*String*/ (ba,"Principal",(Object)(parent._principal));
 //BA.debugLineNum = 140;BA.debugLine="clientes.Initialize";
parent._clientes._initialize /*Object*/ (ba);
 //BA.debugLineNum = 141;BA.debugLine="B4XPages.AddPage(\"Clientes\", clientes)";
parent._b4xpages._addpage /*String*/ (ba,"Clientes",(Object)(parent._clientes));
 //BA.debugLineNum = 142;BA.debugLine="cliente.Initialize";
parent._cliente._initialize /*Object*/ (ba);
 //BA.debugLineNum = 143;BA.debugLine="B4XPages.AddPage(\"Cliente\", cliente)";
parent._b4xpages._addpage /*String*/ (ba,"Cliente",(Object)(parent._cliente));
 //BA.debugLineNum = 144;BA.debugLine="productos.Initialize";
parent._productos._initialize /*Object*/ (ba);
 //BA.debugLineNum = 145;BA.debugLine="B4XPages.AddPage(\"Productos\", productos)";
parent._b4xpages._addpage /*String*/ (ba,"Productos",(Object)(parent._productos));
 //BA.debugLineNum = 146;BA.debugLine="updateAvailable.Initialize";
parent._updateavailable._initialize /*Object*/ (ba);
 //BA.debugLineNum = 147;BA.debugLine="B4XPages.AddPage(\"updateAvailable\", updateAvailab";
parent._b4xpages._addpage /*String*/ (ba,"updateAvailable",(Object)(parent._updateavailable));
 //BA.debugLineNum = 148;BA.debugLine="mapas.Initialize";
parent._mapas._initialize /*Object*/ (ba);
 //BA.debugLineNum = 149;BA.debugLine="B4XPages.AddPage(\"Mapas\", mapas)";
parent._b4xpages._addpage /*String*/ (ba,"Mapas",(Object)(parent._mapas));
 //BA.debugLineNum = 150;BA.debugLine="nuevoCliente.Initialize";
parent._nuevocliente._initialize /*Object*/ (ba);
 //BA.debugLineNum = 151;BA.debugLine="B4XPages.AddPage(\"NuevoCliente\", nuevoCliente)";
parent._b4xpages._addpage /*String*/ (ba,"NuevoCliente",(Object)(parent._nuevocliente));
 //BA.debugLineNum = 152;BA.debugLine="ticketsDia.Initialize";
parent._ticketsdia._initialize /*Object*/ (ba);
 //BA.debugLineNum = 153;BA.debugLine="B4XPages.AddPage(\"TicketsDia\", ticketsDia)";
parent._b4xpages._addpage /*String*/ (ba,"TicketsDia",(Object)(parent._ticketsdia));
 //BA.debugLineNum = 154;BA.debugLine="noVenta.Initialize";
parent._noventa._initialize /*Object*/ (ba);
 //BA.debugLineNum = 155;BA.debugLine="B4XPages.AddPage(\"NoVenta\", noVenta)";
parent._b4xpages._addpage /*String*/ (ba,"NoVenta",(Object)(parent._noventa));
 //BA.debugLineNum = 156;BA.debugLine="nota.Initialize";
parent._nota._initialize /*Object*/ (ba);
 //BA.debugLineNum = 157;BA.debugLine="B4XPages.AddPage(\"Nota\", nota)";
parent._b4xpages._addpage /*String*/ (ba,"Nota",(Object)(parent._nota));
 //BA.debugLineNum = 158;BA.debugLine="pedidos.Initialize";
parent._pedidos._initialize /*Object*/ (ba);
 //BA.debugLineNum = 159;BA.debugLine="B4XPages.AddPage(\"Pedidos\", pedidos)";
parent._b4xpages._addpage /*String*/ (ba,"Pedidos",(Object)(parent._pedidos));
 //BA.debugLineNum = 160;BA.debugLine="promos.Initialize";
parent._promos._initialize /*Object*/ (ba);
 //BA.debugLineNum = 161;BA.debugLine="B4XPages.AddPage(\"Promos\", promos)";
parent._b4xpages._addpage /*String*/ (ba,"Promos",(Object)(parent._promos));
 //BA.debugLineNum = 162;BA.debugLine="historico.Initialize";
parent._historico._initialize /*Object*/ (ba);
 //BA.debugLineNum = 163;BA.debugLine="B4XPages.AddPage(\"Historico\", historico)";
parent._b4xpages._addpage /*String*/ (ba,"Historico",(Object)(parent._historico));
 //BA.debugLineNum = 166;BA.debugLine="ruta = Starter.ruta";
parent._ruta = parent._starter._ruta /*String*/ ;
 //BA.debugLineNum = 167;BA.debugLine="Provider.Initialize";
parent._provider._initialize /*String*/ (ba);
 //BA.debugLineNum = 170;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (true) break;

case 1:
//if
this.state = 4;
if (parent.__c.File.Exists(parent._ruta,"kmt.db")==parent.__c.False) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 171;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
parent.__c.File.Copy(parent.__c.File.getDirAssets(),"kmt.db",parent._ruta,"kmt.db");
 //BA.debugLineNum = 172;BA.debugLine="LogColor(\"copiamos kmt.db de \"&File.DirAssets &";
parent.__c.LogImpl("75111850","copiamos kmt.db de "+parent.__c.File.getDirAssets()+" a "+parent._ruta,parent.__c.Colors.Green);
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 176;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
parent._skmt.Initialize(parent._ruta,"kmt.db",parent.__c.True);
 //BA.debugLineNum = 177;BA.debugLine="Subs.guardaAppInfo(skmt)";
parent._subs._guardaappinfo /*String*/ (ba,parent._skmt);
 //BA.debugLineNum = 179;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS CLI";
parent._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)");
 //BA.debugLineNum = 180;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS RUT";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTAA (RUTAA TEXT)");
 //BA.debugLineNum = 181;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._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)");
 //BA.debugLineNum = 182;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_GPS (HGDATE TEXT, HGLAT TEXT, HGLON TEXT)");
 //BA.debugLineNum = 183;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS CAT";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_GIRO(GIRO TEXT)");
 //BA.debugLineNum = 184;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS PIC";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS PICKCIEGO_HECHO(HECHO TEXT)");
 //BA.debugLineNum = 185;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS CAT";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS CAT_GUNAPROD2 (CAT_GP_INICIATIVA TEXT, CAT_GP_TIPOPROD TEXT, CAT_GP_DEV TEXT, CAT_GP_ALMACEN NUMERIC, CAT_GP_ID TEXT, CAT_GP_NOMBRE TEXT, CAT_GP_IMP1 TEXT, CAT_GP_IMP2 TEXT, CAT_GP_PRECIO TEXT, CAT_GP_CLASIF TEXT, CAT_GP_STS TEXT, CAT_GP_TIPO TEXT, CAT_GP_SUBTIPO TEXT, CAT_GP_IMG BLOB)");
 //BA.debugLineNum = 186;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_STAY_STORE (HSS_CODIGO TEXT, HSS_IN TEXT, HSS_OUT TEXT, HSS_TOT TEXT)");
 //BA.debugLineNum = 187;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_STAY_OUT (HSO_INI TEXT, HSO_FIN TEXT)");
 //BA.debugLineNum = 188;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS INV";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS INVENT_X_ENVIAR (ALMACEN TEXT, PROID TEXT, CANTIDAD TEXT)");
 //BA.debugLineNum = 189;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_RESUM_APK (HIST_RA_OBJMES TEXT, HIST_RA_VENTA TEXT, HIST_RA_TENDENCIA TEXT, HIST_RA_ALCANCE TEXT, HISR_RA_DRAOBJ TEXT, HIST_RA_DRAVTA TEXT, HIST_RA_DSOBJ TEXT, HIST_RA_DSVTA TEXT, HIST_RA_VPOOBJ TEXT, HIST_RA_VPOVTA TEXT, HIST_RA_COBCCC TEXT, HIST_RA_CTES TEXT, HIST_RA_ECO TEXT, HIST_RA_VISITPLAN TEXT, HIST_RA_VISIREAL TEXT, HIST_RA_COBVISIT TEXT, HIST_RA_FRECCOMPOBJ TEXT, HIST_RA_FRECCOMREAL TEXT, HIST_RA_VENTAMES1 TEXT, HIST_RA_VENTAMES2 TEXT, HIST_RA_VENTAMES3 TEXT, HIST_RA_VENTAMES4 TEXT, HIST_RA_RECHAZO TEXT, HIST_RA_RECHAZOPORCEN TEXT, HIST_RA_SEMANA1 TEXT, HIST_RA_SEMANA1_DIAS TEXT, HIST_RA_SEMANA1_DRA TEXT, HIST_RA_SEMANA2 TEXT, HIST_RA_SEMANA2_DIAS TEXT, HIST_RA_SEMANA2_DRA TEXT, HIST_RA_SEMANA3 TEXT, HIST_RA_SEMANA3_DIAS TEXT, HIST_RA_SEMANA4 TEXT, HIST_RA_SEMANA3_DRA TEXT, HIST_RA_SEMANA4_DIAS TEXT, HIST_RA_SEMANA4_DRA TEXT, HIST_RA_SEMANA5 TEXT, HIST_RA_SEMANA5_DIAS TEXT, HIST_RA_SEMANA5_DRA TEXT, HIST_RA_SEMANA1_LPT TEXT, HIST_RA_SEMANA2_LPT TEXT, HIST_RA_SEMANA3_LPT TEXT, HIST_RA_SEMANA4_LPT TEXT, HIST_RA_SEMANA5_LPT TEXT, HIST_RA_RUTA TEXT, HIST_RA_IDALMACEN TEXT)");
 //BA.debugLineNum = 190;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_COMISIONES_MOVIL (HCM_IDALMACEN TEXT, HCM_RUTA TEXT, HCM_TOTAL_V TEXT, HCM_TOTAL_VIVE TEXT, HCM_TOTAL_GUNA TEXT,	HCM_TOTAL_BEB TEXT)");
 //BA.debugLineNum = 191;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_GEOCERCA (HGCLIENTE TEXT, HGDATE TEXT, HGLAT TEXT, HGLON TEXT)");
 //BA.debugLineNum = 192;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_FACE (HFCLIENTE TEXT, HFALIAS TEXT, HFRUTA TEXT, HFALMACEN TEXT)");
 //BA.debugLineNum = 193;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS RUT";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)");
 //BA.debugLineNum = 194;BA.debugLine="skmt.ExecNonQuery(\"CREATE VIEW IF NOT EXISTS CATA";
parent._skmt.ExecNonQuery("CREATE VIEW IF NOT EXISTS CATALOGO AS Select CAT_GP_CLASIF, CAT_GP_ID FROM CAT_GUNAPROD UNION Select CAT_GP_CLASIF, CAT_GP_ID FROM CAT_GUNAPROD GROUP BY CAT_GP_CLASIF, CAT_GP_ID");
 //BA.debugLineNum = 195;BA.debugLine="skmt.ExecNonQuery(\"CREATE VIEW IF NOT EXISTS tota";
parent._skmt.ExecNonQuery("CREATE VIEW IF NOT EXISTS total_marcas AS 	Select  cat_gp_clasif, sum(pe_costo_tot) As total from CATALOGO, pedido where pe_proid = cat_gp_id 	And pe_cliente <> 0 	group by cat_gp_clasif");
 //BA.debugLineNum = 196;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_MARCAS_CUOTAS ( HMC_MARCA TEXT, HMC_TOTAL TEXT)");
 //BA.debugLineNum = 197;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_CODIGO_BARRAS(CODIGOKMTS TEXT, CODIGOB TEXT, LAT TEXT, LON TEXT)");
 //BA.debugLineNum = 198;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS ABO";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS ABONOS (a_usuario TEXT, a_ruta TEXT, a_cliente TEXT, a_abono TEXT, a_fecha TEXT, a_enviado TEXT)");
 //BA.debugLineNum = 199;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS COO";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS COORDENADAS_GPS (tienda_id TEXT, ruta TEXT, almacen TEXT, latitud TEXT, longitud TEXT, fecha TEXT)");
 //BA.debugLineNum = 200;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIS";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS HIST_CUESTIONARIO (HC_CLIENTE TEXT)");
 //BA.debugLineNum = 201;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS PAG";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS PAGARES (PA_ALMACEN TEXT, PA_RUTA TEXT, PA_FECHA TEXT, PA_CAPTURA TEXT, PA_MONTO TEXT, PA_USUARIO TEXT, PA_CLIENTE TEXT)");
 //BA.debugLineNum = 202;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS NOV";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS NOVENTA (NV_CLIENTE TEXT, NV_FECHA TEXT, NV_USER TEXT, NV_MOTIVO TEXT, NV_COMM TEXT, NV_LAT TEXT, NV_LON TEXT)");
 //BA.debugLineNum = 203;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS PIC";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS PICK_CIEGO (PC_ID_PROD TEXT, PC_NOM_PROD TEXT, PC_CANT TEXT, PC_ALMACEN TEXT, PC_RUTA TEXT, PC_FECHA TEXT)");
 //BA.debugLineNum = 204;BA.debugLine="skmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS ENV";
parent._skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS ENV_MONTO_LIQ (EML_MONTO TEXT, EML_ALMACEN TEXT, EML_RUTA TEXT, EML_USUARIO TEXT, EML_FECHA_PED TEXT)");
 //BA.debugLineNum = 205;BA.debugLine="Subs.agregaColumna(\"PEDIDO\", \"PE_ENVIO_OK\", \"INT\"";
parent._subs._agregacolumna /*String*/ (ba,"PEDIDO","PE_ENVIO_OK","INT");
 //BA.debugLineNum = 206;BA.debugLine="Subs.agregaColumna(\"PEDIDO\", \"PE_IMPRESO\", \"INT\")";
parent._subs._agregacolumna /*String*/ (ba,"PEDIDO","PE_IMPRESO","INT");
 //BA.debugLineNum = 207;BA.debugLine="Subs.agregaColumna(\"PEDIDO_CLIENTE\", \"PC_IMPRESO\"";
parent._subs._agregacolumna /*String*/ (ba,"PEDIDO_CLIENTE","PC_IMPRESO","INT");
 //BA.debugLineNum = 208;BA.debugLine="Subs.agregaColumna(\"PEDIDO\", \"PE_CANTC\", \"TEXT\")";
parent._subs._agregacolumna /*String*/ (ba,"PEDIDO","PE_CANTC","TEXT");
 //BA.debugLineNum = 209;BA.debugLine="Subs.agregaColumna(\"PEDIDO\", \"PE_BCAJAS\", \"TEXT\")";
parent._subs._agregacolumna /*String*/ (ba,"PEDIDO","PE_BCAJAS","TEXT");
 //BA.debugLineNum = 210;BA.debugLine="Subs.agregaColumna(\"NOVENTA\", \"NV_ENVIO_OK\", \"INT";
parent._subs._agregacolumna /*String*/ (ba,"NOVENTA","NV_ENVIO_OK","INT");
 //BA.debugLineNum = 211;BA.debugLine="Subs.agregaColumna(\"kmt_info\", \"CAT_CL_BCREDITO\",";
parent._subs._agregacolumna /*String*/ (ba,"kmt_info","CAT_CL_BCREDITO","TEXT");
 //BA.debugLineNum = 212;BA.debugLine="Subs.agregaColumna(\"kmt_info\", \"CAT_CL_LIMITECRED";
parent._subs._agregacolumna /*String*/ (ba,"kmt_info","CAT_CL_LIMITECREDITO","TEXT");
 //BA.debugLineNum = 213;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD\", \"CAT_DP_CONVER";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD","CAT_DP_CONVERSION1","TEXT");
 //BA.debugLineNum = 214;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD2\", \"CAT_DP_CONVE";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD2","CAT_DP_CONVERSION1","TEXT");
 //BA.debugLineNum = 215;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD2\", \"CAT_DP_PRECI";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD2","CAT_DP_PRECIO4","TEXT");
 //BA.debugLineNum = 216;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD\", \"CAT_DP_PRECIO";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD","CAT_DP_PRECIO4","TEXT");
 //BA.debugLineNum = 217;BA.debugLine="Subs.agregaColumna(\"CLIENTES_NUEVOS\", \"CN_SOLICIT";
parent._subs._agregacolumna /*String*/ (ba,"CLIENTES_NUEVOS","CN_SOLICITA","TEXT");
 //BA.debugLineNum = 219;BA.debugLine="Subs.agregaColumna(\"CLIENTES_NUEVOS\", \"CN_COLONIA";
parent._subs._agregacolumna /*String*/ (ba,"CLIENTES_NUEVOS","CN_COLONIA","TEXT");
 //BA.debugLineNum = 220;BA.debugLine="Subs.agregaColumna(\"CLIENTES_NUEVOS\", \"CN_TELEFON";
parent._subs._agregacolumna /*String*/ (ba,"CLIENTES_NUEVOS","CN_TELEFONO","TEXT");
 //BA.debugLineNum = 221;BA.debugLine="Subs.agregaColumna(\"CLIENTES_NUEVOS\", \"CN_REFEREN";
parent._subs._agregacolumna /*String*/ (ba,"CLIENTES_NUEVOS","CN_REFERENCIA","TEXT");
 //BA.debugLineNum = 222;BA.debugLine="Subs.agregaColumna(\"CLIENTES_NUEVOS\", \"CN_HR_INIC";
parent._subs._agregacolumna /*String*/ (ba,"CLIENTES_NUEVOS","CN_HR_INICIO","TEXT");
 //BA.debugLineNum = 223;BA.debugLine="Subs.agregaColumna(\"CLIENTES_NUEVOS\", \"CN_HR_FIN\"";
parent._subs._agregacolumna /*String*/ (ba,"CLIENTES_NUEVOS","CN_HR_FIN","TEXT");
 //BA.debugLineNum = 224;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD\", \"CAT_DP_CANT_M";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD","CAT_DP_CANT_MIN_VENTA","TEXT");
 //BA.debugLineNum = 225;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD\", \"CAT_DP_ENTREG";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD","CAT_DP_ENTREGA","TEXT");
 //BA.debugLineNum = 226;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD2\", \"CAT_DP_CANT_";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD2","CAT_DP_CANT_MIN_VENTA","TEXT");
 //BA.debugLineNum = 227;BA.debugLine="Subs.agregaColumna(\"CAT_GUNAPROD2\", \"CAT_DP_ENTRE";
parent._subs._agregacolumna /*String*/ (ba,"CAT_GUNAPROD2","CAT_DP_ENTREGA","TEXT");
 //BA.debugLineNum = 228;BA.debugLine="c=skmt.ExecQuery(\"select  COUNT(*) AS CUANTOS fro";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select  COUNT(*) AS CUANTOS from HIST_STAY_OUT ")));
 //BA.debugLineNum = 229;BA.debugLine="C.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 230;BA.debugLine="If c.GetString(\"CUANTOS\")  = 0 Then";
if (true) break;

case 5:
//if
this.state = 8;
if ((parent._c.GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
this.state = 7;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 231;BA.debugLine="skmt.ExecNonQuery(\"INSERT INTO HIST_STAY_OUT(HSO";
parent._skmt.ExecNonQuery("INSERT INTO HIST_STAY_OUT(HSO_INI, HSO_FIN) VALUES (0,0)");
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 233;BA.debugLine="C.Close";
parent._c.Close();
 //BA.debugLineNum = 237;BA.debugLine="l_version.Text = Application.VersionName";
parent._l_version.setText(BA.ObjectToCharSequence(parent.__c.Application.getVersionName()));
 //BA.debugLineNum = 245;BA.debugLine="montoActual  = 0";
parent._montoactual = BA.NumberToString(0);
 //BA.debugLineNum = 246;BA.debugLine="clientesTotal = 0";
parent._clientestotal = BA.NumberToString(0);
 //BA.debugLineNum = 247;BA.debugLine="clientesVenta =  0";
parent._clientesventa = BA.NumberToString(0);
 //BA.debugLineNum = 248;BA.debugLine="clientesVisitados = 0";
parent._clientesvisitados = BA.NumberToString(0);
 //BA.debugLineNum = 249;BA.debugLine="almacen = 0";
parent._almacen = BA.NumberToString(0);
 //BA.debugLineNum = 250;BA.debugLine="rutaPreventa =  0";
parent._rutapreventa = BA.NumberToString(0);
 //BA.debugLineNum = 251;BA.debugLine="p_appUpdate.Visible = False";
parent._p_appupdate.setVisible(parent.__c.False);
 //BA.debugLineNum = 253;BA.debugLine="LogColor(\"Revisa permisos Phone_State\", Colors.Gr";
parent.__c.LogImpl("75111931","Revisa permisos Phone_State",parent.__c.Colors.Green);
 //BA.debugLineNum = 254;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(ba,parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_FINE_LOCATION);
 //BA.debugLineNum = 255;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 35;
return;
case 35:
//C
this.state = 9;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 //BA.debugLineNum = 256;BA.debugLine="If Result Then";
if (true) break;

case 9:
//if
this.state = 14;
if (_result) { 
this.state = 11;
}else {
this.state = 13;
}if (true) break;

case 11:
//C
this.state = 14;
 //BA.debugLineNum = 257;BA.debugLine="Log(\"Con permisos de ubicacion\")";
parent.__c.LogImpl("75111935","Con permisos de ubicacion",0);
 if (true) break;

case 13:
//C
this.state = 14;
 //BA.debugLineNum = 259;BA.debugLine="Log(\"SIN permisos de ubicacion\")";
parent.__c.LogImpl("75111937","SIN permisos de ubicacion",0);
 if (true) break;

case 14:
//C
this.state = 15;
;
 //BA.debugLineNum = 261;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(ba,parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_ACCESS_COARSE_LOCATION);
 //BA.debugLineNum = 262;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 36;
return;
case 36:
//C
this.state = 15;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 //BA.debugLineNum = 263;BA.debugLine="If Result Then";
if (true) break;

case 15:
//if
this.state = 20;
if (_result) { 
this.state = 17;
}else {
this.state = 19;
}if (true) break;

case 17:
//C
this.state = 20;
 //BA.debugLineNum = 264;BA.debugLine="Log(\"Con permisos de ubicacion\")";
parent.__c.LogImpl("75111942","Con permisos de ubicacion",0);
 if (true) break;

case 19:
//C
this.state = 20;
 //BA.debugLineNum = 266;BA.debugLine="Log(\"SIN permisos de ubicacion\")";
parent.__c.LogImpl("75111944","SIN permisos de ubicacion",0);
 if (true) break;

case 20:
//C
this.state = 21;
;
 //BA.debugLineNum = 268;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(ba,parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_READ_PHONE_STATE);
 //BA.debugLineNum = 269;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 37;
return;
case 37:
//C
this.state = 21;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 //BA.debugLineNum = 270;BA.debugLine="If Result Then";
if (true) break;

case 21:
//if
this.state = 24;
if (_result) { 
this.state = 23;
}if (true) break;

case 23:
//C
this.state = 24;
 if (true) break;

case 24:
//C
this.state = 25;
;
 //BA.debugLineNum = 284;BA.debugLine="MES1.Initialize(Me, \"MES1\")";
parent._mes1._initialize /*String*/ (ba,parent,"MES1");
 //BA.debugLineNum = 286;BA.debugLine="Dim SdkVersion As Int = device.SdkVersion";
_sdkversion = parent._device.getSdkVersion();
 //BA.debugLineNum = 288;BA.debugLine="If SdkVersion < 30 Then";
if (true) break;

case 25:
//if
this.state = 34;
if (_sdkversion<30) { 
this.state = 27;
}else {
this.state = 29;
}if (true) break;

case 27:
//C
this.state = 34;
 //BA.debugLineNum = 290;BA.debugLine="Dim rp As RuntimePermissions";
_rp = new anywheresoftware.b4a.objects.RuntimePermissions();
 //BA.debugLineNum = 291;BA.debugLine="rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_";
_rp.CheckAndRequest(ba,_rp.PERMISSION_WRITE_EXTERNAL_STORAGE);
 //BA.debugLineNum = 292;BA.debugLine="Wait For Activity_PermissionResult (Permission A";
parent.__c.WaitFor("activity_permissionresult", ba, this, null);
this.state = 38;
return;
case 38:
//C
this.state = 34;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 if (true) break;

case 29:
//C
this.state = 30;
 //BA.debugLineNum = 297;BA.debugLine="If Not(MES1.HasPermission) Then";
if (true) break;

case 30:
//if
this.state = 33;
if (parent.__c.Not(parent._mes1._haspermission /*boolean*/ ())) { 
this.state = 32;
}if (true) break;

case 32:
//C
this.state = 33;
 //BA.debugLineNum = 298;BA.debugLine="MsgboxAsync(\"This app requires access to all fi";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence("This app requires access to all files, please enable the option"),BA.ObjectToCharSequence("Manage All Files"),ba);
 //BA.debugLineNum = 299;BA.debugLine="Wait For Msgbox_Result(Res As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 39;
return;
case 39:
//C
this.state = 33;
_res = (Integer) result[0];
;
 //BA.debugLineNum = 301;BA.debugLine="MES1.GetPermission";
parent._mes1._getpermission /*String*/ ();
 //BA.debugLineNum = 302;BA.debugLine="Wait For MES_StorageAvailable";
parent.__c.WaitFor("mes_storageavailable", ba, this, null);
this.state = 40;
return;
case 40:
//C
this.state = 33;
;
 if (true) break;

case 33:
//C
this.state = 34;
;
 if (true) break;

case 34:
//C
this.state = -1;
;
 //BA.debugLineNum = 305;BA.debugLine="P_CIEGO.Height = Root.Height";
parent._p_ciego.setHeight(parent._root.getHeight());
 //BA.debugLineNum = 306;BA.debugLine="P_CIEGO.Width = Root.Width";
parent._p_ciego.setWidth(parent._root.getWidth());
 //BA.debugLineNum = 307;BA.debugLine="p_validacion.Height = Root.Height";
parent._p_validacion.setHeight(parent._root.getHeight());
 //BA.debugLineNum = 308;BA.debugLine="p_validacion.Width = Root.Width";
parent._p_validacion.setWidth(parent._root.getWidth());
 //BA.debugLineNum = 309;BA.debugLine="p_add_monto.Height = Root.Height";
parent._p_add_monto.setHeight(parent._root.getHeight());
 //BA.debugLineNum = 310;BA.debugLine="p_add_monto.Width = Root.Width";
parent._p_add_monto.setWidth(parent._root.getWidth());
 //BA.debugLineNum = 311;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _b4xpage_permissionresult(String _permission,boolean _result) throws Exception{
}
public void  _activity_permissionresult(String _permission,boolean _result) throws Exception{
}
public void  _mes_storageavailable() throws Exception{
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 19;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 20;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 21;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 22;BA.debugLine="Private Root As B4XView";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Private xui As XUI";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 24;BA.debugLine="Dim s As C_Subs";
_s = new medicomed.keymon.com.mx.c_subs();
 //BA.debugLineNum = 25;BA.debugLine="Public login As B4XMainPage";
_login = new medicomed.keymon.com.mx.b4xmainpage();
 //BA.debugLineNum = 26;BA.debugLine="Public principal As C_Principal";
_principal = new medicomed.keymon.com.mx.c_principal();
 //BA.debugLineNum = 27;BA.debugLine="Public clientes As C_Clientes";
_clientes = new medicomed.keymon.com.mx.c_clientes();
 //BA.debugLineNum = 28;BA.debugLine="Public cliente As C_Cliente";
_cliente = new medicomed.keymon.com.mx.c_cliente();
 //BA.debugLineNum = 29;BA.debugLine="Public productos As C_Productos";
_productos = new medicomed.keymon.com.mx.c_productos();
 //BA.debugLineNum = 30;BA.debugLine="Public updateAvailable As C_UpdateAvailable";
_updateavailable = new medicomed.keymon.com.mx.c_updateavailable();
 //BA.debugLineNum = 31;BA.debugLine="Public mapas As C_Mapas";
_mapas = new medicomed.keymon.com.mx.c_mapas();
 //BA.debugLineNum = 32;BA.debugLine="Public nuevoCliente As C_NuevoCliente";
_nuevocliente = new medicomed.keymon.com.mx.c_nuevocliente();
 //BA.debugLineNum = 33;BA.debugLine="Public ticketsDia As C_TicketsDia";
_ticketsdia = new medicomed.keymon.com.mx.c_ticketsdia();
 //BA.debugLineNum = 34;BA.debugLine="Public noVenta As C_NoVenta";
_noventa = new medicomed.keymon.com.mx.c_noventa();
 //BA.debugLineNum = 35;BA.debugLine="Public nota As C_Nota";
_nota = new medicomed.keymon.com.mx.c_nota();
 //BA.debugLineNum = 36;BA.debugLine="Public pedidos As C_Pedidos";
_pedidos = new medicomed.keymon.com.mx.c_pedidos();
 //BA.debugLineNum = 37;BA.debugLine="Public promos As C_Promos";
_promos = new medicomed.keymon.com.mx.c_promos();
 //BA.debugLineNum = 38;BA.debugLine="Public historico As C_Historico";
_historico = new medicomed.keymon.com.mx.c_historico();
 //BA.debugLineNum = 39;BA.debugLine="Public Provider As FileProvider";
_provider = new medicomed.keymon.com.mx.fileprovider();
 //BA.debugLineNum = 51;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new medicomed.keymon.com.mx.dbrequestmanager();
 //BA.debugLineNum = 52;BA.debugLine="Dim v As String = Application.VersionName";
_v = __c.Application.getVersionName();
 //BA.debugLineNum = 53;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 54;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
 //BA.debugLineNum = 55;BA.debugLine="Dim lat_gps, lon_gps As String";
_lat_gps = "";
_lon_gps = "";
 //BA.debugLineNum = 56;BA.debugLine="Dim usuario As String";
_usuario = "";
 //BA.debugLineNum = 57;BA.debugLine="Dim batt As Int";
_batt = 0;
 //BA.debugLineNum = 58;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 59;BA.debugLine="Dim montoActual, clientesTotal, clientesVenta, cl";
_montoactual = "";
_clientestotal = "";
_clientesventa = "";
_clientesvisitados = "";
_almacen = "";
_rutapreventa = "";
 //BA.debugLineNum = 60;BA.debugLine="Dim DBReqServer, fechaRuta As String";
_dbreqserver = "";
_fecharuta = "";
 //BA.debugLineNum = 61;BA.debugLine="Dim Logger As Boolean";
_logger = false;
 //BA.debugLineNum = 62;BA.debugLine="Dim mac_impresora As String";
_mac_impresora = "";
 //BA.debugLineNum = 63;BA.debugLine="Dim Phn As PhoneId";
_phn = new anywheresoftware.b4a.phone.Phone.PhoneId();
 //BA.debugLineNum = 65;BA.debugLine="Dim user As EditText";
_user = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 66;BA.debugLine="Dim pass As EditText";
_pass = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 67;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 68;BA.debugLine="Dim existe As String";
_existe = "";
 //BA.debugLineNum = 69;BA.debugLine="Dim paso1 As String";
_paso1 = "";
 //BA.debugLineNum = 70;BA.debugLine="Private IMEN As Label";
_imen = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 71;BA.debugLine="Dim IMEI As String = \"\"";
_imei = "";
 //BA.debugLineNum = 72;BA.debugLine="Dim alterno As String";
_alterno = "";
 //BA.debugLineNum = 73;BA.debugLine="Private b_menu As Button";
_b_menu = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 74;BA.debugLine="Dim PopupMenu As RSPopupMenu";
_popupmenu = new com.rootsoft.rspopupmenu.RSPopupMenu();
 //BA.debugLineNum = 75;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 76;BA.debugLine="Private PDF As Button";
_pdf = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 77;BA.debugLine="Private bpv1 As BatteryProgressView";
_bpv1 = new batteryprogressviewwrapper.batteryprogressviewWrapper();
 //BA.debugLineNum = 78;BA.debugLine="Dim batterystatus(11) As Int";
_batterystatus = new int[(int) (11)];
;
 //BA.debugLineNum = 79;BA.debugLine="Private bu As BatteryUtilities";
_bu = new medicomed.keymon.com.mx.batteryutilities();
 //BA.debugLineNum = 80;BA.debugLine="Private b_apk As Button";
_b_apk = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 81;BA.debugLine="Private i_engrane As ImageView";
_i_engrane = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 82;BA.debugLine="Private p_Main As Panel";
_p_main = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 83;BA.debugLine="Private p_appUpdate As Panel";
_p_appupdate = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 84;BA.debugLine="Private b_regesar As Button";
_b_regesar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 85;BA.debugLine="Private l_version As Label";
_l_version = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 86;BA.debugLine="Private ImageView1 As ImageView";
_imageview1 = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 87;BA.debugLine="Private Label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 88;BA.debugLine="Private Entrar As Button";
_entrar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 89;BA.debugLine="Dim tipo_venta As String";
_tipo_venta = "";
 //BA.debugLineNum = 90;BA.debugLine="Dim bTerminarClicked As Boolean = False";
_bterminarclicked = __c.False;
 //BA.debugLineNum = 91;BA.debugLine="Private lv_server As ListView";
_lv_server = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 92;BA.debugLine="Private l_server As Label";
_l_server = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 93;BA.debugLine="Private b_enviarbd As Button";
_b_enviarbd = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 94;BA.debugLine="Private b_importarBD As Button";
_b_importarbd = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 95;BA.debugLine="Dim ime As IME";
_ime = new anywheresoftware.b4a.objects.IME();
 //BA.debugLineNum = 96;BA.debugLine="Dim MES1 As ManageExternalStorage";
_mes1 = new medicomed.keymon.com.mx.manageexternalstorage();
 //BA.debugLineNum = 97;BA.debugLine="Dim device As Phone";
_device = new anywheresoftware.b4a.phone.Phone();
 //BA.debugLineNum = 98;BA.debugLine="Private et_server As EditText";
_et_server = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 99;BA.debugLine="Private b_guardar As Button";
_b_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 100;BA.debugLine="Private Panel11 As Panel";
_panel11 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 101;BA.debugLine="Private CLV_PICK_CIEGO As CustomListView";
_clv_pick_ciego = new b4a.example3.customlistview();
 //BA.debugLineNum = 102;BA.debugLine="Private P_PICK_CIEGO As Panel";
_p_pick_ciego = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 103;BA.debugLine="Dim ET_PICK_CIEGO As EditText";
_et_pick_ciego = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 104;BA.debugLine="Private L_PICK_CIEGO As Label";
_l_pick_ciego = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 105;BA.debugLine="Private P_CIEGO As Panel";
_p_ciego = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 106;BA.debugLine="Dim Panel4 As Panel";
_panel4 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 107;BA.debugLine="Dim q_buscar As String";
_q_buscar = "";
 //BA.debugLineNum = 108;BA.debugLine="Private et_buspc As EditText";
_et_buspc = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 109;BA.debugLine="Dim d As Cursor";
_d = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 110;BA.debugLine="Dim a As Cursor";
_a = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 111;BA.debugLine="Dim f As Cursor";
_f = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 112;BA.debugLine="Dim idenviar As String";
_idenviar = "";
 //BA.debugLineNum = 113;BA.debugLine="Private et_codigo As EditText";
_et_codigo = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 114;BA.debugLine="Private b_cancelarcodigo As Button";
_b_cancelarcodigo = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 115;BA.debugLine="Private b_aceptar As Button";
_b_aceptar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 116;BA.debugLine="Private p_validacion As Panel";
_p_validacion = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 117;BA.debugLine="Private b_recarga As Button";
_b_recarga = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 118;BA.debugLine="Dim recarga As String = \"0\"";
_recarga = "0";
 //BA.debugLineNum = 119;BA.debugLine="Private p_add_monto As Panel";
_p_add_monto = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 120;BA.debugLine="Private B_Can_Monto As Button";
_b_can_monto = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 121;BA.debugLine="Private B_Aceptar_Monto As Button";
_b_aceptar_monto = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 122;BA.debugLine="Private ET_Add_Monto As EditText";
_et_add_monto = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 123;BA.debugLine="End Sub";
return "";
}
public void  _copiadb() throws Exception{
ResumableSub_copiaDB rsub = new ResumableSub_copiaDB(this);
rsub.resume(ba, null);
}
public static class ResumableSub_copiaDB extends BA.ResumableSub {
public ResumableSub_copiaDB(medicomed.keymon.com.mx.b4xmainpage parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.b4xmainpage parent;
String _permission = "";
boolean _result = false;
String _thedir = "";

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
try {

        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 841;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(ba,parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_WRITE_EXTERNAL_STORAGE);
 //BA.debugLineNum = 842;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 18;
return;
case 18:
//C
this.state = 1;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
 //BA.debugLineNum = 843;BA.debugLine="Dim theDir As String = \"\"";
_thedir = "";
 //BA.debugLineNum = 844;BA.debugLine="If Result Then";
if (true) break;

case 1:
//if
this.state = 17;
if (_result) { 
this.state = 3;
}else {
this.state = 16;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 851;BA.debugLine="Dim theDir As String";
_thedir = "";
 //BA.debugLineNum = 852;BA.debugLine="Try";
if (true) break;

case 4:
//try
this.state = 9;
this.catchState = 8;
this.state = 6;
if (true) break;

case 6:
//C
this.state = 9;
this.catchState = 8;
 //BA.debugLineNum = 853;BA.debugLine="File.MakeDir(File.DirInternal,\"kmts\")";
parent.__c.File.MakeDir(parent.__c.File.getDirInternal(),"kmts");
 //BA.debugLineNum = 854;BA.debugLine="theDir = \"/kmts\"";
_thedir = "/kmts";
 if (true) break;

case 8:
//C
this.state = 9;
this.catchState = 0;
 //BA.debugLineNum = 856;BA.debugLine="theDir = \"\"";
_thedir = "";
 if (true) break;
if (true) break;
;
 //BA.debugLineNum = 858;BA.debugLine="Try";

case 9:
//try
this.state = 14;
this.catchState = 0;
this.catchState = 13;
this.state = 11;
if (true) break;

case 11:
//C
this.state = 14;
this.catchState = 13;
 //BA.debugLineNum = 859;BA.debugLine="File.Copy(File.DirInternal,\"kmt.db\",File.DirInt";
parent.__c.File.Copy(parent.__c.File.getDirInternal(),"kmt.db",parent.__c.File.getDirInternal()+_thedir,"medicomed_kmt.db");
 //BA.debugLineNum = 860;BA.debugLine="ToastMessageShow(\"Listo, copiado a \" & File.Dir";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Listo, copiado a "+parent.__c.File.getDirInternal()+_thedir+"/medicomed_kmt.db"),parent.__c.False);
 if (true) break;

case 13:
//C
this.state = 14;
this.catchState = 0;
 //BA.debugLineNum = 862;BA.debugLine="ToastMessageShow(\"No se pudo hacer la copia: \"&";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("No se pudo hacer la copia: "+BA.ObjectToString(parent.__c.LastException(ba))),parent.__c.True);
 if (true) break;
if (true) break;

case 14:
//C
this.state = 17;
this.catchState = 0;
;
 if (true) break;

case 16:
//C
this.state = 17;
 //BA.debugLineNum = 865;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Sin permisos"),parent.__c.False);
 if (true) break;

case 17:
//C
this.state = -1;
;
 //BA.debugLineNum = 867;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
ba.setLastException(e0);}
            }
        }
    }
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(String _id_prod,String _prod,String _cant) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _pa = null;
 //BA.debugLineNum = 987;BA.debugLine="Sub CreateListItem(Id_prod As String, Prod As Stri";
 //BA.debugLineNum = 988;BA.debugLine="Dim pa As B4XView = xui.CreatePanel(\"\")";
_pa = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pa = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 989;BA.debugLine="pa.SetLayoutAnimated(0, 0, 0, 1, 10)";
_pa.SetLayoutAnimated((int) (0),(int) (0),(int) (0),(int) (1),(int) (10));
 //BA.debugLineNum = 990;BA.debugLine="pa.LoadLayout(\"PANEL_PICK_CIEGO\")";
_pa.LoadLayout("PANEL_PICK_CIEGO",ba);
 //BA.debugLineNum = 991;BA.debugLine="pa.Height = 55dip";
_pa.setHeight(__c.DipToCurrent((int) (55)));
 //BA.debugLineNum = 992;BA.debugLine="pa.Width = 298dip";
_pa.setWidth(__c.DipToCurrent((int) (298)));
 //BA.debugLineNum = 994;BA.debugLine="L_PICK_CIEGO.Text = Id_prod &  CRLF & Prod";
_l_pick_ciego.setText(BA.ObjectToCharSequence(_id_prod+__c.CRLF+_prod));
 //BA.debugLineNum = 995;BA.debugLine="L_PICK_CIEGO.TextSize = 12";
_l_pick_ciego.setTextSize((float) (12));
 //BA.debugLineNum = 996;BA.debugLine="L_PICK_CIEGO.Gravity = Bit.Or(Gravity.CENTER_VERT";
_l_pick_ciego.setGravity(__c.Bit.Or(__c.Gravity.CENTER_VERTICAL,__c.Gravity.CENTER_HORIZONTAL));
 //BA.debugLineNum = 997;BA.debugLine="ET_PICK_CIEGO.Text = cant";
_et_pick_ciego.setText(BA.ObjectToCharSequence(_cant));
 //BA.debugLineNum = 1000;BA.debugLine="Return pa";
if (true) return (anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(_pa.getObject()));
 //BA.debugLineNum = 1001;BA.debugLine="End Sub";
return null;
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem2(String _id_prod,String _prod) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _pa = null;
 //BA.debugLineNum = 1003;BA.debugLine="Sub CreateListItem2(Id_prod As String, Prod As Str";
 //BA.debugLineNum = 1004;BA.debugLine="Dim pa As B4XView = xui.CreatePanel(\"\")";
_pa = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pa = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 1005;BA.debugLine="pa.SetLayoutAnimated(0, 0, 0, 1, 10)";
_pa.SetLayoutAnimated((int) (0),(int) (0),(int) (0),(int) (1),(int) (10));
 //BA.debugLineNum = 1006;BA.debugLine="pa.LoadLayout(\"PANEL_PICK_CIEGO\")";
_pa.LoadLayout("PANEL_PICK_CIEGO",ba);
 //BA.debugLineNum = 1007;BA.debugLine="pa.Height = 55dip";
_pa.setHeight(__c.DipToCurrent((int) (55)));
 //BA.debugLineNum = 1008;BA.debugLine="pa.Width = 298dip";
_pa.setWidth(__c.DipToCurrent((int) (298)));
 //BA.debugLineNum = 1010;BA.debugLine="L_PICK_CIEGO.Text = Id_prod &  CRLF & Prod";
_l_pick_ciego.setText(BA.ObjectToCharSequence(_id_prod+__c.CRLF+_prod));
 //BA.debugLineNum = 1011;BA.debugLine="L_PICK_CIEGO.TextSize = 12";
_l_pick_ciego.setTextSize((float) (12));
 //BA.debugLineNum = 1012;BA.debugLine="L_PICK_CIEGO.Gravity = Bit.Or(Gravity.CENTER_VERT";
_l_pick_ciego.setGravity(__c.Bit.Or(__c.Gravity.CENTER_VERTICAL,__c.Gravity.CENTER_HORIZONTAL));
 //BA.debugLineNum = 1015;BA.debugLine="Return pa";
if (true) return (anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(_pa.getObject()));
 //BA.debugLineNum = 1016;BA.debugLine="End Sub";
return null;
}
public String  _dameusuario() throws Exception{
 //BA.debugLineNum = 810;BA.debugLine="Sub dameUsuario";
 //BA.debugLineNum = 811;BA.debugLine="c=skmt.ExecQuery2(\"select count(*) as EXISTE1 fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select count(*) as EXISTE1 from usuarioa where usuario = ?",new String[]{_user.getText()})));
 //BA.debugLineNum = 812;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 813;BA.debugLine="existe = c.GetString(\"EXISTE1\")";
_existe = _c.GetString("EXISTE1");
 //BA.debugLineNum = 814;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 815;BA.debugLine="If existe > 0 Then";
if ((double)(Double.parseDouble(_existe))>0) { 
 //BA.debugLineNum = 816;BA.debugLine="c=skmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 817;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 818;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 }else {
 //BA.debugLineNum = 820;BA.debugLine="usuario = \"SINUSUARIO\"";
_usuario = "SINUSUARIO";
 };
 //BA.debugLineNum = 822;BA.debugLine="End Sub";
return "";
}
public String  _entrar_click() throws Exception{
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
int _api = 0;
anywheresoftware.b4a.phone.Phone _pp = null;
int _id = 0;
 //BA.debugLineNum = 384;BA.debugLine="Sub Entrar_Click";
 //BA.debugLineNum = 385;BA.debugLine="Log(\"|\" & Starter.DBReqServer)";
__c.LogImpl("75242881","|"+_starter._dbreqserver /*String*/ ,0);
 //BA.debugLineNum = 386;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
 //BA.debugLineNum = 387;BA.debugLine="Dim Api As Int";
_api = 0;
 //BA.debugLineNum = 388;BA.debugLine="Dim PP As Phone";
_pp = new anywheresoftware.b4a.phone.Phone();
 //BA.debugLineNum = 389;BA.debugLine="Api = r.GetStaticField(\"android.os.Build$VERSION\"";
_api = (int)(BA.ObjectToNumber(_r.GetStaticField("android.os.Build$VERSION","SDK_INT")));
 //BA.debugLineNum = 390;BA.debugLine="If Api < 9 Then";
if (_api<9) { 
 //BA.debugLineNum = 392;BA.debugLine="If File.Exists(File.DirInternal, \"__id\") Then";
if (__c.File.Exists(__c.File.getDirInternal(),"__id")) { 
 //BA.debugLineNum = 393;BA.debugLine="IMEI =  File.ReadString(File.DirInternal, \"__id";
_imei = __c.File.ReadString(__c.File.getDirInternal(),"__id");
 //BA.debugLineNum = 394;BA.debugLine="Log(1&\"-\"&IMEI)";
__c.LogImpl("75242890",BA.NumberToString(1)+"-"+_imei,0);
 }else {
 //BA.debugLineNum = 396;BA.debugLine="Dim id As Int";
_id = 0;
 //BA.debugLineNum = 397;BA.debugLine="id = Rnd(0x10000000, 0x7FFFFFFF)";
_id = __c.Rnd(((int)0x10000000),((int)0x7fffffff));
 //BA.debugLineNum = 398;BA.debugLine="File.WriteString(File.DirInternal, \"__id\", id)";
__c.File.WriteString(__c.File.getDirInternal(),"__id",BA.NumberToString(_id));
 //BA.debugLineNum = 399;BA.debugLine="IMEI =  id";
_imei = BA.NumberToString(_id);
 //BA.debugLineNum = 400;BA.debugLine="Log(2&\"-\"&IMEI)";
__c.LogImpl("75242896",BA.NumberToString(2)+"-"+_imei,0);
 };
 }else {
 //BA.debugLineNum = 404;BA.debugLine="IMEI =  r.GetStaticField(\"android.os.Build\", \"SE";
_imei = BA.ObjectToString(_r.GetStaticField("android.os.Build","SERIAL"));
 };
 //BA.debugLineNum = 407;BA.debugLine="If IMEI.ToLowerCase = \"unknown\" Then";
if ((_imei.toLowerCase()).equals("unknown")) { 
 //BA.debugLineNum = 408;BA.debugLine="IMEI = PP.GetSettings(\"android_id\")";
_imei = _pp.GetSettings("android_id");
 };
 //BA.debugLineNum = 412;BA.debugLine="If user.Text = \"ALTERNO\" Then";
if ((_user.getText()).equals("ALTERNO")) { 
 //BA.debugLineNum = 413;BA.debugLine="c=skmt.ExecQuery2(\"select CAT_CO_CONFIGURACION,";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?",new String[]{"SERVER"})));
 //BA.debugLineNum = 414;BA.debugLine="c.Position =0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 415;BA.debugLine="DBReqServer = c.GetString(\"CAT_CO_CONFIGURACION\"";
_dbreqserver = _c.GetString("CAT_CO_CONFIGURACION");
 //BA.debugLineNum = 416;BA.debugLine="alterno = c.GetString(\"CAT_CO_RESULTADO\")";
_alterno = _c.GetString("CAT_CO_RESULTADO");
 //BA.debugLineNum = 417;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 418;BA.debugLine="If alterno = 1 Then";
if ((_alterno).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 419;BA.debugLine="skmt.ExecNonQuery2(\"UPDATE CAT_CODIGOS SET CAT_";
_skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 1 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 2",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"SERVER"}));
 //BA.debugLineNum = 420;BA.debugLine="skmt.ExecNonQuery2(\"UPDATE CAT_CODIGOS SET CAT_";
_skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 0 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 1",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"SERVER"}));
 }else if((_alterno).equals(BA.NumberToString(2))) { 
 //BA.debugLineNum = 422;BA.debugLine="skmt.ExecNonQuery2(\"UPDATE CAT_CODIGOS SET CAT_";
_skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 1 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 1",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"SERVER"}));
 //BA.debugLineNum = 423;BA.debugLine="skmt.ExecNonQuery2(\"UPDATE CAT_CODIGOS SET CAT_";
_skmt.ExecNonQuery2("UPDATE CAT_CODIGOS SET CAT_CO_PONDERACION = 0 WHERE CAT_CO_ACCION = ? AND CAT_CO_RESULTADO = 2",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"SERVER"}));
 };
 //BA.debugLineNum = 425;BA.debugLine="c=skmt.ExecQuery2(\"select CAT_CO_CONFIGURACION,";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select CAT_CO_CONFIGURACION, CAT_CO_RESULTADO from CAT_CODIGOS where CAT_CO_PONDERACION =1 AND CAT_CO_ACCION = ?",new String[]{"SERVER"})));
 //BA.debugLineNum = 426;BA.debugLine="c.Position =0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 427;BA.debugLine="DBReqServer = c.GetString(\"CAT_CO_CONFIGURACION\"";
_dbreqserver = _c.GetString("CAT_CO_CONFIGURACION");
 //BA.debugLineNum = 428;BA.debugLine="user.Text = DBReqServer";
_user.setText(BA.ObjectToCharSequence(_dbreqserver));
 //BA.debugLineNum = 429;BA.debugLine="c.Close";
_c.Close();
 }else if((_user.getText()).equals("KMTS1")) { 
 //BA.debugLineNum = 432;BA.debugLine="skmt.ExecNonQuery(\"delete from usuarioa\")";
_skmt.ExecNonQuery("delete from usuarioa");
 //BA.debugLineNum = 433;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO USUARIOA VALUES";
_skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_user.getText()),(Object)(_pass.getText())}));
 //BA.debugLineNum = 434;BA.debugLine="skmt.ExecNonQuery(\"delete from cat_almacen\")";
_skmt.ExecNonQuery("delete from cat_almacen");
 //BA.debugLineNum = 435;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_ALMACEN(ID_A";
_skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_pass.getText())}));
 //BA.debugLineNum = 436;BA.debugLine="skmt.ExecNonQuery(\"delete from VERSION\")";
_skmt.ExecNonQuery("delete from VERSION");
 //BA.debugLineNum = 437;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO VERSION(NOVERSIO";
_skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("2.1")}));
 //BA.debugLineNum = 438;BA.debugLine="B4XPages.ShowPage(\"Clientes\")";
_b4xpages._showpage /*String*/ (ba,"Clientes");
 }else if((_user.getText()).equals("BERNA1")) { 
 //BA.debugLineNum = 440;BA.debugLine="skmt.ExecNonQuery(\"delete from usuarioa\")";
_skmt.ExecNonQuery("delete from usuarioa");
 //BA.debugLineNum = 441;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO USUARIOA VALUES";
_skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_user.getText()),(Object)("1")}));
 //BA.debugLineNum = 442;BA.debugLine="skmt.ExecNonQuery(\"delete from cat_almacen\")";
_skmt.ExecNonQuery("delete from cat_almacen");
 //BA.debugLineNum = 443;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_ALMACEN(ID_A";
_skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("1")}));
 //BA.debugLineNum = 444;BA.debugLine="skmt.ExecNonQuery(\"delete from VERSION\")";
_skmt.ExecNonQuery("delete from VERSION");
 //BA.debugLineNum = 445;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO VERSION(NOVERSIO";
_skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("2.1")}));
 //BA.debugLineNum = 446;BA.debugLine="B4XPages.ShowPage(\"Clientes\")";
_b4xpages._showpage /*String*/ (ba,"Clientes");
 }else if((_user.getText()).equals("IMEI")) { 
 //BA.debugLineNum = 448;BA.debugLine="user.Text = IMEI";
_user.setText(BA.ObjectToCharSequence(_imei));
 };
 //BA.debugLineNum = 451;BA.debugLine="c=skmt.ExecQuery2(\"select count(*) as EXISTE1 fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select count(*) as EXISTE1 from usuarioa where usuario = ?",new String[]{_user.getText()})));
 //BA.debugLineNum = 452;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 453;BA.debugLine="existe = c.GetString(\"EXISTE1\")";
_existe = _c.GetString("EXISTE1");
 //BA.debugLineNum = 454;BA.debugLine="If existe = 0 Then";
if ((_existe).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 455;BA.debugLine="If IMEI = \"\" Then";
if ((_imei).equals("")) { 
 //BA.debugLineNum = 456;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 457;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 458;BA.debugLine="cmd.Name = \"select_usuario_MEDI_10_V2\" 'Antes s";
_cmd.Name /*String*/  = "select_usuario_MEDI_10_V2";
 //BA.debugLineNum = 459;BA.debugLine="cmd.Parameters = Array As Object(user.Text.Trim";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_user.getText().trim()),(Object)(_pass.getText().trim())};
 //BA.debugLineNum = 460;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"usuario_10\")";
_reqmanager._executequery /*String*/ (_cmd,(int) (0),(Object)("usuario_10"));
 }else {
 //BA.debugLineNum = 462;BA.debugLine="If IMEI = \"\" Then";
if ((_imei).equals("")) { 
 //BA.debugLineNum = 463;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 464;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 465;BA.debugLine="cmd.Name = \"select_usuario_MEDI_10_V2\"";
_cmd.Name /*String*/  = "select_usuario_MEDI_10_V2";
 //BA.debugLineNum = 466;BA.debugLine="cmd.Parameters = Array As Object(user.Text.Tri";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_user.getText().trim()),(Object)(_pass.getText().trim())};
 //BA.debugLineNum = 467;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"usuario_10\")";
_reqmanager._executequery /*String*/ (_cmd,(int) (0),(Object)("usuario_10"));
 }else {
 //BA.debugLineNum = 469;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 470;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 471;BA.debugLine="cmd.Name = \"select_usuario_MEDI_10_V2\" 'Antes";
_cmd.Name /*String*/  = "select_usuario_MEDI_10_V2";
 //BA.debugLineNum = 472;BA.debugLine="cmd.Parameters = Array As Object(user.Text.Tri";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_user.getText().trim()),(Object)(_pass.getText().trim())};
 //BA.debugLineNum = 473;BA.debugLine="Log(\"Mandamos: \"&user.Text&\"|\"& pass.Text)";
__c.LogImpl("75242969","Mandamos: "+_user.getText()+"|"+_pass.getText(),0);
 //BA.debugLineNum = 474;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"usuario_10\")";
_reqmanager._executequery /*String*/ (_cmd,(int) (0),(Object)("usuario_10"));
 };
 };
 //BA.debugLineNum = 477;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 478;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 480;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"version\")";
_reqmanager._executequery /*String*/ (_cmd,(int) (0),(Object)("version"));
 }else {
 //BA.debugLineNum = 482;BA.debugLine="usuario = user.Text";
_usuario = _user.getText();
 //BA.debugLineNum = 483;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 };
 //BA.debugLineNum = 485;BA.debugLine="End Sub";
return "";
}
public String  _entrar_longclick() throws Exception{
 //BA.debugLineNum = 905;BA.debugLine="Sub Entrar_LongClick";
 //BA.debugLineNum = 907;BA.debugLine="End Sub";
return "";
}
public String  _et_buspc_textchanged(String _old,String _new) throws Exception{
int _i = 0;
 //BA.debugLineNum = 946;BA.debugLine="Private Sub et_buspc_TextChanged (Old As String, N";
 //BA.debugLineNum = 947;BA.debugLine="If New = \"\" Then";
if ((_new).equals("")) { 
 //BA.debugLineNum = 948;BA.debugLine="CLV_PICK_CIEGO.Clear";
_clv_pick_ciego._clear();
 }else {
 //BA.debugLineNum = 950;BA.debugLine="CLV_PICK_CIEGO.Clear";
_clv_pick_ciego._clear();
 //BA.debugLineNum = 952;BA.debugLine="q_buscar = \"%\" & et_buspc.Text & \"%\"";
_q_buscar = "%"+_et_buspc.getText()+"%";
 //BA.debugLineNum = 953;BA.debugLine="Log(q_buscar)";
__c.LogImpl("76684679",_q_buscar,0);
 //BA.debugLineNum = 954;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2($\"select CAT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select CAT_GP_NOMBRE, CAT_GP_ID , ifnull(PC_CANT,0) AS PC_CANT FROM CAT_GUNAPROD INNER JOIN PICK_CIEGO ON PC_ID_PROD = CAT_GP_ID AND PC_NOM_PROD = CAT_GP_NOMBRE WHERE (CAT_GP_NOMBRE LIKE ? OR  CAT_GP_ID  LIKE ? ) and CAT_GP_CLASIF <> 'PROMOS'"),new String[]{_q_buscar,_q_buscar})));
 //BA.debugLineNum = 955;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 958;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step9 = 1;
final int limit9 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit9 ;_i = _i + step9 ) {
 //BA.debugLineNum = 959;BA.debugLine="c.Position = i";
_c.setPosition(_i);
 //BA.debugLineNum = 960;BA.debugLine="CLV_PICK_CIEGO.Add(CreateListItem(c.GetString(";
_clv_pick_ciego._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_c.GetString("CAT_GP_ID"),_c.GetString("CAT_GP_NOMBRE"),_c.GetString("PC_CANT")).getObject())),(Object)(_i));
 }
};
 //BA.debugLineNum = 963;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 965;BA.debugLine="d=B4XPages.MainPage.skmt.ExecQuery2($\"select CA";
_d = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select CAT_GP_NOMBRE, CAT_GP_ID FROM CAT_GUNAPROD WHERE (CAT_GP_NOMBRE LIKE ? OR  CAT_GP_ID  LIKE ? ) and CAT_GP_CLASIF <> 'PROMOS'AND CAT_GP_ID NOT IN (SELECT PC_ID_PROD FROM PICK_CIEGO)"),new String[]{_q_buscar,_q_buscar})));
 //BA.debugLineNum = 967;BA.debugLine="For i = 0 To d.RowCount - 1";
{
final int step15 = 1;
final int limit15 = (int) (_d.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit15 ;_i = _i + step15 ) {
 //BA.debugLineNum = 968;BA.debugLine="d.Position = i";
_d.setPosition(_i);
 //BA.debugLineNum = 969;BA.debugLine="CLV_PICK_CIEGO.Add(CreateListItem2(d.GetString";
_clv_pick_ciego._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem2(_d.GetString("CAT_GP_ID"),_d.GetString("CAT_GP_NOMBRE")).getObject())),(Object)(_i));
 }
};
 //BA.debugLineNum = 972;BA.debugLine="d.Close";
_d.Close();
 }else if(_c.getRowCount()==0) { 
 //BA.debugLineNum = 975;BA.debugLine="d=B4XPages.MainPage.skmt.ExecQuery2($\"select CA";
_d = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select CAT_GP_NOMBRE, CAT_GP_ID FROM CAT_GUNAPROD WHERE (CAT_GP_NOMBRE LIKE ? OR  CAT_GP_ID  LIKE ? ) and CAT_GP_CLASIF <> 'PROMOS'"),new String[]{_q_buscar,_q_buscar})));
 //BA.debugLineNum = 977;BA.debugLine="For i = 0 To d.RowCount - 1";
{
final int step22 = 1;
final int limit22 = (int) (_d.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit22 ;_i = _i + step22 ) {
 //BA.debugLineNum = 978;BA.debugLine="d.Position = i";
_d.setPosition(_i);
 //BA.debugLineNum = 979;BA.debugLine="CLV_PICK_CIEGO.Add(CreateListItem2(d.GetString";
_clv_pick_ciego._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem2(_d.GetString("CAT_GP_ID"),_d.GetString("CAT_GP_NOMBRE")).getObject())),(Object)(_i));
 }
};
 //BA.debugLineNum = 982;BA.debugLine="d.Close";
_d.Close();
 };
 };
 //BA.debugLineNum = 985;BA.debugLine="End Sub";
return "";
}
public String  _et_pick_ciego_textchanged(String _old,String _new) throws Exception{
anywheresoftware.b4a.objects.EditTextWrapper _et = null;
 //BA.debugLineNum = 1018;BA.debugLine="Sub ET_PICK_CIEGO_TextChanged (Old As String, New";
 //BA.debugLineNum = 1019;BA.debugLine="Dim et As EditText = Sender";
_et = new anywheresoftware.b4a.objects.EditTextWrapper();
_et = (anywheresoftware.b4a.objects.EditTextWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.EditTextWrapper(), (android.widget.EditText)(__c.Sender(ba)));
 //BA.debugLineNum = 1020;BA.debugLine="If New.Length > 4 Then";
if (_new.length()>4) { 
 //BA.debugLineNum = 1021;BA.debugLine="et.Text = Old";
_et.setText(BA.ObjectToCharSequence(_old));
 };
 //BA.debugLineNum = 1023;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 779;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 780;BA.debugLine="If user.text = \"GPS\" Then";
if ((_user.getText()).equals("GPS")) { 
 //BA.debugLineNum = 781;BA.debugLine="user.Text=Location1.Latitude";
_user.setText(BA.ObjectToCharSequence(_location1.getLatitude()));
 //BA.debugLineNum = 782;BA.debugLine="pass.text=Location1.Longitude";
_pass.setText(BA.ObjectToCharSequence(_location1.getLongitude()));
 };
 //BA.debugLineNum = 784;BA.debugLine="End Sub";
return "";
}
public String  _i_engrane_click() throws Exception{
 //BA.debugLineNum = 883;BA.debugLine="Sub i_engrane_Click";
 //BA.debugLineNum = 884;BA.debugLine="lv_server.Clear";
_lv_server.Clear();
 //BA.debugLineNum = 885;BA.debugLine="ime.HideKeyboard";
_ime.HideKeyboard(ba);
 //BA.debugLineNum = 886;BA.debugLine="lv_server.AddSingleLine(\"http://keymon.lat:1781\")";
_lv_server.AddSingleLine(BA.ObjectToCharSequence("http://keymon.lat:1781"));
 //BA.debugLineNum = 888;BA.debugLine="If user.Text = \"KMTS1\" Then lv_server.AddSingleLi";
if ((_user.getText()).equals("KMTS1")) { 
_lv_server.AddSingleLine(BA.ObjectToCharSequence("http://10.0.0.205:1781"));};
 //BA.debugLineNum = 890;BA.debugLine="Log($\"|${Starter.DBReqServer}|\"$)";
__c.LogImpl("76094855",("|"+__c.SmartStringFormatter("",(Object)(_starter._dbreqserver /*String*/ ))+"|"),0);
 //BA.debugLineNum = 892;BA.debugLine="et_server.Text = Starter.DBReqServer";
_et_server.setText(BA.ObjectToCharSequence(_starter._dbreqserver /*String*/ ));
 //BA.debugLineNum = 893;BA.debugLine="Subs.panelVisible(p_appUpdate,0,0)";
_subs._panelvisible /*String*/ (ba,_p_appupdate,(int) (0),(int) (0));
 //BA.debugLineNum = 894;BA.debugLine="If user.Text.trim = \"KMTS1\" Then b_importarBD.Vis";
if ((_user.getText().trim()).equals("KMTS1")) { 
_b_importarbd.setVisible(__c.True);}
else {
_b_importarbd.setVisible(__c.False);};
 //BA.debugLineNum = 895;BA.debugLine="End Sub";
return "";
}
public String  _i_engrane_longclick() throws Exception{
 //BA.debugLineNum = 901;BA.debugLine="Sub i_engrane_LongClick";
 //BA.debugLineNum = 902;BA.debugLine="copiaDB";
_copiadb();
 //BA.debugLineNum = 903;BA.debugLine="End Sub";
return "";
}
public String  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 125;BA.debugLine="Public Sub Initialize";
 //BA.debugLineNum = 127;BA.debugLine="End Sub";
return "";
}
public String  _jobdone(medicomed.keymon.com.mx.httpjob _job) throws Exception{
medicomed.keymon.com.mx.dbrequestmanager._dbresult _result = null;
Object[] _records = null;
String _cat_ve_version = "";
String _k = "";
String _id_almacen = "";
String _id = "";
String _cuenta = "";
String _fecha_hoy = "";
String _name = "";
String _imei_base = "";
String _valido = "";
 //BA.debugLineNum = 487;BA.debugLine="Sub JobDone(Job As HttpJob)";
 //BA.debugLineNum = 488;BA.debugLine="Log(\"JOBDONE MAINPAGE\")";
__c.LogImpl("75308417","JOBDONE MAINPAGE",0);
 //BA.debugLineNum = 489;BA.debugLine="If B4XPages.MainPage.reqManager.reqsList.IsInitia";
if (_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._reqmanager /*medicomed.keymon.com.mx.dbrequestmanager*/ ._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IsInitialized()) { 
 //BA.debugLineNum = 490;BA.debugLine="If B4XPages.MainPage.reqManager.reqsList.IndexOf";
if (_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._reqmanager /*medicomed.keymon.com.mx.dbrequestmanager*/ ._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IndexOf(_job._tag /*Object*/ )!=-1) { 
 //BA.debugLineNum = 491;BA.debugLine="B4XPages.MainPage.reqManager.reqsList.RemoveAt(";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._reqmanager /*medicomed.keymon.com.mx.dbrequestmanager*/ ._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .RemoveAt(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._reqmanager /*medicomed.keymon.com.mx.dbrequestmanager*/ ._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IndexOf(_job._tag /*Object*/ ));
 //BA.debugLineNum = 492;BA.debugLine="LogColor($\">>>>>> Quitamos ${Job.tag}\"$, Colors";
__c.LogImpl("75308421",(">>>>>> Quitamos "+__c.SmartStringFormatter("",_job._tag /*Object*/ )+""),__c.Colors.Blue);
 };
 //BA.debugLineNum = 494;BA.debugLine="LogColor(\">>>>>> \" & B4XPages.MainPage.reqManage";
__c.LogImpl("75308423",">>>>>> "+BA.NumberToString(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._reqmanager /*medicomed.keymon.com.mx.dbrequestmanager*/ ._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .getSize())+" - "+BA.ObjectToString(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._reqmanager /*medicomed.keymon.com.mx.dbrequestmanager*/ ._reqslist /*anywheresoftware.b4a.objects.collections.List*/ ),__c.Colors.Blue);
 };
 //BA.debugLineNum = 496;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
 //BA.debugLineNum = 497;BA.debugLine="LogColor(\"Error: \" & Job.tag & \" : \" & Job.Error";
__c.LogImpl("75308426","Error: "+BA.ObjectToString(_job._tag /*Object*/ )+" : "+_job._errormessage /*String*/ ,__c.Colors.Red);
 }else {
 //BA.debugLineNum = 499;BA.debugLine="LogColor(\"JobDone: '\" & reqManager.HandleJob(Job";
__c.LogImpl("75308428","JobDone: '"+BA.ObjectToString(_reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job).Tag /*Object*/ )+"' - Registros: "+BA.NumberToString(_reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job).Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()),__c.Colors.Green);
 //BA.debugLineNum = 500;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 501;BA.debugLine="Dim result As DBResult = reqManager.HandleJob(J";
_result = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 502;BA.debugLine="If result.Tag = \"version\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("version"))) { 
 //BA.debugLineNum = 503;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group16 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen16 = group16.getSize()
;int index16 = 0;
;
for (; index16 < groupLen16;index16++){
_records = (Object[])(group16.Get(index16));
 //BA.debugLineNum = 504;BA.debugLine="skmt.ExecNonQuery(\"delete from VERSION\")";
_skmt.ExecNonQuery("delete from VERSION");
 //BA.debugLineNum = 505;BA.debugLine="Dim CAT_VE_VERSION As String = records(result";
_cat_ve_version = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CAT_VE_VERSION"))))]);
 //BA.debugLineNum = 506;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO VERSION(NOVER";
_skmt.ExecNonQuery2("INSERT INTO VERSION(NOVERSION) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cat_ve_version)}));
 }
};
 };
 //BA.debugLineNum = 510;BA.debugLine="If result.Tag = \"select_fechat\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("select_fechat"))) { 
 //BA.debugLineNum = 511;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group23 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen23 = group23.getSize()
;int index23 = 0;
;
for (; index23 < groupLen23;index23++){
_records = (Object[])(group23.Get(index23));
 //BA.debugLineNum = 512;BA.debugLine="For Each k As String In result.Columns.Keys";
{
final anywheresoftware.b4a.BA.IterableList group24 = _result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen24 = group24.getSize()
;int index24 = 0;
;
for (; index24 < groupLen24;index24++){
_k = BA.ObjectToString(group24.Get(index24));
 //BA.debugLineNum = 513;BA.debugLine="Log(\"select_fechat: \" & k & \": \" & records(r";
__c.LogImpl("75308442","select_fechat: "+_k+": "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),0);
 }
};
 }
};
 };
 };
 //BA.debugLineNum = 519;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 520;BA.debugLine="Dim result As DBResult = reqManager.HandleJob(J";
_result = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 521;BA.debugLine="If result.Tag = \"agencia\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("agencia"))) { 
 //BA.debugLineNum = 522;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group33 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen33 = group33.getSize()
;int index33 = 0;
;
for (; index33 < groupLen33;index33++){
_records = (Object[])(group33.Get(index33));
 //BA.debugLineNum = 523;BA.debugLine="Dim ID_ALMACEN As String = records(result.Col";
_id_almacen = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("ID_ALMACEN"))))]);
 }
};
 };
 };
 //BA.debugLineNum = 589;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 590;BA.debugLine="Dim result As DBResult = reqManager.HandleJob(J";
_result = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 591;BA.debugLine="If result.Tag.As(String).IndexOf(\"PICK_C_\") > -";
if ((BA.ObjectToString(_result.Tag /*Object*/ )).indexOf("PICK_C_")>-1) { 
 //BA.debugLineNum = 593;BA.debugLine="Private id As String= result.Tag";
_id = BA.ObjectToString(_result.Tag /*Object*/ );
 //BA.debugLineNum = 594;BA.debugLine="id = id.SubString(id.IndexOf(\"_\")+3)";
_id = _id.substring((int) (_id.indexOf("_")+3));
 //BA.debugLineNum = 595;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group43 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen43 = group43.getSize()
;int index43 = 0;
;
for (; index43 < groupLen43;index43++){
_records = (Object[])(group43.Get(index43));
 //BA.debugLineNum = 596;BA.debugLine="Dim CUENTA As String = records(result.Columns";
_cuenta = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CUENTA"))))]);
 //BA.debugLineNum = 597;BA.debugLine="Log(CUENTA)";
__c.LogImpl("75308526",_cuenta,0);
 //BA.debugLineNum = 598;BA.debugLine="Log(id)";
__c.LogImpl("75308527",_id,0);
 //BA.debugLineNum = 599;BA.debugLine="If CUENTA = 0 Then";
if ((_cuenta).equals(BA.NumberToString(0))) { 
 }else if((double)(Double.parseDouble(_cuenta))>0) { 
 };
 }
};
 };
 };
 //BA.debugLineNum = 632;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 633;BA.debugLine="Dim result As DBResult = reqManager.HandleJob(J";
_result = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 634;BA.debugLine="If result.Tag = \"fecha\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("fecha"))) { 
 //BA.debugLineNum = 635;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group56 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen56 = group56.getSize()
;int index56 = 0;
;
for (; index56 < groupLen56;index56++){
_records = (Object[])(group56.Get(index56));
 //BA.debugLineNum = 636;BA.debugLine="Dim FECHA_HOY As String = records(result.Colu";
_fecha_hoy = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("FECHA"))))]);
 //BA.debugLineNum = 637;BA.debugLine="skmt.ExecNonQuery2(\"delete from CAT_VARIABLES";
_skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("FECHA")}));
 //BA.debugLineNum = 638;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_VARIABLES";
_skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("FECHA"),(Object)(_fecha_hoy)}));
 }
};
 };
 };
 //BA.debugLineNum = 643;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 644;BA.debugLine="Dim result As DBResult = reqManager.HandleJob(J";
_result = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 645;BA.debugLine="If result.Tag = \"usuario\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("usuario"))) { 
 //BA.debugLineNum = 646;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group66 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen66 = group66.getSize()
;int index66 = 0;
;
for (; index66 < groupLen66;index66++){
_records = (Object[])(group66.Get(index66));
 //BA.debugLineNum = 647;BA.debugLine="Dim name As String = records(result.Columns.G";
_name = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("USUARIO"))))]);
 //BA.debugLineNum = 648;BA.debugLine="Dim ID_ALMACEN As String = records(result.Col";
_id_almacen = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CAT_LO_AGENCIA"))))]);
 //BA.debugLineNum = 649;BA.debugLine="Dim IMEI_BASE As String = records(result.Colu";
_imei_base = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CAT_LO_IDTELEFONO"))))]);
 //BA.debugLineNum = 650;BA.debugLine="Log(records(result.Columns.Get(\"CAT_LO_IDTELE";
__c.LogImpl("75308579",BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CAT_LO_IDTELEFONO"))))]),0);
 }
};
 //BA.debugLineNum = 652;BA.debugLine="paso1 = 1";
_paso1 = BA.NumberToString(1);
 //BA.debugLineNum = 653;BA.debugLine="ToastMessageShow(name, False)";
__c.ToastMessageShow(BA.ObjectToCharSequence(_name),__c.False);
 //BA.debugLineNum = 654;BA.debugLine="Log(\"//////////////////////////  \"&name)";
__c.LogImpl("75308583","//////////////////////////  "+_name,0);
 };
 };
 //BA.debugLineNum = 658;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 659;BA.debugLine="Dim result As DBResult = reqManager.HandleJob(J";
_result = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 660;BA.debugLine="If result.Tag = \"usuario_10\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("usuario_10"))) { 
 //BA.debugLineNum = 661;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group80 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen80 = group80.getSize()
;int index80 = 0;
;
for (; index80 < groupLen80;index80++){
_records = (Object[])(group80.Get(index80));
 //BA.debugLineNum = 662;BA.debugLine="Dim name As String = records(result.Columns.G";
_name = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("USUARIO"))))]);
 //BA.debugLineNum = 663;BA.debugLine="Dim ID_ALMACEN As String = records(result.Col";
_id_almacen = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CAT_LO_AGENCIA"))))]);
 //BA.debugLineNum = 664;BA.debugLine="Dim IMEI_BASE As String = records(result.Colu";
_imei_base = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("CAT_LO_IDTELEFONO"))))]);
 }
};
 //BA.debugLineNum = 666;BA.debugLine="Log(\"|\"&name&\"|\")";
__c.LogImpl("75308595","|"+_name+"|",0);
 //BA.debugLineNum = 667;BA.debugLine="paso1 = 1";
_paso1 = BA.NumberToString(1);
 //BA.debugLineNum = 668;BA.debugLine="IMEI_BASE = \"\"";
_imei_base = "";
 //BA.debugLineNum = 669;BA.debugLine="IMEI = \"\"";
_imei = "";
 };
 };
 //BA.debugLineNum = 698;BA.debugLine="If result.Tag = \"ruta\" Then 'query tag";
if ((_result.Tag /*Object*/ ).equals((Object)("ruta"))) { 
 //BA.debugLineNum = 699;BA.debugLine="Log(\"JOBDONE PRINCIPAL MAINPAGE\")";
__c.LogImpl("75308628","JOBDONE PRINCIPAL MAINPAGE",0);
 //BA.debugLineNum = 700;BA.debugLine="For Each records() As Object In result.Rows";
{
final anywheresoftware.b4a.BA.IterableList group93 = _result.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen93 = group93.getSize()
;int index93 = 0;
;
for (; index93 < groupLen93;index93++){
_records = (Object[])(group93.Get(index93));
 //BA.debugLineNum = 701;BA.debugLine="Dim VALIDO As String = records(result.Columns.";
_valido = BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_result.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("VALIDO"))))]);
 //BA.debugLineNum = 702;BA.debugLine="If VALIDO = \"OK\" Then";
if ((_valido).equals("OK")) { 
 //BA.debugLineNum = 703;BA.debugLine="Log(VALIDO)";
__c.LogImpl("75308632",_valido,0);
 };
 }
};
 };
 //BA.debugLineNum = 708;BA.debugLine="Job.Release";
_job._release /*String*/ ();
 };
 //BA.debugLineNum = 710;BA.debugLine="Log($\"Paso1 = ${paso1} - Name: ${name} - IMEI: ${";
__c.LogImpl("75308639",("Paso1 = "+__c.SmartStringFormatter("",(Object)(_paso1))+" - Name: "+__c.SmartStringFormatter("",(Object)(_name))+" - IMEI: "+__c.SmartStringFormatter("",(Object)(_imei))+" - IMEI_BASE: "+__c.SmartStringFormatter("",(Object)(_imei_base))+""),0);
 //BA.debugLineNum = 711;BA.debugLine="If paso1 = 1 Then";
if ((_paso1).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 712;BA.debugLine="If IMEI = \"\" Then";
if ((_imei).equals("")) { 
 //BA.debugLineNum = 713;BA.debugLine="If user.Text = \"KMTS1\" Then name = \"OKActivo\"";
if ((_user.getText()).equals("KMTS1")) { 
_name = "OKActivo";};
 //BA.debugLineNum = 714;BA.debugLine="If name = \"OKActivo\"  Then";
if ((_name).equals("OKActivo")) { 
 //BA.debugLineNum = 715;BA.debugLine="skmt.ExecNonQuery(\"delete from usuarioa\")";
_skmt.ExecNonQuery("delete from usuarioa");
 //BA.debugLineNum = 716;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO USUARIOA VALUE";
_skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_user.getText().trim()),(Object)(_pass.getText().trim())}));
 //BA.debugLineNum = 717;BA.debugLine="skmt.ExecNonQuery(\"delete from cat_almacen\")";
_skmt.ExecNonQuery("delete from cat_almacen");
 //BA.debugLineNum = 718;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_ALMACEN(ID";
_skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_id_almacen)}));
 //BA.debugLineNum = 719;BA.debugLine="usuario = user.Text";
_usuario = _user.getText();
 //BA.debugLineNum = 720;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 }else if((_name).equals("OKExpirado")) { 
 //BA.debugLineNum = 722;BA.debugLine="Msgbox(\"Usuario Expirado llamar al administrad";
__c.Msgbox(BA.ObjectToCharSequence("Usuario Expirado llamar al administrador"),BA.ObjectToCharSequence(""),ba);
 }else if((_name).equals("OKCancelado")) { 
 //BA.debugLineNum = 724;BA.debugLine="Msgbox(\"Usuario Cancelado llamar al administra";
__c.Msgbox(BA.ObjectToCharSequence("Usuario Cancelado llamar al administrador"),BA.ObjectToCharSequence(""),ba);
 }else {
 //BA.debugLineNum = 726;BA.debugLine="Msgbox(\"Usuario o password No validos\",\"\") 'Ig";
__c.Msgbox(BA.ObjectToCharSequence("Usuario o password No validos"),BA.ObjectToCharSequence(""),ba);
 };
 //BA.debugLineNum = 728;BA.debugLine="paso1 = 0";
_paso1 = BA.NumberToString(0);
 }else {
 //BA.debugLineNum = 730;BA.debugLine="If name = \"OKActivo\" & IMEI And  IMEI = IMEI_BA";
if ((_name).equals("OKActivo"+_imei) && (_imei).equals(_imei_base)) { 
 //BA.debugLineNum = 731;BA.debugLine="If name = \"OKActivo\" & IMEI Then";
if ((_name).equals("OKActivo"+_imei)) { 
 //BA.debugLineNum = 732;BA.debugLine="skmt.ExecNonQuery(\"delete from usuarioa\")";
_skmt.ExecNonQuery("delete from usuarioa");
 //BA.debugLineNum = 733;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO USUARIOA VALU";
_skmt.ExecNonQuery2("INSERT INTO USUARIOA VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_user.getText().trim()),(Object)(_pass.getText().trim())}));
 //BA.debugLineNum = 734;BA.debugLine="skmt.ExecNonQuery(\"delete from cat_almacen\")";
_skmt.ExecNonQuery("delete from cat_almacen");
 //BA.debugLineNum = 735;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_ALMACEN(I";
_skmt.ExecNonQuery2("INSERT INTO CAT_ALMACEN(ID_ALMACEN) VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_id_almacen)}));
 //BA.debugLineNum = 736;BA.debugLine="usuario = user.Text";
_usuario = _user.getText();
 //BA.debugLineNum = 737;BA.debugLine="B4XPages.ShowPage(\"Clientes\")";
_b4xpages._showpage /*String*/ (ba,"Clientes");
 }else if((_name).equals("OKExpirado"+_imei)) { 
 //BA.debugLineNum = 739;BA.debugLine="Msgbox(\"Usuario Expirado llamar al administra";
__c.Msgbox(BA.ObjectToCharSequence("Usuario Expirado llamar al administrador"),BA.ObjectToCharSequence(""),ba);
 }else if((_name).equals("OKCancelado"+_imei)) { 
 //BA.debugLineNum = 741;BA.debugLine="Msgbox(\"Usuario Cancelado llamar al administr";
__c.Msgbox(BA.ObjectToCharSequence("Usuario Cancelado llamar al administrador"),BA.ObjectToCharSequence(""),ba);
 }else {
 //BA.debugLineNum = 743;BA.debugLine="Msgbox(\"Usuario o password No validos\",\"\") 'i";
__c.Msgbox(BA.ObjectToCharSequence("Usuario o password No validos"),BA.ObjectToCharSequence(""),ba);
 };
 //BA.debugLineNum = 745;BA.debugLine="paso1 = 0";
_paso1 = BA.NumberToString(0);
 }else if((_name).equals("OKActivo")) { 
 //BA.debugLineNum = 747;BA.debugLine="Msgbox(\"Telefono no VALIDO!\",\"\") 'ignore";
__c.Msgbox(BA.ObjectToCharSequence("Telefono no VALIDO!"),BA.ObjectToCharSequence(""),ba);
 }else {
 //BA.debugLineNum = 749;BA.debugLine="Msgbox(\"Usuario o password No validos\",\"\") 'ig";
__c.Msgbox(BA.ObjectToCharSequence("Usuario o password No validos"),BA.ObjectToCharSequence(""),ba);
 };
 };
 };
 //BA.debugLineNum = 753;BA.debugLine="End Sub";
return "";
}
public String  _lv_server_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 909;BA.debugLine="Private Sub lv_server_ItemClick (Position As Int,";
 //BA.debugLineNum = 910;BA.debugLine="Starter.DBReqServer = Value";
_starter._dbreqserver /*String*/  = BA.ObjectToString(_value);
 //BA.debugLineNum = 912;BA.debugLine="et_server.Text = Value";
_et_server.setText(BA.ObjectToCharSequence(_value));
 //BA.debugLineNum = 913;BA.debugLine="Starter.reinicializaReqManager(Value)";
_starter._reinicializareqmanager /*String*/ (BA.ObjectToString(_value));
 //BA.debugLineNum = 915;BA.debugLine="ToastMessageShow(\"Servidor modificado\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Servidor modificado"),__c.False);
 //BA.debugLineNum = 916;BA.debugLine="End Sub";
return "";
}
public String  _muestraprogreso(String _mensaje) throws Exception{
 //BA.debugLineNum = 874;BA.debugLine="Sub muestraProgreso(mensaje As String)";
 //BA.debugLineNum = 875;BA.debugLine="ProgressDialogShow(mensaje)";
__c.ProgressDialogShow(ba,BA.ObjectToCharSequence(_mensaje));
 //BA.debugLineNum = 876;BA.debugLine="End Sub";
return "";
}
public String  _ocultaprogreso() throws Exception{
 //BA.debugLineNum = 879;BA.debugLine="Sub ocultaProgreso";
 //BA.debugLineNum = 880;BA.debugLine="ProgressDialogHide";
__c.ProgressDialogHide();
 //BA.debugLineNum = 881;BA.debugLine="End Sub";
return "";
}
public String  _p_add_monto_click() throws Exception{
 //BA.debugLineNum = 1296;BA.debugLine="Private Sub p_add_monto_Click";
 //BA.debugLineNum = 1298;BA.debugLine="End Sub";
return "";
}
public String  _p_ciego_click() throws Exception{
 //BA.debugLineNum = 1288;BA.debugLine="Private Sub P_CIEGO_Click";
 //BA.debugLineNum = 1290;BA.debugLine="End Sub";
return "";
}
public String  _p_validacion_click() throws Exception{
 //BA.debugLineNum = 1292;BA.debugLine="Private Sub p_validacion_Click";
 //BA.debugLineNum = 1294;BA.debugLine="End Sub";
return "";
}
public String  _pdf_click() throws Exception{
 //BA.debugLineNum = 799;BA.debugLine="Sub PDF_Click";
 //BA.debugLineNum = 801;BA.debugLine="End Sub";
return "";
}
public String  _popupmenu_dismiss() throws Exception{
 //BA.debugLineNum = 786;BA.debugLine="Sub PopupMenu_Dismiss";
 //BA.debugLineNum = 787;BA.debugLine="ToastMessageShow(\"PopupMenu dismissed\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("PopupMenu dismissed"),__c.False);
 //BA.debugLineNum = 788;BA.debugLine="End Sub";
return "";
}
public boolean  _popupmenu_menuitemclick(int _itemid) throws Exception{
 //BA.debugLineNum = 790;BA.debugLine="Sub PopupMenu_MenuItemClick (ItemId As Int) As Boo";
 //BA.debugLineNum = 791;BA.debugLine="ToastMessageShow(\"Item \" & ItemId & \" clicked.\",";
__c.ToastMessageShow(BA.ObjectToCharSequence("Item "+BA.NumberToString(_itemid)+" clicked."),__c.False);
 //BA.debugLineNum = 792;BA.debugLine="Return False";
if (true) return __c.False;
 //BA.debugLineNum = 793;BA.debugLine="End Sub";
return false;
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "GPS_LOCATIONCHANGED"))
	return _gps_locationchanged((anywheresoftware.b4a.gps.LocationWrapper) args[0]);
if (BA.fastSubCompare(sub, "JOBDONE"))
	return _jobdone((medicomed.keymon.com.mx.httpjob) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
