X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/f8446a6723f09b3092929479b4307f72fcd03425..cc3a4210240607fb319e95ad3f5f5b7b9b16cdb8:/demo/src/Main.cs?ds=sidebyside diff --git a/demo/src/Main.cs b/demo/src/Main.cs index e1073f7..6c6b44a 100644 --- a/demo/src/Main.cs +++ b/demo/src/Main.cs @@ -5,6 +5,8 @@ using Gtk; using Glade; using Dominio.Afiliados; using Dominio.Planes; +using com.db4o; +using com.db4o.query; public class App { @@ -14,11 +16,6 @@ public class App #region Tests - /// - /// Decide si se corre la demo รณ los tests automatizados - /// - private static bool testing = false; - private static void EjecutarTests() { Tests.TestsAutorizacion.Instancia.EjecutarTodos(); @@ -34,9 +31,25 @@ public class App static public void Main (string[] args) { + ObjectContainer db; + db = Db4o.openFile("os.yap"); + + Query query = db.query(); + query.constrain(typeof(Persona)); + ObjectSet result = query.execute(); + + Persona s; + Console.WriteLine (result); + Console.WriteLine ("--"); + while ((s = (Persona)result.next ()) != null) { + Console.Write (" -- "); + Console.WriteLine ("{0} {1} {2} {3}", s.TipoDocumento, s.NroDocumento, s.Nombre, s.Apellido); + } + Console.WriteLine ("--"); + + db.close (); if ( args.Length > 0) { if (args[0].Equals ("--test")) { - testing = true; EjecutarTests(); return; } @@ -86,11 +99,21 @@ public class App v.Run (); } + public void OnAgregarAfiliado (object o, EventArgs args) + { + VAgregarAfiliado v = new VAgregarAfiliado (); + v.Run (); + } + + + public void OnMantenerPlanes (object o, EventArgs args) + { + VMantenerPlanes v = new VMantenerPlanes (); + v.Run (); + } + public void OnRegistrarVisitas (object o, EventArgs args) { - /*ABMGenerico g = new ABMGenerico (typeof(Plan)); - g.Run (); - return;*/ VRegistrarVisitas v = new VRegistrarVisitas (); v.Run (); }