package SHARK2.keymon.com.mx;


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

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

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
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 _skmt = null;
public anywheresoftware.b4a.sql.SQL _rkmt = null;
public String _safepath = "";
public String _fechahoy = "";
public boolean _skmtattached = false;
public b4a.example.dateutils _dateutils = null;
public SHARK2.keymon.com.mx.main _main = null;
public SHARK2.keymon.com.mx.appupdater _appupdater = null;
public SHARK2.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public SHARK2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public SHARK2.keymon.com.mx.notificationservice _notificationservice = null;
public SHARK2.keymon.com.mx.pendientes _pendientes = null;
public SHARK2.keymon.com.mx.starter _starter = null;
public SHARK2.keymon.com.mx.subs _subs = null;
public SHARK2.keymon.com.mx.tracker _tracker = null;
public SHARK2.keymon.com.mx.newinst2 _newinst2 = null;
public SHARK2.keymon.com.mx.b4xpages _b4xpages = null;
public SHARK2.keymon.com.mx.b4xcollections _b4xcollections = null;
public SHARK2.keymon.com.mx.httputils2service _httputils2service = null;
public SHARK2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _respaldapedido(SHARK2.keymon.com.mx.c_respaldodiario __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "respaldapedido", false))
	 {return ((String) Debug.delegate(ba, "respaldapedido", null));}
String _inicio = "";
RDebugUtils.currentLine=22413312;
 //BA.debugLineNum = 22413312;BA.debugLine="Sub respaldaPedido";
RDebugUtils.currentLine=22413313;
 //BA.debugLineNum = 22413313;BA.debugLine="Private inicio As String = DateTime.Now";
_inicio = BA.NumberToString(__c.DateTime.getNow());
RDebugUtils.currentLine=22413314;
 //BA.debugLineNum = 22413314;BA.debugLine="Log(\"copiando pedidos ...\")";
__c.LogImpl("522413314","copiando pedidos ...",0);
RDebugUtils.currentLine=22413315;
 //BA.debugLineNum = 22413315;BA.debugLine="rkmt.BeginTransaction";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .BeginTransaction();
RDebugUtils.currentLine=22413316;
 //BA.debugLineNum = 22413316;BA.debugLine="rkmt.ExecNonQuery($\"delete from pedidos where sub";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedidos where substr(pe_fecha, 1, 10) = '"+__c.SmartStringFormatter("",(Object)(__ref._fechahoy /*String*/ ))+"'"));
RDebugUtils.currentLine=22413318;
 //BA.debugLineNum = 22413318;BA.debugLine="rkmt.TransactionSuccessful 'Si no se pone Transac";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .TransactionSuccessful();
RDebugUtils.currentLine=22413319;
 //BA.debugLineNum = 22413319;BA.debugLine="rkmt.EndTransaction";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .EndTransaction();
RDebugUtils.currentLine=22413321;
 //BA.debugLineNum = 22413321;BA.debugLine="End Sub";
return "";
}
public String  _respaldainventarios(SHARK2.keymon.com.mx.c_respaldodiario __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "respaldainventarios", false))
	 {return ((String) Debug.delegate(ba, "respaldainventarios", null));}
String _inicio = "";
RDebugUtils.currentLine=22478848;
 //BA.debugLineNum = 22478848;BA.debugLine="Sub respaldaInventarios";
RDebugUtils.currentLine=22478850;
 //BA.debugLineNum = 22478850;BA.debugLine="Private inicio As String = DateTime.Now";
_inicio = BA.NumberToString(__c.DateTime.getNow());
RDebugUtils.currentLine=22478853;
 //BA.debugLineNum = 22478853;BA.debugLine="rkmt.BeginTransaction";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .BeginTransaction();
RDebugUtils.currentLine=22478854;
 //BA.debugLineNum = 22478854;BA.debugLine="rkmt.ExecNonQuery($\"delete from inventarios where";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from inventarios where fecha = '"+__c.SmartStringFormatter("",(Object)(__ref._fechahoy /*String*/ ))+"'"));
