package medicomed.keymon.com.mx;


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

public class c_ticketsdia 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.c_ticketsdia");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", medicomed.keymon.com.mx.c_ticketsdia.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.objects.PanelWrapper _p_ticketsdia = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
public String _ruta = "";
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_noventa = null;
public String _nombre_boton = "";
public String _stime = "";
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 boolean  _activity_keypress(int _key) throws Exception{
 //BA.debugLineNum = 83;BA.debugLine="Sub Activity_KeyPress (key As Int) As Boolean";
 //BA.debugLineNum = 85;BA.debugLine="If key=KeyCodes.KEYCODE_BACK Then";
if (_key==__c.KeyCodes.KEYCODE_BACK) { 
 //BA.debugLineNum = 87;BA.debugLine="B4XPages.ShowPage(\"principal\")";
_b4xpages._showpage /*String*/ (ba,"principal");
 };
 //BA.debugLineNum = 91;BA.debugLine="Return False";
if (true) return __c.False;
 //BA.debugLineNum = 92;BA.debugLine="End Sub";
return false;
}
public String  _b_noventa_click() throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 114;BA.debugLine="Sub b_noventa_Click";
 //BA.debugLineNum = 115;BA.debugLine="If nombre_boton = \"NOVENTA\" Then";
if ((_nombre_boton).equals("NOVENTA")) { 
 //BA.debugLineNum = 116;BA.debugLine="nombre_boton = \"VENTA\"";
_nombre_boton = "VENTA";
 //BA.debugLineNum = 117;BA.debugLine="b_noventa.Text =\"VENTA\"";
_b_noventa.setText(BA.ObjectToCharSequence("VENTA"));
 //BA.debugLineNum = 118;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select NV_CL";
_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*/ .ExecQuery("select NV_CLIENTE,NV_MOTIVO,NV_COMM, (select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = NV_CLIENTE ) as NOMBRE FROM NOVENTA ORDER BY NV_CLIENTE asc")));
 //BA.debugLineNum = 119;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 120;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 121;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 = 122;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 123;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 124;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 125;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 126;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 127;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 128;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 129;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 130;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 131;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"NV_CLIENTE\"";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("NV_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"  Motivo #"+_c.GetString("NV_MOTIVO")+" Comentario $"+_c.GetString("NV_COMM")));
 }
};
 };
 }else {
 //BA.debugLineNum = 135;BA.debugLine="nombre_boton = \"NOVENTA\"";
_nombre_boton = "NOVENTA";
 //BA.debugLineNum = 136;BA.debugLine="b_noventa.Text =\"NO VENTA\"";
_b_noventa.setText(BA.ObjectToCharSequence("NO VENTA"));
 //BA.debugLineNum = 137;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PC_CL";
_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*/ .ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")));
 //BA.debugLineNum = 138;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 140;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 141;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step26 = 1;
final int limit26 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit26 ;_i = _i + step26 ) {
 //BA.debugLineNum = 142;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 143;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 144;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 145;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 146;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 147;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 148;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 149;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 150;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 151;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE\"";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"   Cantidad #"+_c.GetString("PC_NOART")+" SubTotal $"+_c.GetString("PC_MONTO")));
 }
};
 };
 //BA.debugLineNum = 154;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 156;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
int _noarticulos = 0;
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _x = null;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 51;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 52;BA.debugLine="nombre_boton = \"NOVENTA\"";
_nombre_boton = "NOVENTA";
 //BA.debugLineNum = 53;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PC_CLI";
_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*/ .ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente UNION select CAT_CL_NOMBRE from kmt_info where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")));
 //BA.debugLineNum = 54;BA.debugLine="Dim noArticulos As Int = 0";
_noarticulos = (int) (0);
 //BA.debugLineNum = 56;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 57;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 58;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 = 59;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 60;BA.debugLine="Dim x As Cursor = B4XPages.MainPage.skmt.ExecQu";
