package gunav2.keymon.com.mx;


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

public class c_clientes 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, "gunav2.keymon.com.mx.c_clientes");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.keymon.com.mx.c_clientes.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public String _entro = "";
public anywheresoftware.b4a.objects.ButtonWrapper _gest = null;
public anywheresoftware.b4a.objects.LabelWrapper _lfila = null;
public anywheresoftware.b4a.objects.EditTextWrapper _busca = null;
public String _colonia = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_qr = null;
public com.inforpires.baQRCode.baQRCode _qr = null;
public String _codigo = "";
public String _stime = "";
public String _ruta = "";
public String _q_buscar = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_clientes = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel4 = null;
public gunav2.keymon.com.mx.dbrequestmanager _reqmanager = null;
public b4a.example.dateutils _dateutils = null;
public gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.starter _starter = null;
public gunav2.keymon.com.mx.subs _subs = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _b_qr_click() throws Exception{
int _scan_width = 0;
int _scan_height = 0;
 //BA.debugLineNum = 197;BA.debugLine="Sub b_qr_Click";
 //BA.debugLineNum = 198;BA.debugLine="Dim scan_width As Int";
_scan_width = 0;
 //BA.debugLineNum = 199;BA.debugLine="Dim scan_height As Int";
_scan_height = 0;
 //BA.debugLineNum = 200;BA.debugLine="scan_width = 400";
_scan_width = (int) (400);
 //BA.debugLineNum = 201;BA.debugLine="scan_height = 400";
_scan_height = (int) (400);
 //BA.debugLineNum = 202;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 64;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 65;BA.debugLine="reqManager.Initialize(Me, Starter.server)";
_reqmanager._initialize /*String*/ (ba,this,_starter._server /*String*/ );
 //BA.debugLineNum = 66;BA.debugLine="busca.Text = \"\"";
_busca.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 67;BA.debugLine="entro = \"2\"";
_entro = "2";
 //BA.debugLineNum = 68;BA.debugLine="colonia = 0";
_colonia = BA.NumberToString(0);
 //BA.debugLineNum = 69;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select  CAT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select  CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info3 where  gestion = 0 ORDER BY CAT_CL_CODIGO")));
 //BA.debugLineNum = 70;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 71;BA.debugLine="lfila.Text = \"NOMBRE\"";
_lfila.setText(BA.ObjectToCharSequence("NOMBRE"));
 //BA.debugLineNum = 72;BA.debugLine="Subs.SetDivider(ListView1, Colors.White, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.White,(int) (2));
 //BA.debugLineNum = 73;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 74;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step10 = 1;
final int limit10 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit10 ;_i = _i + step10 ) {
 //BA.debugLineNum = 75;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 76;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 77;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 78;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 79;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 80;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 81;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 82;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 83;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 84;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 85;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 87;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 88;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface.D";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 89;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface.D";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 90;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"CAT_CL_CODIG";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CODIGO")),BA.ObjectToCharSequence(_c.GetString("CAT_CL_NOMBRE")));
 }
};
 };
 //BA.debugLineNum = 93;BA.debugLine="If B4XPages.MainPage.cliente.cuest.IsInitialized";
if (_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._cuest /*gunav2.keymon.com.mx.c_cuestionario*/ .IsInitialized /*boolean*/ ()) { 
 //BA.debugLineNum = 95;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUESTIONARIO where Q_IDCLIENTE not in (select Q_IDCLIENTE from CUESTIONARIO where Q_IDPREGUNTA = '7')");
 //BA.debugLineNum = 96;BA.debugLine="Log(\"Borramos encuestas incompletas\")";
__c.LogImpl("432899104","Borramos encuestas incompletas",0);
 };
 //BA.debugLineNum = 98;BA.debugLine="entro = \"4\"";
_entro = "4";
 //BA.debugLineNum = 99;BA.debugLine="End Sub";
return "";
}
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(gunav2.keymon.com.mx.c_clientes parent) {
this.parent = parent;
}
gunav2.keymon.com.mx.c_clientes 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 = 164;BA.debugLine="Return True";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.True));return;};
 //BA.debugLineNum = 165;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 35;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 36;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 38;BA.debugLine="Root.LoadLayout(\"clientes\")";
_root.LoadLayout("clientes",ba);
 //BA.debugLineNum = 40;BA.debugLine="entro =\"2\"";
_entro = "2";
 //BA.debugLineNum = 41;BA.debugLine="p_clientes.Height = Root.Height";
_p_clientes.setHeight(_root.getHeight());
 //BA.debugLineNum = 42;BA.debugLine="p_clientes.Width = Root.Width";
_p_clientes.setWidth(_root.getWidth());
 //BA.debugLineNum = 43;BA.debugLine="Panel4.Left = Round(Root.Width/2)-(Panel4.Width/2";