RDebugUtils.currentLine=22478856;
 //BA.debugLineNum = 22478856;BA.debugLine="rkmt.TransactionSuccessful 'Si no se pone Transac";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .TransactionSuccessful();
RDebugUtils.currentLine=22478857;
 //BA.debugLineNum = 22478857;BA.debugLine="rkmt.EndTransaction";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .EndTransaction();
RDebugUtils.currentLine=22478859;
 //BA.debugLineNum = 22478859;BA.debugLine="End Sub";
return "";
}
public String  _respaldapaquetes(SHARK2.keymon.com.mx.c_respaldodiario __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "respaldapaquetes", false))
	 {return ((String) Debug.delegate(ba, "respaldapaquetes", null));}
String _inicio = "";
RDebugUtils.currentLine=22544384;
 //BA.debugLineNum = 22544384;BA.debugLine="Sub respaldaPaquetes";
RDebugUtils.currentLine=22544385;
 //BA.debugLineNum = 22544385;BA.debugLine="Private inicio As String = DateTime.Now";
_inicio = BA.NumberToString(__c.DateTime.getNow());
RDebugUtils.currentLine=22544387;
 //BA.debugLineNum = 22544387;BA.debugLine="rkmt.BeginTransaction";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .BeginTransaction();
RDebugUtils.currentLine=22544389;
 //BA.debugLineNum = 22544389;BA.debugLine="rkmt.ExecNonQuery($\"delete from paquetes where fe";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from paquetes where fecha = '"+__c.SmartStringFormatter("",(Object)(__ref._fechahoy /*String*/ ))+"'"));
RDebugUtils.currentLine=22544390;
 //BA.debugLineNum = 22544390;BA.debugLine="rkmt.ExecNonQuery($\"insert into paquetes (cat_dp_";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("insert into paquetes (cat_dp_precio_simptos, cat_dp_precio, cat_dp_almacen, cat_dp_id, cat_dp_idprod, cat_dp_tipo, cat_dp_pzas, cat_dp_usuario, cat_dp_fecha, cat_dp_regalo, cat_dp_clasif, fecha) select cat_dp_precio_simptos, cat_dp_precio, cat_dp_almacen, cat_dp_id, cat_dp_idprod, cat_dp_tipo, cat_dp_pzas, cat_dp_usuario, cat_dp_fecha, cat_dp_regalo, cat_dp_clasif, '"+__c.SmartStringFormatter("",(Object)(__ref._fechahoy /*String*/ ))+"' as fecha from skmt1.cat_detalles_paq"));
RDebugUtils.currentLine=22544391;
 //BA.debugLineNum = 22544391;BA.debugLine="rkmt.TransactionSuccessful 'Si no se pone Transac";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .TransactionSuccessful();
RDebugUtils.currentLine=22544392;
 //BA.debugLineNum = 22544392;BA.debugLine="rkmt.EndTransaction";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .EndTransaction();
RDebugUtils.currentLine=22544394;
 //BA.debugLineNum = 22544394;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(SHARK2.keymon.com.mx.c_respaldodiario __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
String _dirp = "";
String _dir = "";
String[] _name = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=22216704;
 //BA.debugLineNum = 22216704;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=22216706;
 //BA.debugLineNum = 22216706;BA.debugLine="Dim rp As RuntimePermissions";
_rp = new anywheresoftware.b4a.objects.RuntimePermissions();
RDebugUtils.currentLine=22216707;
 //BA.debugLineNum = 22216707;BA.debugLine="Dim Dirp As String = File.DirInternal";
_dirp = __c.File.getDirInternal();
RDebugUtils.currentLine=22216708;
 //BA.debugLineNum = 22216708;BA.debugLine="Dim Dir As String";
_dir = "";
RDebugUtils.currentLine=22216710;
 //BA.debugLineNum = 22216710;BA.debugLine="Try";
