package SHARK2.keymon.com.mx;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class c_respaldodiario_subs_0 {


public static RemoteObject  _agregacolumna(RemoteObject __ref,RemoteObject _tabla,RemoteObject _columna,RemoteObject _tipo) throws Exception{
try {
		Debug.PushSubsStack("agregaColumna (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,128);
if (RapidSub.canDelegate("agregacolumna")) { return __ref.runUserSub(false, "c_respaldodiario","agregacolumna", __ref, _tabla, _columna, _tipo);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
Debug.locals.put("tabla", _tabla);
Debug.locals.put("columna", _columna);
Debug.locals.put("tipo", _tipo);
 BA.debugLineNum = 128;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
Debug.ShouldStop(-2147483648);
 BA.debugLineNum = 129;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
Debug.ShouldStop(1);
try { BA.debugLineNum = 130;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
Debug.ShouldStop(2);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), c_respaldodiario._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("SELECT COUNT(*) AS fCol FROM pragma_table_info('"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("') WHERE name='"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 131;BA.debugLine="c.Position = 0";
Debug.ShouldStop(4);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 132;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
Debug.ShouldStop(8);
if (RemoteObject.solveBoolean("=",_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fCol"))),BA.NumberToString(0))) { 
 BA.debugLineNum = 133;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
Debug.ShouldStop(16);
c_respaldodiario._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("ALTER TABLE "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable(" ADD COLUMN "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 134;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
Debug.ShouldStop(32);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522675462",(RemoteObject.concat(RemoteObject.createImmutable("Columna \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("\", agregada a \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("\"."))),0);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e9) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e9.toString()); BA.debugLineNum = 137;BA.debugLine="Try";
Debug.ShouldStop(256);
try { BA.debugLineNum = 138;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
Debug.ShouldStop(512);
c_respaldodiario._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("ALTER TABLE "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable(" ADD COLUMN "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 139;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
Debug.ShouldStop(1024);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522675467",(RemoteObject.concat(RemoteObject.createImmutable("Columna \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("\", agregada a \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("\".."))),0);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e13) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e13.toString()); BA.debugLineNum = 141;BA.debugLine="Log(LastException)";
Debug.ShouldStop(4096);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522675469",BA.ObjectToString(c_respaldodiario.__c.runMethod(false,"LastException",__ref.getField(false, "ba"))),0);
 };
 };
 BA.debugLineNum = 144;BA.debugLine="End Sub";
Debug.ShouldStop(32768);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _agregacolumna2(RemoteObject __ref,RemoteObject _db,RemoteObject _tabla,RemoteObject _columna,RemoteObject _tipo) throws Exception{
try {
		Debug.PushSubsStack("agregaColumna2 (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,146);
if (RapidSub.canDelegate("agregacolumna2")) { return __ref.runUserSub(false, "c_respaldodiario","agregacolumna2", __ref, _db, _tabla, _columna, _tipo);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
Debug.locals.put("db", _db);
Debug.locals.put("tabla", _tabla);
Debug.locals.put("columna", _columna);
Debug.locals.put("tipo", _tipo);
 BA.debugLineNum = 146;BA.debugLine="Sub agregaColumna2(db As SQL, tabla As String, col";
Debug.ShouldStop(131072);
 BA.debugLineNum = 147;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
Debug.ShouldStop(262144);
try { BA.debugLineNum = 148;BA.debugLine="Private c As Cursor = db.ExecQuery($\"SELECT COUN";
Debug.ShouldStop(524288);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), _db.runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("SELECT COUNT(*) AS fCol FROM pragma_table_info('"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("') WHERE name='"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 149;BA.debugLine="c.Position = 0";
Debug.ShouldStop(1048576);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 150;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
Debug.ShouldStop(2097152);
if (RemoteObject.solveBoolean("=",_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fCol"))),BA.NumberToString(0))) { 
 BA.debugLineNum = 151;BA.debugLine="db.ExecNonQuery($\"ALTER TABLE ${tabla} ADD COLU";
Debug.ShouldStop(4194304);
_db.runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("ALTER TABLE "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable(" ADD COLUMN "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 152;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
Debug.ShouldStop(8388608);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522740998",(RemoteObject.concat(RemoteObject.createImmutable("Columna \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("\", agregada a \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("\"."))),0);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e9) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e9.toString()); BA.debugLineNum = 155;BA.debugLine="Try";
Debug.ShouldStop(67108864);
try { BA.debugLineNum = 156;BA.debugLine="db.ExecNonQuery($\"ALTER TABLE ${tabla} ADD COLU";
Debug.ShouldStop(134217728);
_db.runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("ALTER TABLE "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable(" ADD COLUMN "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 157;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
Debug.ShouldStop(268435456);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522741003",(RemoteObject.concat(RemoteObject.createImmutable("Columna \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("\", agregada a \""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("\".."))),0);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e13) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e13.toString()); BA.debugLineNum = 159;BA.debugLine="Log(LastException)";
Debug.ShouldStop(1073741824);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522741005",BA.ObjectToString(c_respaldodiario.__c.runMethod(false,"LastException",__ref.getField(false, "ba"))),0);
 };
 };
 BA.debugLineNum = 162;BA.debugLine="End Sub";
Debug.ShouldStop(2);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _b4xpage_created(RemoteObject __ref,RemoteObject _root1) throws Exception{
try {
		Debug.PushSubsStack("B4XPage_Created (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,60);
if (RapidSub.canDelegate("b4xpage_created")) { return __ref.runUserSub(false, "c_respaldodiario","b4xpage_created", __ref, _root1);}
Debug.locals.put("Root1", _root1);
 BA.debugLineNum = 60;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 61;BA.debugLine="Root = Root1";
Debug.ShouldStop(268435456);
__ref.setField ("_root" /*RemoteObject*/ ,_root1);
 BA.debugLineNum = 63;BA.debugLine="End Sub";
Debug.ShouldStop(1073741824);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _class_globals(RemoteObject __ref) throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
c_respaldodiario._root = RemoteObject.createNew ("anywheresoftware.b4a.objects.B4XViewWrapper");__ref.setField("_root",c_respaldodiario._root);
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
c_respaldodiario._xui = RemoteObject.createNew ("anywheresoftware.b4a.objects.B4XViewWrapper.XUI");__ref.setField("_xui",c_respaldodiario._xui);
 //BA.debugLineNum = 4;BA.debugLine="Dim skmt, rkmt As SQL";
c_respaldodiario._skmt = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL");__ref.setField("_skmt",c_respaldodiario._skmt);
c_respaldodiario._rkmt = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL");__ref.setField("_rkmt",c_respaldodiario._rkmt);
 //BA.debugLineNum = 6;BA.debugLine="Dim safePath As String";
c_respaldodiario._safepath = RemoteObject.createImmutable("");__ref.setField("_safepath",c_respaldodiario._safepath);
 //BA.debugLineNum = 7;BA.debugLine="Dim fechaHoy As String";
c_respaldodiario._fechahoy = RemoteObject.createImmutable("");__ref.setField("_fechahoy",c_respaldodiario._fechahoy);
 //BA.debugLineNum = 8;BA.debugLine="Dim skmtAttached As Boolean = False";
c_respaldodiario._skmtattached = c_respaldodiario.__c.getField(true,"False");__ref.setField("_skmtattached",c_respaldodiario._skmtattached);
 //BA.debugLineNum = 9;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _initialize(RemoteObject __ref,RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("Initialize (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,12);
if (RapidSub.canDelegate("initialize")) { return __ref.runUserSub(false, "c_respaldodiario","initialize", __ref, _ba);}
__ref.runVoidMethodAndSync("innerInitializeHelper", _ba);
RemoteObject _rp = RemoteObject.declareNull("anywheresoftware.b4a.objects.RuntimePermissions");
RemoteObject _dirp = RemoteObject.createImmutable("");
RemoteObject _dir = RemoteObject.createImmutable("");
RemoteObject _name = null;
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
Debug.locals.put("ba", _ba);
 BA.debugLineNum = 12;BA.debugLine="Public Sub Initialize As Object";
Debug.ShouldStop(2048);
 BA.debugLineNum = 14;BA.debugLine="Dim rp As RuntimePermissions";
Debug.ShouldStop(8192);
_rp = RemoteObject.createNew ("anywheresoftware.b4a.objects.RuntimePermissions");Debug.locals.put("rp", _rp);
 BA.debugLineNum = 15;BA.debugLine="Dim Dirp As String = File.DirInternal";
Debug.ShouldStop(16384);
_dirp = c_respaldodiario.__c.getField(false,"File").runMethod(true,"getDirInternal");Debug.locals.put("Dirp", _dirp);Debug.locals.put("Dirp", _dirp);
 BA.debugLineNum = 16;BA.debugLine="Dim Dir As String";
Debug.ShouldStop(32768);
_dir = RemoteObject.createImmutable("");Debug.locals.put("Dir", _dir);
 BA.debugLineNum = 18;BA.debugLine="Try";
Debug.ShouldStop(131072);
try { BA.debugLineNum = 19;BA.debugLine="File.MakeDir(Dirp,\"/kmts\")";
Debug.ShouldStop(262144);
c_respaldodiario.__c.getField(false,"File").runVoidMethod ("MakeDir",(Object)(_dirp),(Object)(RemoteObject.createImmutable("/kmts")));
 BA.debugLineNum = 20;BA.debugLine="Dir = \"/kmts\"";
Debug.ShouldStop(524288);
_dir = BA.ObjectToString("/kmts");Debug.locals.put("Dir", _dir);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e8) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e8.toString()); BA.debugLineNum = 23;BA.debugLine="Dir = \"\"";
Debug.ShouldStop(4194304);
_dir = BA.ObjectToString("");Debug.locals.put("Dir", _dir);
 };
 BA.debugLineNum = 27;BA.debugLine="safePath = Dirp & Dir";
Debug.ShouldStop(67108864);
__ref.setField ("_safepath" /*RemoteObject*/ ,RemoteObject.concat(_dirp,_dir));
 BA.debugLineNum = 29;BA.debugLine="If Not(File.IsDirectory(Dirp, Dir)) Then safePath";
Debug.ShouldStop(268435456);
if (c_respaldodiario.__c.runMethod(true,"Not",(Object)(c_respaldodiario.__c.getField(false,"File").runMethod(true,"IsDirectory",(Object)(_dirp),(Object)(_dir)))).<Boolean>get().booleanValue()) { 
__ref.setField ("_safepath" /*RemoteObject*/ ,_rp.runMethod(true,"GetSafeDirDefaultExternal",(Object)(RemoteObject.createImmutable("kmts"))));};
 BA.debugLineNum = 30;BA.debugLine="Private name() As String = Regex.split(\" \", Appli";
Debug.ShouldStop(536870912);
_name = c_respaldodiario.__c.getField(false,"Regex").runMethod(false,"Split",(Object)(BA.ObjectToString(" ")),(Object)(c_respaldodiario.__c.getField(false,"Application").runMethod(true,"getLabelName")));Debug.locals.put("name", _name);Debug.locals.put("name", _name);
 BA.debugLineNum = 31;BA.debugLine="rkmt.Initialize(safePath,$\"${name(0)}.rkmt.km\"$,";
Debug.ShouldStop(1073741824);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("Initialize",(Object)(__ref.getField(true,"_safepath" /*RemoteObject*/ )),(Object)((RemoteObject.concat(RemoteObject.createImmutable(""),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_name.getArrayElement(true,BA.numberCast(int.class, 0))))),RemoteObject.createImmutable(".rkmt.km")))),(Object)(c_respaldodiario.__c.getField(true,"True")));
 BA.debugLineNum = 32;BA.debugLine="skmt.Initialize(File.DirInternal,\"kmt.db\", False)";
Debug.ShouldStop(-2147483648);
__ref.getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("Initialize",(Object)(c_respaldodiario.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(BA.ObjectToString("kmt.db")),(Object)(c_respaldodiario.__c.getField(true,"False")));
 BA.debugLineNum = 33;BA.debugLine="rkmt.ExecNonQuery($\"create table if not exists pe";
Debug.ShouldStop(1);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.createImmutable("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)"))));
 BA.debugLineNum = 34;BA.debugLine="agregaColumna2(rkmt,\"pedidos\",\"pe_cantc\",\"text\")";