_x = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_x = (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 sum(PE_CANT) as PC_NOART from PEDIDO where PE_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_CLIENTE")))+"' AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)"))));
 //BA.debugLineNum = 61;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
 //BA.debugLineNum = 62;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
 //BA.debugLineNum = 64;BA.debugLine="noArticulos = x.GetString(\"PC_NOART\")";
_noarticulos = (int)(Double.parseDouble(_x.GetString("PC_NOART")));
 };
 //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.Black";
_label1.setTextColor(__c.Colors.Black);
 //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 = 13";
_label2.setTextSize((float) (13));
 //BA.debugLineNum = 73;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 74;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE\")";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"   Cantidad #"+BA.NumberToString(_noarticulos)+" SubTotal $"+_c.GetString("PC_MONTO")));
 }
};
 };
 //BA.debugLineNum = 77;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 78;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 = 21;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 22;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 24;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 25;BA.debugLine="Root.LoadLayout(\"ticketsdia\")";
_root.LoadLayout("ticketsdia",ba);
 //BA.debugLineNum = 26;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(_ruta,"kmt.db")==__c.False) { 
 //BA.debugLineNum = 27;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",_ruta,"kmt.db");
 };
 //BA.debugLineNum = 29;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select PC_C";
_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*/ .ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")));
 //BA.debugLineNum = 32;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 33;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 34;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 = 35;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 36;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 37;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 38;BA.debugLine="label1.TextSize = 10";
_label1.setTextSize((float) (10));
 //BA.debugLineNum = 39;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 40;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 41;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 42;BA.debugLine="label2.TextSize = 13";
_label2.setTextSize((float) (13));
 //BA.debugLineNum = 43;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 44;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE\")";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence("Cantidad #"+_c.GetString("PC_NOART")+" SubTotal $"+_c.GetString("PC_MONTO")));
 }
};
 };
 //BA.debugLineNum = 47;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="Private p_ticketsdia As Panel";
_p_ticketsdia = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 6;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Dim S As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 8;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 9;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Dim b_noventa As Button";
_b_noventa = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Dim nombre_boton As String";
_nombre_boton = "";
 //BA.debugLineNum = 12;BA.debugLine="Dim STIME As String";
_stime = "";
 //BA.debugLineNum = 13;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 16;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 17;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 18;BA.debugLine="End Sub";
return null;
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 93;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 94;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUENTAA");
 //BA.debugLineNum = 95;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*medicomed.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 = 96;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 97;BA.debugLine="STIME=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 99;BA.debugLine="Starter.pre_viejo = Subs.traeTotalClientepreventa";
_starter._pre_viejo /*float*/  = (float) (_subs._traetotalclientepreventaparacredito /*double*/ (ba,BA.ObjectToString(_value)));
 //BA.debugLineNum = 100;BA.debugLine="s=B4XPages.MainPage.skmt.ExecQuery(\"SELECT COUNT(";
_s = (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 COUNT(*) AS CUANTOS FROM HIST_STAY_STORE WHERE HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)")));
 //BA.debugLineNum = 101;BA.debugLine="s.Position = 0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 102;BA.debugLine="If s.GetString(\"CUANTOS\") = 1 Then";
if ((_s.GetString("CUANTOS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 103;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*medicomed.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 = 105;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*medicomed.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 = 106;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*medicomed.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 = 108;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 109;BA.debugLine="Subs.guardaClienteHoraInicio(Value)";
_subs._guardaclientehorainicio /*String*/ (ba,BA.ObjectToString(_value));
 //BA.debugLineNum = 110;BA.debugLine="B4XPages.MainPage.cliente.venimosDeTicketsDia = T";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*medicomed.keymon.com.mx.c_cliente*/ ._venimosdeticketsdia /*boolean*/  = __c.True;
 //BA.debugLineNum = 111;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 112;BA.debugLine="End Sub";
return "";
}
public String  _p_ticketsdia_click() throws Exception{
 //BA.debugLineNum = 158;BA.debugLine="Private Sub p_ticketsdia_Click";
 //BA.debugLineNum = 160;BA.debugLine="End Sub";
return "";
}
public String  _regresar_click() throws Exception{
 //BA.debugLineNum = 80;BA.debugLine="Sub Regresar_Click";
 //BA.debugLineNum = 81;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 82;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;
}
}