try {RDebugUtils.currentLine=22216711;
 //BA.debugLineNum = 22216711;BA.debugLine="File.MakeDir(Dirp,\"/kmts\")";
__c.File.MakeDir(_dirp,"/kmts");
RDebugUtils.currentLine=22216712;
 //BA.debugLineNum = 22216712;BA.debugLine="Dir = \"/kmts\"";
_dir = "/kmts";
 } 
       catch (Exception e8) {
			ba.setLastException(e8);RDebugUtils.currentLine=22216715;
 //BA.debugLineNum = 22216715;BA.debugLine="Dir = \"\"";
_dir = "";
 };
RDebugUtils.currentLine=22216719;
 //BA.debugLineNum = 22216719;BA.debugLine="safePath = Dirp & Dir";
__ref._safepath /*String*/  = _dirp+_dir;
RDebugUtils.currentLine=22216721;
 //BA.debugLineNum = 22216721;BA.debugLine="If Not(File.IsDirectory(Dirp, Dir)) Then safePath";
if (__c.Not(__c.File.IsDirectory(_dirp,_dir))) { 
__ref._safepath /*String*/  = _rp.GetSafeDirDefaultExternal("kmts");};
RDebugUtils.currentLine=22216722;
 //BA.debugLineNum = 22216722;BA.debugLine="Private name() As String = Regex.split(\" \", Appli";
_name = __c.Regex.Split(" ",__c.Application.getLabelName());
RDebugUtils.currentLine=22216723;
 //BA.debugLineNum = 22216723;BA.debugLine="rkmt.Initialize(safePath,$\"${name(0)}.rkmt.km\"$,";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(__ref._safepath /*String*/ ,(""+__c.SmartStringFormatter("",(Object)(_name[(int) (0)]))+".rkmt.km"),__c.True);
RDebugUtils.currentLine=22216724;
 //BA.debugLineNum = 22216724;BA.debugLine="skmt.Initialize(File.DirInternal,\"kmt.db\", False)";
__ref._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(__c.File.getDirInternal(),"kmt.db",__c.False);
RDebugUtils.currentLine=22216725;
 //BA.debugLineNum = 22216725;BA.debugLine="rkmt.ExecNonQuery($\"create table if not exists pe";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("create table if not exists pedidos (pe_folio NUMERIC, pe_desc NUMERIC, pe_costo_sin TEXT, pe_ruta TEXT, pe_cedis TEXT, pe_costo_tot NUMERIC, pe_costou NUMERIC, pe_cant NUMERIC, pe_pronombre TEXT, pe_proid TEXT, pe_cliente TEXT, pe_fecha TEXT, pe_usuario TEXT)"));
RDebugUtils.currentLine=22216726;
 //BA.debugLineNum = 22216726;BA.debugLine="agregaColumna2(rkmt,\"pedidos\",\"pe_cantc\",\"text\")";
__ref._agregacolumna2 /*String*/ (null,__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ ,"pedidos","pe_cantc","text");
RDebugUtils.currentLine=22216727;
 //BA.debugLineNum = 22216727;BA.debugLine="agregaColumna2(rkmt,\"pedidos\",\"pe_bcajas\",\"text\")";
__ref._agregacolumna2 /*String*/ (null,__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ ,"pedidos","pe_bcajas","text");
RDebugUtils.currentLine=22216728;
 //BA.debugLineNum = 22216728;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=22216729;
 //BA.debugLineNum = 22216729;BA.debugLine="Private c As Cursor = rkmt.ExecQuery($\"SELECT CO";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT COUNT(*) AS fCol FROM pragma_table_info('pedidos') WHERE name='pe_envio_ok'"))));
RDebugUtils.currentLine=22216730;
 //BA.debugLineNum = 22216730;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=22216731;
 //BA.debugLineNum = 22216731;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22216732;
 //BA.debugLineNum = 22216732;BA.debugLine="rkmt.ExecNonQuery($\"ALTER TABLE pedidos ADD COL";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE pedidos ADD COLUMN pe_envio_ok INT"));
RDebugUtils.currentLine=22216733;
 //BA.debugLineNum = 22216733;BA.debugLine="Log($\"Columna \"pe_envio_ok INT\", agregada a \"pe";