Debug.ShouldStop(2);
__ref.runClassMethod (SHARK2.keymon.com.mx.c_respaldodiario.class, "_agregacolumna2" /*RemoteObject*/ ,(Object)(__ref.getField(false,"_rkmt" /*RemoteObject*/ )),(Object)(BA.ObjectToString("pedidos")),(Object)(BA.ObjectToString("pe_cantc")),(Object)(RemoteObject.createImmutable("text")));
 BA.debugLineNum = 35;BA.debugLine="agregaColumna2(rkmt,\"pedidos\",\"pe_bcajas\",\"text\")";
Debug.ShouldStop(4);
__ref.runClassMethod (SHARK2.keymon.com.mx.c_respaldodiario.class, "_agregacolumna2" /*RemoteObject*/ ,(Object)(__ref.getField(false,"_rkmt" /*RemoteObject*/ )),(Object)(BA.ObjectToString("pedidos")),(Object)(BA.ObjectToString("pe_bcajas")),(Object)(RemoteObject.createImmutable("text")));
 BA.debugLineNum = 36;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
Debug.ShouldStop(8);
try { BA.debugLineNum = 37;BA.debugLine="Private c As Cursor = rkmt.ExecQuery($\"SELECT CO";
Debug.ShouldStop(16);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), __ref.getField(false,"_rkmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.createImmutable("SELECT COUNT(*) AS fCol FROM pragma_table_info('pedidos') WHERE name='pe_envio_ok'")))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 38;BA.debugLine="c.Position = 0";
Debug.ShouldStop(32);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 39;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
Debug.ShouldStop(64);
if (RemoteObject.solveBoolean("=",_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fCol"))),BA.NumberToString(0))) { 
 BA.debugLineNum = 40;BA.debugLine="rkmt.ExecNonQuery($\"ALTER TABLE pedidos ADD COL";
Debug.ShouldStop(128);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.createImmutable("ALTER TABLE pedidos ADD COLUMN pe_envio_ok INT"))));
 BA.debugLineNum = 41;BA.debugLine="Log($\"Columna \"pe_envio_ok INT\", agregada a \"pe";