_panel4.setLeft((int) (__c.Round(_root.getWidth()/(double)2)-(_panel4.getWidth()/(double)2)));
 //BA.debugLineNum = 44;BA.debugLine="Panel4.Height = Root.Height * 0.70";
_panel4.setHeight((int) (_root.getHeight()*0.70));
 //BA.debugLineNum = 45;BA.debugLine="ListView1.Height = Panel4.Height * 0.95";
_listview1.setHeight((int) (_panel4.getHeight()*0.95));
 //BA.debugLineNum = 51;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 58;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(_ruta,"kmt.db")==__c.False) { 
 //BA.debugLineNum = 59;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",_ruta,"kmt.db");
 };
 //BA.debugLineNum = 61;BA.debugLine="qr.initialize";
_qr.initialize();
 //BA.debugLineNum = 62;BA.debugLine="End Sub";
return "";
}
public String  _busca_textchanged(String _old,String _new) throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 167;BA.debugLine="Sub BUSCA_TextChanged (Old As String, New As Strin";
 //BA.debugLineNum = 168;BA.debugLine="q_buscar = \"%\" & busca.Text & \"%\"";
_q_buscar = "%"+_busca.getText()+"%";
 //BA.debugLineNum = 169;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2(\"select  CAT";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select  CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info3 where (CAT_CL_NOMBRE like ? OR CAT_CL_CODIGO LIKE ? OR CAT_CL_CALLE LIKE ?)and gestion = 0 order by CAT_CL_NOMBRE ",new String[]{_q_buscar,_q_buscar,_q_buscar})));
 //BA.debugLineNum = 170;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 171;BA.debugLine="Subs.SetDivider(ListView1, Colors.White, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.White,(int) (2));
 //BA.debugLineNum = 172;BA.debugLine="lfila.text = \"Nombre y Calle\"";
_lfila.setText(BA.ObjectToCharSequence("Nombre y Calle"));
 //BA.debugLineNum = 173;BA.debugLine="If c2.RowCount>0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 174;BA.debugLine="For i=0 To c2.RowCount -1";
{
final int step7 = 1;
final int limit7 = (int) (_c2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit7 ;_i = _i + step7 ) {
 //BA.debugLineNum = 175;BA.debugLine="c2.Position=i";
_c2.setPosition(_i);
 //BA.debugLineNum = 176;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 177;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 178;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 179;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 180;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 181;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 182;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 183;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 184;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 185;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 187;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 188;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface.D";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 189;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface.D";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 190;BA.debugLine="ListView1.AddTwoLines(c2.GetString(\"CAT_CL_CODI";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c2.GetString("CAT_CL_CODIGO")),BA.ObjectToCharSequence(_c2.GetString("CAT_CL_NOMBRE")+__c.CRLF+"CALLE:  "+_c2.GetString("CAT_CL_CALLE")));
 }
};
 };
 //BA.debugLineNum = 193;BA.debugLine="entro = \"4\"";
_entro = "4";
 //BA.debugLineNum = 194;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 195;BA.debugLine="End Sub";
