package gunav2.keymon.com.mx;


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

public class c_clientescompletos 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_clientescompletos");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.keymon.com.mx.c_clientescompletos.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 String _q_buscar = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _lfila = null;
public anywheresoftware.b4a.objects.EditTextWrapper _busca = null;
public String _stime = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = 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  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 19;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 20;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 23;BA.debugLine="Root.LoadLayout(\"Clientes_completos\")";
_root.LoadLayout("Clientes_completos",ba);
 //BA.debugLineNum = 24;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 = 26;BA.debugLine="Sub BUSCA_TextChanged (Old As String, New As Strin";
 //BA.debugLineNum = 27;BA.debugLine="If New = \"\" Then";
if ((_new).equals("")) { 
 //BA.debugLineNum = 28;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 }else {
 //BA.debugLineNum = 30;BA.debugLine="q_buscar = \"%\" & BUSCA.Text & \"%\"";
_q_buscar = "%"+_busca.getText()+"%";
 //BA.debugLineNum = 31;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 CAT_CATCLIENTESTODOS where (CAT_CL_NOMBRE like ? OR CAT_CL_CODIGO LIKE ? OR CAT_CL_CALLE LIKE ?) order by CAT_CL_NOMBRE ",new String[]{_q_buscar,_q_buscar,_q_buscar})));
 //BA.debugLineNum = 32;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 33;BA.debugLine="Subs.SetDivider(ListView1, Colors.White, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.White,(int) (2));
 //BA.debugLineNum = 34;BA.debugLine="lfila.text = \"Nombre y Calle\"";
_lfila.setText(BA.ObjectToCharSequence("Nombre y Calle"));
 //BA.debugLineNum = 35;BA.debugLine="If c2.RowCount>0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 36;BA.debugLine="For i=0 To c2.RowCount -1";
{
final int step10 = 1;
final int limit10 = (int) (_c2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit10 ;_i = _i + step10 ) {
 //BA.debugLineNum = 37;BA.debugLine="c2.Position=i";
_c2.setPosition(_i);
 //BA.debugLineNum = 38;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 39;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 40;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 41;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 42;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 43;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 44;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 45;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 46;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 47;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 49;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 50;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface.D";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 51;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface.D";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 52;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 = 56;BA.debugLine="c2.Close";
_c2.Close();
 };
 //BA.debugLineNum = 58;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 = 4;BA.debugLine="Dim q_buscar As String";
_q_buscar = "";
 //BA.debugLineNum = 5;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 6;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Dim lfila As Label";
_lfila = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 8;BA.debugLine="Private BUSCA As EditText";
_busca = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 9;BA.debugLine="Dim STIME As String";
_stime = "";
 //BA.debugLineNum = 10;BA.debugLine="Dim S As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 11;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 14;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 15;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 16;BA.debugLine="End Sub";
return null;
}
public String  _listview1_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 61;BA.debugLine="Sub ListView1_ItemClick (Position As Int, Value As";
 //BA.debugLineNum = 63;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 = 64;BA.debugLine="Log(Value)";
__c.LogImpl("433751043",BA.ObjectToString(_value),0);
 //BA.debugLineNum = 65;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 = 70;BA.debugLine="B4XPages.ShowPage(\"Tclientes\")";
_b4xpages._showpage /*String*/ (ba,"Tclientes");
 //BA.debugLineNum = 72;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;
}
}