Debug.ShouldStop(256);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522216733",(RemoteObject.createImmutable("Columna \"pe_envio_ok INT\", agregada a \"pedidos}\".")),0);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e26) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e26.toString()); BA.debugLineNum = 44;BA.debugLine="Try";
Debug.ShouldStop(2048);
try { BA.debugLineNum = 45;BA.debugLine="rkmt.ExecNonQuery($\"ALTER TABLE pedidos ADD COL";
Debug.ShouldStop(4096);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.createImmutable("ALTER TABLE pedidos ADD COLUMN pe_envio_ok INT"))));
 BA.debugLineNum = 46;BA.debugLine="Log($\"Columna \"pe_envio_ok INT\", agregada a \"pe";
Debug.ShouldStop(8192);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522216738",(RemoteObject.createImmutable("Columna \"pe_envio_ok INT\", agregada a \"pedidos\"..")),0);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e30) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e30.toString()); BA.debugLineNum = 48;BA.debugLine="Log(LastException)";
Debug.ShouldStop(32768);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522216740",BA.ObjectToString(c_respaldodiario.__c.runMethod(false,"LastException",__ref.getField(false, "ba"))),0);
 };
 };
 BA.debugLineNum = 51;BA.debugLine="rkmt.ExecNonQuery($\"create table if not exists in";
