package reparto_mazapa.keymon.lat;


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

public class c_detalle_promo 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, "reparto_mazapa.keymon.lat.c_detalle_promo");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_mazapa.keymon.lat.c_detalle_promo.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.objects.ButtonWrapper _regresar = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _b = null;
public String _regalo = "";
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.ButtonWrapper _borra = null;
public String _existe = "";
public b4a.example.dateutils _dateutils = null;
public reparto_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.subs _subs = null;
public reparto_mazapa.keymon.lat.firebasemessaging _firebasemessaging = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public boolean  _activity_keypress(int _key) throws Exception{
 //BA.debugLineNum = 96;BA.debugLine="Sub Activity_KeyPress (key As Int) As Boolean";
 //BA.debugLineNum = 98;BA.debugLine="If key=KeyCodes.KEYCODE_BACK Then";
if (_key==__c.KeyCodes.KEYCODE_BACK) { 
 //BA.debugLineNum = 101;BA.debugLine="B4XPages.ShowPage(\"\")";
_b4xpages._showpage /*String*/ (ba,"");
 };
 //BA.debugLineNum = 105;BA.debugLine="Return False";
if (true) return __c.False;
 //BA.debugLineNum = 106;BA.debugLine="End Sub";
return false;
}
public String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 87;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 89;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 = 56;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 57;BA.debugLine="Starter.skmt.Initialize(Starter.ruta,\"kmt.db\", Tr";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(_starter._ruta /*String*/ ,"kmt.db",__c.True);
 //BA.debugLineNum = 58;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CAT_DP_IDPROD, C";
_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*/ .ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS, CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID)")));
 //BA.debugLineNum = 59;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 60;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.LightGray,(int) (2));
 //BA.debugLineNum = 61;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 62;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step6 = 1;
final int limit6 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
 //BA.debugLineNum = 63;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 64;BA.debugLine="b=Starter.skmt.ExecQuery2(\"select CAT_GP_NOMBRE";
_b = (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 CAT_GP_NOMBRE from cat_gunaprod where CAT_GP_ID = ?",new String[]{_c.GetString("CAT_DP_IDPROD")})));
 //BA.debugLineNum = 65;BA.debugLine="B.Position =0";
_b.setPosition((int) (0));
 //BA.debugLineNum = 66;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 67;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 68;BA.debugLine="label1.TextSize = 10";
_label1.setTextSize((float) (10));
 //BA.debugLineNum = 69;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 70;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 71;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 72;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 73;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 74;BA.debugLine="If c.GetString(\"CAT_DP_PRECIO\") = 0 Then";
if ((_c.GetString("CAT_DP_PRECIO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 75;BA.debugLine="regalo = \"SI\"";
_regalo = "SI";
 }else {
 //BA.debugLineNum = 77;BA.debugLine="regalo = \"NO\"";
_regalo = "NO";
 };
 //BA.debugLineNum = 79;BA.debugLine="ListView1.AddTwoLines(B.GetString(\"CAT_GP_NOMBR";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_b.GetString("CAT_GP_NOMBRE")),BA.ObjectToCharSequence("Cantidad # "+_c.GetString("CAT_DP_PZAS")+" REGALO  "+_regalo));
 //BA.debugLineNum = 80;BA.debugLine="b.Close";
_b.Close();
 }
};
 //BA.debugLineNum = 82;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 85;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 22;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 23;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 25;BA.debugLine="Root.LoadLayout(\"detalle_promo\")";
_root.LoadLayout("detalle_promo",ba);
 //BA.debugLineNum = 26;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CAT_DP_IDPROD, C";
_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*/ .ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS, CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID)")));
 //BA.debugLineNum = 27;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 28;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.LightGray,(int) (2));
 //BA.debugLineNum = 29;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 30;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step7 = 1;
final int limit7 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit7 ;_i = _i + step7 ) {
 //BA.debugLineNum = 31;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 32;BA.debugLine="b=Starter.skmt.ExecQuery2(\"select CAT_GP_NOMBRE";
_b = (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 CAT_GP_NOMBRE from cat_gunaprod where CAT_GP_ID = ?",new String[]{_c.GetString("CAT_DP_IDPROD")})));
 //BA.debugLineNum = 33;BA.debugLine="B.Position =0";
_b.setPosition((int) (0));
 //BA.debugLineNum = 34;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 35;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 36;BA.debugLine="label1.TextSize = 10";
_label1.setTextSize((float) (10));
 //BA.debugLineNum = 37;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 38;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 39;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 40;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 41;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 42;BA.debugLine="If c.GetString(\"CAT_DP_PRECIO\") = 0 Then";
if ((_c.GetString("CAT_DP_PRECIO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 43;BA.debugLine="regalo = \"SI\"";
_regalo = "SI";
 }else {
 //BA.debugLineNum = 45;BA.debugLine="regalo = \"NO\"";
_regalo = "NO";
 };
 //BA.debugLineNum = 47;BA.debugLine="ListView1.AddTwoLines(B.GetString(\"CAT_GP_NOMBR";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_b.GetString("CAT_GP_NOMBRE")),BA.ObjectToCharSequence("Cantidad # "+_c.GetString("CAT_DP_PZAS")+" REGALO  "+_regalo));
 //BA.debugLineNum = 48;BA.debugLine="b.Close";
_b.Close();
 }
};
 //BA.debugLineNum = 50;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 52;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 c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 6;BA.debugLine="Dim Regresar As Button";
_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Dim b As Cursor";
_b = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 8;BA.debugLine="Dim regalo As String";
_regalo = "";
 //BA.debugLineNum = 9;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim borra As Button";
_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Dim Existe As String";
_existe = "";
 //BA.debugLineNum = 14;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 17;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 18;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 19;BA.debugLine="End Sub";
return null;
}
public String  _regresar_click() throws Exception{
 //BA.debugLineNum = 91;BA.debugLine="Sub Regresar_Click";
 //BA.debugLineNum = 93;BA.debugLine="B4XPages.ShowPage(\"\")";
_b4xpages._showpage /*String*/ (ba,"");
 //BA.debugLineNum = 94;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;
}
}