return "";
}
public String  _calc_ean_checksum(String _number) throws Exception{
int _i = 0;
char _co = '\0';
int _soma = 0;
int _n = 0;
float _digit = 0f;
 //BA.debugLineNum = 225;BA.debugLine="Sub calc_ean_checksum(number As String) As String";
 //BA.debugLineNum = 226;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 227;BA.debugLine="Dim cO As Char";
_co = '\0';
 //BA.debugLineNum = 228;BA.debugLine="Dim soma As Int";
_soma = 0;
 //BA.debugLineNum = 229;BA.debugLine="Dim n As Int";
_n = 0;
 //BA.debugLineNum = 230;BA.debugLine="Dim digit As Float";
_digit = 0f;
 //BA.debugLineNum = 231;BA.debugLine="soma = 0";
_soma = (int) (0);
 //BA.debugLineNum = 232;BA.debugLine="For i=0 To number.Length - 1";
{
final int step7 = 1;
final int limit7 = (int) (_number.length()-1);
_i = (int) (0) ;
for (;_i <= limit7 ;_i = _i + step7 ) {
 //BA.debugLineNum = 233;BA.debugLine="digit = number.SubString2(i,i+1)";
_digit = (float)(Double.parseDouble(_number.substring(_i,(int) (_i+1))));
 //BA.debugLineNum = 234;BA.debugLine="n= digit * ((i Mod 2) * 2 + 1)";
_n = (int) (_digit*((_i%2)*2+1));
 //BA.debugLineNum = 235;BA.debugLine="soma=soma+n";
_soma = (int) (_soma+_n);
 }
};
 //BA.debugLineNum = 237;BA.debugLine="Return number & ( ( 10 - ( soma Mod 10 )) Mod 10";
if (true) return _number+BA.NumberToString(((10-(_soma%10))%10));
 //BA.debugLineNum = 238;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 6;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 8;BA.debugLine="Dim s As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 9;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Dim entro As String";
_entro = "";
 //BA.debugLineNum = 11;BA.debugLine="Dim gest As Button";
_gest = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim lfila As Label";
_lfila = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Dim busca As EditText";
_busca = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Dim colonia As String";
_colonia = "";
 //BA.debugLineNum = 15;BA.debugLine="Private b_qr As Button";
_b_qr = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Private qr As QRCode";
_qr = new com.inforpires.baQRCode.baQRCode();
 //BA.debugLineNum = 18;BA.debugLine="Dim CODIGO As String";
_codigo = "";
 //BA.debugLineNum = 19;BA.debugLine="Dim STIME As String";
_stime = "";
 //BA.debugLineNum = 21;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 22;BA.debugLine="Dim q_buscar As String";
_q_buscar = "";
 //BA.debugLineNum = 23;BA.debugLine="Private p_clientes As Panel";
_p_clientes = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Private Panel4 As Panel";
_panel4 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 26;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new gunav2.keymon.com.mx.dbrequestmanager();
 //BA.debugLineNum = 27;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 30;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 31;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 32;BA.debugLine="End Sub";
return null;
}
public String  _listview1_itemclick(int _position,Object _value) throws Exception{
int _i = 0;
 //BA.debugLineNum = 101;BA.debugLine="Sub ListView1_ItemClick (Position As Int, Value As";
 //BA.debugLineNum = 102;BA.debugLine="If colonia = 0 Then";
if ((_colonia).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 103;BA.debugLine="colonia = Value";
_colonia = BA.ObjectToString(_value);
 };
 //BA.debugLineNum = 105;BA.debugLine="If entro = \"2\" Then";
if ((_entro).equals("2")) { 
 //BA.debugLineNum = 106;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2(\"select CAT";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_CL_CALLE, CAT_CL_COLONIA, count(*) as cuantos from kmt_info3 where gestion = 0 and CAT_CL_COLONIA = ? GROUP BY CAT_CL_CALLE, CAT_CL_COLONIA order by CAT_CL_CALLE ",new String[]{BA.ObjectToString(_value)})));
 //BA.debugLineNum = 107;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 108;BA.debugLine="lfila.text = \"Calle\"";
_lfila.setText(BA.ObjectToCharSequence("Calle"));
 //BA.debugLineNum = 109;BA.debugLine="If c2.RowCount>0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 110;BA.debugLine="For i=0 To c2.RowCount -1";
{
final int step9 = 1;
final int limit9 = (int) (_c2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit9 ;_i = _i + step9 ) {
 //BA.debugLineNum = 111;BA.debugLine="c2.Position=i";
_c2.setPosition(_i);
 //BA.debugLineNum = 112;BA.debugLine="ListView1.AddTwoLines(c2.GetString(\"CAT_CL_CAL";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c2.GetString("CAT_CL_CALLE")),BA.ObjectToCharSequence(_c2.GetString("cuantos")));
 }
};
 };
 //BA.debugLineNum = 115;BA.debugLine="entro = \"3\"";
_entro = "3";
 }else if((_entro).equals("3")) { 
 //BA.debugLineNum = 117;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2(\"select  CA";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select  CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info3 where  gestion = 0 and  CAT_CL_CALLE = ? AND CAT_CL_COLONIA = ? order by CAT_CL_NOMBRE ",new String[]{BA.ObjectToString(_value),_colonia})));
 //BA.debugLineNum = 118;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 119;BA.debugLine="lfila.text = \"Nombre\"";
_lfila.setText(BA.ObjectToCharSequence("Nombre"));
 //BA.debugLineNum = 120;BA.debugLine="If c2.RowCount>0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 121;BA.debugLine="For i=0 To c2.RowCount -1";
{
final int step20 = 1;
final int limit20 = (int) (_c2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit20 ;_i = _i + step20 ) {
 //BA.debugLineNum = 122;BA.debugLine="c2.Position = i";
_c2.setPosition(_i);
 //BA.debugLineNum = 123;BA.debugLine="ListView1.AddTwoLines(c2.GetString(\"CAT_CL_COD";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c2.GetString("CAT_CL_CODIGO")),BA.ObjectToCharSequence(_c2.GetString("CAT_CL_NOMBRE")));
 }
};
 };
 //BA.debugLineNum = 126;BA.debugLine="entro = \"4\"";