Debug.ShouldStop(262144);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.createImmutable("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)"))));
 BA.debugLineNum = 52;BA.debugLine="rkmt.ExecNonQuery($\"create table if not exists pa";
Debug.ShouldStop(524288);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.createImmutable("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)"))));
 BA.debugLineNum = 53;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
Debug.ShouldStop(1048576);
c_respaldodiario.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("MM/dd/yyyy"));
 BA.debugLineNum = 54;BA.debugLine="fechaHoy = DateTime.Date(DateTime.Now)";
Debug.ShouldStop(2097152);
__ref.setField ("_fechahoy" /*RemoteObject*/ ,c_respaldodiario.__c.getField(false,"DateTime").runMethod(true,"Date",(Object)(c_respaldodiario.__c.getField(false,"DateTime").runMethod(true,"getNow"))));
 BA.debugLineNum = 55;BA.debugLine="revisaSkmtAttached";
Debug.ShouldStop(4194304);
__ref.runClassMethod (SHARK2.keymon.com.mx.c_respaldodiario.class, "_revisaskmtattached" /*RemoteObject*/ );
 BA.debugLineNum = 56;BA.debugLine="Return Me";
Debug.ShouldStop(8388608);
if (true) return __ref;
 BA.debugLineNum = 57;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _respaldainventarios(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("respaldaInventarios (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,92);
if (RapidSub.canDelegate("respaldainventarios")) { return __ref.runUserSub(false, "c_respaldodiario","respaldainventarios", __ref);}
RemoteObject _inicio = RemoteObject.createImmutable("");
 BA.debugLineNum = 92;BA.debugLine="Sub respaldaInventarios";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 94;BA.debugLine="Private inicio As String = DateTime.Now";
Debug.ShouldStop(536870912);
_inicio = BA.NumberToString(c_respaldodiario.__c.getField(false,"DateTime").runMethod(true,"getNow"));Debug.locals.put("inicio", _inicio);Debug.locals.put("inicio", _inicio);
 BA.debugLineNum = 97;BA.debugLine="rkmt.BeginTransaction";
Debug.ShouldStop(1);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("BeginTransaction");
 BA.debugLineNum = 98;BA.debugLine="rkmt.ExecNonQuery($\"delete from inventarios where";
Debug.ShouldStop(2);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("delete from inventarios where fecha = '"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((__ref.getField(true,"_fechahoy" /*RemoteObject*/ )))),RemoteObject.createImmutable("'")))));
 BA.debugLineNum = 100;BA.debugLine="rkmt.TransactionSuccessful 'Si no se pone Transac";