__c.LogImpl("522216733",("Columna \"pe_envio_ok INT\", agregada a \"pedidos}\"."),0);
 };
 } 
       catch (Exception e26) {
			ba.setLastException(e26);RDebugUtils.currentLine=22216736;
 //BA.debugLineNum = 22216736;BA.debugLine="Try";
try {RDebugUtils.currentLine=22216737;
 //BA.debugLineNum = 22216737;BA.debugLine="rkmt.ExecNonQuery($\"ALTER TABLE pedidos ADD COL";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE pedidos ADD COLUMN pe_envio_ok INT"));
RDebugUtils.currentLine=22216738;
 //BA.debugLineNum = 22216738;BA.debugLine="Log($\"Columna \"pe_envio_ok INT\", agregada a \"pe";
__c.LogImpl("522216738",("Columna \"pe_envio_ok INT\", agregada a \"pedidos\".."),0);
 } 
       catch (Exception e30) {
			ba.setLastException(e30);RDebugUtils.currentLine=22216740;
 //BA.debugLineNum = 22216740;BA.debugLine="Log(LastException)";
__c.LogImpl("522216740",BA.ObjectToString(__c.LastException(ba)),0);
 };
 };
RDebugUtils.currentLine=22216743;
 //BA.debugLineNum = 22216743;BA.debugLine="rkmt.ExecNonQuery($\"create table if not exists in";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("create table if not exists inventarios (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_tipoprod2 TEXT, fecha TEXT)"));
RDebugUtils.currentLine=22216744;
 //BA.debugLineNum = 22216744;BA.debugLine="rkmt.ExecNonQuery($\"create table if not exists pa";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("create table if not exists paquetes (cat_dp_precio_simptos TEXT, cat_dp_precio TEXT, cat_dp_almacen TEXT, cat_dp_id TEXT, cat_dp_idprod TEXT, cat_dp_tipo TEXT, cat_dp_pzas TEXT, cat_dp_usuario TEXT, cat_dp_fecha TEXT, cat_dp_regalo TEXT, cat_dp_clasif TEXT, fecha TEXT)"));
RDebugUtils.currentLine=22216745;
 //BA.debugLineNum = 22216745;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22216746;
 //BA.debugLineNum = 22216746;BA.debugLine="fechaHoy = DateTime.Date(DateTime.Now)";
__ref._fechahoy /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22216747;
 //BA.debugLineNum = 22216747;BA.debugLine="revisaSkmtAttached";
__ref._revisaskmtattached /*String*/ (null);
RDebugUtils.currentLine=22216748;
 //BA.debugLineNum = 22216748;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=22216749;
 //BA.debugLineNum = 22216749;BA.debugLine="End Sub";
return null;
}
public String  _vacuum(SHARK2.keymon.com.mx.c_respaldodiario __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "vacuum", false))
	 {return ((String) Debug.delegate(ba, "vacuum", null));}
RDebugUtils.currentLine=22609920;
 //BA.debugLineNum = 22609920;BA.debugLine="Sub vacuum";
RDebugUtils.currentLine=22609921;
 //BA.debugLineNum = 22609921;BA.debugLine="Log(\"Vacuum\")";
__c.LogImpl("522609921","Vacuum",0);
RDebugUtils.currentLine=22609922;
 //BA.debugLineNum = 22609922;BA.debugLine="rkmt.ExecNonQuery(\"vacuum;\")";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("vacuum;");
RDebugUtils.currentLine=22609923;
 //BA.debugLineNum = 22609923;BA.debugLine="End Sub";