_entro = "4";
 }else if((_entro).equals("4")) { 
 //BA.debugLineNum = 128;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUENTAA");
 //BA.debugLineNum = 129;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 //BA.debugLineNum = 130;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 131;BA.debugLine="STIME=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 133;BA.debugLine="s=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT COUN";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM HIST_STAY_STORE WHERE HSS_IN = ? AND HSS_CODIGO In (select cuenta from cuentaa)",new String[]{"0"})));
 //BA.debugLineNum = 134;BA.debugLine="s.Position = 0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 135;BA.debugLine="If s.GetString(\"CUANTOS\") = 1 Then";
if ((_s.GetString("CUANTOS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 136;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HI";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_IN = ?  where HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 }else {
 //BA.debugLineNum = 138;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT IN";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO HIST_STAY_STORE(HSS_CODIGO,  HSS_IN , HSS_OUT , HSS_TOT) VALUES (?,0,0,0)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 //BA.debugLineNum = 139;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HI";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_IN = ?  where HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 };
 //BA.debugLineNum = 141;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_OUT set HSO_INI = ?  where HSO_INI = 0 ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 //BA.debugLineNum = 142;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 144;BA.debugLine="If B4XPages.MainPage.cliente.bitacora.IsInitiali";
if (_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._bitacora /*gunav2.keymon.com.mx.c_bitacora*/ .IsInitialized /*boolean*/ ()) { 
 //BA.debugLineNum = 145;BA.debugLine="Log(\"VAMOS A CLIENTE CON ENVENTA = FALSO\")";
__c.LogImpl("432964652","VAMOS A CLIENTE CON ENVENTA = FALSO",0);
 //BA.debugLineNum = 146;BA.debugLine="B4XPages.MainPage.cliente.bitacora.iniciamosVen";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._bitacora /*gunav2.keymon.com.mx.c_bitacora*/ ._iniciamosventa /*String*/ ();
 //BA.debugLineNum = 147;BA.debugLine="Log(B4XPages.MainPage.cliente.bitacora.enVenta)";
__c.LogImpl("432964654",BA.ObjectToString(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._bitacora /*gunav2.keymon.com.mx.c_bitacora*/ ._enventa /*boolean*/ ),0);
 };
 //BA.debugLineNum = 149;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 };
 //BA.debugLineNum = 154;BA.debugLine="Log(entro)";
__c.LogImpl("432964661",_entro,0);
 //BA.debugLineNum = 155;BA.debugLine="End Sub";
return "";
}
public String  _p_clientes_click() throws Exception{
 //BA.debugLineNum = 242;BA.debugLine="Private Sub p_clientes_Click";
 //BA.debugLineNum = 244;BA.debugLine="End Sub";
return "";
}
public String  _sc_noscan() throws Exception{
 //BA.debugLineNum = 221;BA.debugLine="Sub sc_noScan";
 //BA.debugLineNum = 222;BA.debugLine="Log(\"nothing returned from the scan !!!!!\")";
__c.LogImpl("433292289","nothing returned from the scan !!!!!",0);
 //BA.debugLineNum = 223;BA.debugLine="End Sub";
return "";
}
public String  _sc_result(String _atype,String _values) throws Exception{
 //BA.debugLineNum = 204;BA.debugLine="Sub sc_result(atype As String,Values As String)";
 //BA.debugLineNum = 205;BA.debugLine="CODIGO = Values";
_codigo = _values;
 //BA.debugLineNum = 206;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2(\"select   CO";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select   COUNT(*) AS ENCONTRADO from kmt_info3 where CAT_CL_NUM_SERIEFISICO = ?  order by CAT_CL_NOMBRE ",new String[]{_codigo})));
 //BA.debugLineNum = 207;BA.debugLine="c2.Position =0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 208;BA.debugLine="If c2.GetString(\"ENCONTRADO\") > 0 Then";
if ((double)(Double.parseDouble(_c2.GetString("ENCONTRADO")))>0) { 
 //BA.debugLineNum = 209;BA.debugLine="s=B4XPages.MainPage.skmt.ExecQuery2(\"select   CA";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select   CAT_CL_CODIGO from kmt_info3 where CAT_CL_NUM_SERIEFISICO = ?  order by CAT_CL_NOMBRE ",new String[]{_codigo})));
 //BA.debugLineNum = 210;BA.debugLine="s.Position =0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 211;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUENTAA");
 //BA.debugLineNum = 212;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_s.GetString("CAT_CL_CODIGO"))}));
 //BA.debugLineNum = 213;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 215;BA.debugLine="B4XPages.ShowPage(\"clientes\")";
_b4xpages._showpage /*String*/ (ba,"clientes");
 }else {
 //BA.debugLineNum = 217;BA.debugLine="Msgbox(\"CODIGO \" & CODIGO & \" NO ENCONTRADO\",\"AV";
__c.Msgbox(BA.ObjectToCharSequence("CODIGO "+_codigo+" NO ENCONTRADO"),BA.ObjectToCharSequence("AVISO"),ba);
 };
 //BA.debugLineNum = 219;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