Debug.ShouldStop(8);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("TransactionSuccessful");
 BA.debugLineNum = 101;BA.debugLine="rkmt.EndTransaction";
Debug.ShouldStop(16);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("EndTransaction");
 BA.debugLineNum = 103;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _respaldapaquetes(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("respaldaPaquetes (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,106);
if (RapidSub.canDelegate("respaldapaquetes")) { return __ref.runUserSub(false, "c_respaldodiario","respaldapaquetes", __ref);}
RemoteObject _inicio = RemoteObject.createImmutable("");
 BA.debugLineNum = 106;BA.debugLine="Sub respaldaPaquetes";
Debug.ShouldStop(512);
 BA.debugLineNum = 107;BA.debugLine="Private inicio As String = DateTime.Now";
Debug.ShouldStop(1024);
_inicio = BA.NumberToString(c_respaldodiario.__c.getField(false,"DateTime").runMethod(true,"getNow"));Debug.locals.put("inicio", _inicio);Debug.locals.put("inicio", _inicio);
 BA.debugLineNum = 109;BA.debugLine="rkmt.BeginTransaction";
Debug.ShouldStop(4096);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("BeginTransaction");
 BA.debugLineNum = 111;BA.debugLine="rkmt.ExecNonQuery($\"delete from paquetes where fe";
Debug.ShouldStop(16384);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("delete from paquetes where fecha = '"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((__ref.getField(true,"_fechahoy" /*RemoteObject*/ )))),RemoteObject.createImmutable("'")))));
 BA.debugLineNum = 112;BA.debugLine="rkmt.ExecNonQuery($\"insert into paquetes (cat_dp_";
Debug.ShouldStop(32768);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("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_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((__ref.getField(true,"_fechahoy" /*RemoteObject*/ )))),RemoteObject.createImmutable("' as fecha from skmt1.cat_detalles_paq")))));
 BA.debugLineNum = 113;BA.debugLine="rkmt.TransactionSuccessful 'Si no se pone Transac";
Debug.ShouldStop(65536);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("TransactionSuccessful");
 BA.debugLineNum = 114;BA.debugLine="rkmt.EndTransaction";
Debug.ShouldStop(131072);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("EndTransaction");
 BA.debugLineNum = 116;BA.debugLine="End Sub";
Debug.ShouldStop(524288);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _respaldapedido(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("respaldaPedido (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,79);
if (RapidSub.canDelegate("respaldapedido")) { return __ref.runUserSub(false, "c_respaldodiario","respaldapedido", __ref);}
RemoteObject _inicio = RemoteObject.createImmutable("");
 BA.debugLineNum = 79;BA.debugLine="Sub respaldaPedido";
Debug.ShouldStop(16384);
 BA.debugLineNum = 80;BA.debugLine="Private inicio As String = DateTime.Now";
Debug.ShouldStop(32768);
_inicio = BA.NumberToString(c_respaldodiario.__c.getField(false,"DateTime").runMethod(true,"getNow"));Debug.locals.put("inicio", _inicio);Debug.locals.put("inicio", _inicio);
 BA.debugLineNum = 81;BA.debugLine="Log(\"copiando pedidos ...\")";
Debug.ShouldStop(65536);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522413314",RemoteObject.createImmutable("copiando pedidos ..."),0);
 BA.debugLineNum = 82;BA.debugLine="rkmt.BeginTransaction";
Debug.ShouldStop(131072);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("BeginTransaction");
 BA.debugLineNum = 83;BA.debugLine="rkmt.ExecNonQuery($\"delete from pedidos where sub";
Debug.ShouldStop(262144);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("delete from pedidos where substr(pe_fecha, 1, 10) = '"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((__ref.getField(true,"_fechahoy" /*RemoteObject*/ )))),RemoteObject.createImmutable("'")))));
 BA.debugLineNum = 85;BA.debugLine="rkmt.TransactionSuccessful 'Si no se pone Transac";