return "";
}
public String  _agregacolumna(SHARK2.keymon.com.mx.c_respaldodiario __ref,String _tabla,String _columna,String _tipo) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "agregacolumna", false))
	 {return ((String) Debug.delegate(ba, "agregacolumna", new Object[] {_tabla,_columna,_tipo}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=22675456;
 //BA.debugLineNum = 22675456;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
RDebugUtils.currentLine=22675457;
 //BA.debugLineNum = 22675457;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=22675458;
 //BA.debugLineNum = 22675458;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT COUNT(*) AS fCol FROM pragma_table_info('"+__c.SmartStringFormatter("",(Object)(_tabla))+"') WHERE name='"+__c.SmartStringFormatter("",(Object)(_columna))+"'"))));
RDebugUtils.currentLine=22675459;
 //BA.debugLineNum = 22675459;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=22675460;
 //BA.debugLineNum = 22675460;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22675461;
 //BA.debugLineNum = 22675461;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
_b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+__c.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=22675462;
 //BA.debugLineNum = 22675462;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
__c.LogImpl("522675462",("Columna \""+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+__c.SmartStringFormatter("",(Object)(_tabla))+"\"."),0);
 };
 } 
       catch (Exception e9) {
			ba.setLastException(e9);RDebugUtils.currentLine=22675465;
 //BA.debugLineNum = 22675465;BA.debugLine="Try";
try {RDebugUtils.currentLine=22675466;
 //BA.debugLineNum = 22675466;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
_b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+__c.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=22675467;
 //BA.debugLineNum = 22675467;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
__c.LogImpl("522675467",("Columna \""+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+__c.SmartStringFormatter("",(Object)(_tabla))+"\".."),0);
 } 
       catch (Exception e13) {
			ba.setLastException(e13);RDebugUtils.currentLine=22675469;
 //BA.debugLineNum = 22675469;BA.debugLine="Log(LastException)";
__c.LogImpl("522675469",BA.ObjectToString(__c.LastException(ba)),0);
 };
 };
RDebugUtils.currentLine=22675472;
 //BA.debugLineNum = 22675472;BA.debugLine="End Sub";
return "";
}
public String  _agregacolumna2(SHARK2.keymon.com.mx.c_respaldodiario __ref,anywheresoftware.b4a.sql.SQL _db,String _tabla,String _columna,String _tipo) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "agregacolumna2", false))
	 {return ((String) Debug.delegate(ba, "agregacolumna2", new Object[] {_db,_tabla,_columna,_tipo}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=22740992;
 //BA.debugLineNum = 22740992;BA.debugLine="Sub agregaColumna2(db As SQL, tabla As String, col";
RDebugUtils.currentLine=22740993;
 //BA.debugLineNum = 22740993;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=22740994;
 //BA.debugLineNum = 22740994;BA.debugLine="Private c As Cursor = db.ExecQuery($\"SELECT COUN";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_db.ExecQuery(("SELECT COUNT(*) AS fCol FROM pragma_table_info('"+__c.SmartStringFormatter("",(Object)(_tabla))+"') WHERE name='"+__c.SmartStringFormatter("",(Object)(_columna))+"'"))));
RDebugUtils.currentLine=22740995;
 //BA.debugLineNum = 22740995;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=22740996;
 //BA.debugLineNum = 22740996;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22740997;
 //BA.debugLineNum = 22740997;BA.debugLine="db.ExecNonQuery($\"ALTER TABLE ${tabla} ADD COLU";
_db.ExecNonQuery(("ALTER TABLE "+__c.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=22740998;
 //BA.debugLineNum = 22740998;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
__c.LogImpl("522740998",("Columna \""+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+__c.SmartStringFormatter("",(Object)(_tabla))+"\"."),0);
 };
 } 
       catch (Exception e9) {
			ba.setLastException(e9);RDebugUtils.currentLine=22741001;
 //BA.debugLineNum = 22741001;BA.debugLine="Try";
try {RDebugUtils.currentLine=22741002;
 //BA.debugLineNum = 22741002;BA.debugLine="db.ExecNonQuery($\"ALTER TABLE ${tabla} ADD COLU";
_db.ExecNonQuery(("ALTER TABLE "+__c.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=22741003;
 //BA.debugLineNum = 22741003;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
__c.LogImpl("522741003",("Columna \""+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+__c.SmartStringFormatter("",(Object)(_tabla))+"\".."),0);
 } 
       catch (Exception e13) {
			ba.setLastException(e13);RDebugUtils.currentLine=22741005;
 //BA.debugLineNum = 22741005;BA.debugLine="Log(LastException)";
__c.LogImpl("522741005",BA.ObjectToString(__c.LastException(ba)),0);
 };
 };
RDebugUtils.currentLine=22741008;
 //BA.debugLineNum = 22741008;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(SHARK2.keymon.com.mx.c_respaldodiario __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=22282240;
 //BA.debugLineNum = 22282240;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=22282241;
 //BA.debugLineNum = 22282241;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=22282243;
 //BA.debugLineNum = 22282243;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(SHARK2.keymon.com.mx.c_respaldodiario __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
RDebugUtils.currentLine=22151168;
 //BA.debugLineNum = 22151168;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=22151169;
 //BA.debugLineNum = 22151169;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=22151170;
 //BA.debugLineNum = 22151170;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=22151171;
 //BA.debugLineNum = 22151171;BA.debugLine="Dim skmt, rkmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
_rkmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=22151173;
 //BA.debugLineNum = 22151173;BA.debugLine="Dim safePath As String";
_safepath = "";
RDebugUtils.currentLine=22151174;
 //BA.debugLineNum = 22151174;BA.debugLine="Dim fechaHoy As String";
_fechahoy = "";
RDebugUtils.currentLine=22151175;
 //BA.debugLineNum = 22151175;BA.debugLine="Dim skmtAttached As Boolean = False";
_skmtattached = __c.False;
RDebugUtils.currentLine=22151176;
 //BA.debugLineNum = 22151176;BA.debugLine="End Sub";
return "";
}
public String  _revisaskmtattached(SHARK2.keymon.com.mx.c_respaldodiario __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_respaldodiario";
if (Debug.shouldDelegate(ba, "revisaskmtattached", false))
	 {return ((String) Debug.delegate(ba, "revisaskmtattached", null));}
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _rs = null;
RDebugUtils.currentLine=22347776;
 //BA.debugLineNum = 22347776;BA.debugLine="Sub revisaSkmtAttached";
RDebugUtils.currentLine=22347777;
 //BA.debugLineNum = 22347777;BA.debugLine="skmtAttached = False";
__ref._skmtattached /*boolean*/  = __c.False;
RDebugUtils.currentLine=22347778;
 //BA.debugLineNum = 22347778;BA.debugLine="Dim rs As ResultSet = rkmt.ExecQuery(\"SELECT * FR";
_rs = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_rs = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT * FROM pragma_database_list")));
RDebugUtils.currentLine=22347779;
 //BA.debugLineNum = 22347779;BA.debugLine="Do While rs.NextRow 'Revisamos si esta montada \"k";
while (_rs.NextRow()) {
RDebugUtils.currentLine=22347780;
 //BA.debugLineNum = 22347780;BA.debugLine="If rs.GetString(\"name\") = \"skmt1\" Then skmtAttac";
if ((_rs.GetString("name")).equals("skmt1")) { 
__ref._skmtattached /*boolean*/  = __c.True;};
 }
;
RDebugUtils.currentLine=22347782;
 //BA.debugLineNum = 22347782;BA.debugLine="If Not(skmtAttached) Then";
if (__c.Not(__ref._skmtattached /*boolean*/ )) { 
RDebugUtils.currentLine=22347783;
 //BA.debugLineNum = 22347783;BA.debugLine="rkmt.ExecNonQuery($\"attach database '${File.Comb";
__ref._rkmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("attach database '"+__c.SmartStringFormatter("",(Object)(__c.File.Combine(__c.File.getDirInternal(),"kmt.db")))+"' as skmt1;"));
RDebugUtils.currentLine=22347784;
 //BA.debugLineNum = 22347784;BA.debugLine="skmtAttached = True";
__ref._skmtattached /*boolean*/  = __c.True;
 };
RDebugUtils.currentLine=22347786;
 //BA.debugLineNum = 22347786;BA.debugLine="End Sub";
return "";
}
}