Debug.ShouldStop(1048576);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("TransactionSuccessful");
 BA.debugLineNum = 86;BA.debugLine="rkmt.EndTransaction";
Debug.ShouldStop(2097152);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("EndTransaction");
 BA.debugLineNum = 88;BA.debugLine="End Sub";
Debug.ShouldStop(8388608);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisaskmtattached(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("revisaSkmtAttached (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,66);
if (RapidSub.canDelegate("revisaskmtattached")) { return __ref.runUserSub(false, "c_respaldodiario","revisaskmtattached", __ref);}
RemoteObject _rs = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
 BA.debugLineNum = 66;BA.debugLine="Sub revisaSkmtAttached";
Debug.ShouldStop(2);
 BA.debugLineNum = 67;BA.debugLine="skmtAttached = False";
Debug.ShouldStop(4);
__ref.setField ("_skmtattached" /*RemoteObject*/ ,c_respaldodiario.__c.getField(true,"False"));
 BA.debugLineNum = 68;BA.debugLine="Dim rs As ResultSet = rkmt.ExecQuery(\"SELECT * FR";
Debug.ShouldStop(8);
_rs = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
_rs = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.ResultSetWrapper"), __ref.getField(false,"_rkmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("SELECT * FROM pragma_database_list"))));Debug.locals.put("rs", _rs);Debug.locals.put("rs", _rs);
 BA.debugLineNum = 69;BA.debugLine="Do While rs.NextRow 'Revisamos si esta montada \"k";
Debug.ShouldStop(16);
while (_rs.runMethod(true,"NextRow").<Boolean>get().booleanValue()) {
 BA.debugLineNum = 70;BA.debugLine="If rs.GetString(\"name\") = \"skmt1\" Then skmtAttac";
Debug.ShouldStop(32);
if (RemoteObject.solveBoolean("=",_rs.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("name"))),BA.ObjectToString("skmt1"))) { 
__ref.setField ("_skmtattached" /*RemoteObject*/ ,c_respaldodiario.__c.getField(true,"True"));};
 }
;
 BA.debugLineNum = 72;BA.debugLine="If Not(skmtAttached) Then";
Debug.ShouldStop(128);
if (c_respaldodiario.__c.runMethod(true,"Not",(Object)(__ref.getField(true,"_skmtattached" /*RemoteObject*/ ))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 73;BA.debugLine="rkmt.ExecNonQuery($\"attach database '${File.Comb";
Debug.ShouldStop(256);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("attach database '"),c_respaldodiario.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((c_respaldodiario.__c.getField(false,"File").runMethod(true,"Combine",(Object)(c_respaldodiario.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(RemoteObject.createImmutable("kmt.db")))))),RemoteObject.createImmutable("' as skmt1;")))));
 BA.debugLineNum = 74;BA.debugLine="skmtAttached = True";
Debug.ShouldStop(512);
__ref.setField ("_skmtattached" /*RemoteObject*/ ,c_respaldodiario.__c.getField(true,"True"));
 };
 BA.debugLineNum = 76;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _vacuum(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("vacuum (c_respaldodiario) ","c_respaldodiario",16,__ref.getField(false, "ba"),__ref,118);
if (RapidSub.canDelegate("vacuum")) { return __ref.runUserSub(false, "c_respaldodiario","vacuum", __ref);}
 BA.debugLineNum = 118;BA.debugLine="Sub vacuum";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 119;BA.debugLine="Log(\"Vacuum\")";
Debug.ShouldStop(4194304);
c_respaldodiario.__c.runVoidMethod ("LogImpl","522609921",RemoteObject.createImmutable("Vacuum"),0);
 BA.debugLineNum = 120;BA.debugLine="rkmt.ExecNonQuery(\"vacuum;\")";
Debug.ShouldStop(8388608);
__ref.getField(false,"_rkmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("vacuum;")));
 BA.debugLineNum = 121;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}