From: Ricardo Markiewicz Date: Thu, 16 Jun 2005 03:23:14 +0000 (+0000) Subject: * ElimiarSolicitante X-Git-Tag: svn_import~314 X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/commitdiff_plain/40b39c7a3f0ef8e0439d7cb610f48b4cdcf743b3?ds=sidebyside * ElimiarSolicitante --- diff --git a/demo/glade/registrar_visitas.glade b/demo/glade/registrar_visitas.glade index 4def345..55f2f34 100644 --- a/demo/glade/registrar_visitas.glade +++ b/demo/glade/registrar_visitas.glade @@ -127,6 +127,7 @@ True GTK_RELIEF_NORMAL True + diff --git a/demo/src/Controlador/RegistrarVisitasController.cs b/demo/src/Controlador/RegistrarVisitasController.cs index 2e087df..93f91f8 100644 --- a/demo/src/Controlador/RegistrarVisitasController.cs +++ b/demo/src/Controlador/RegistrarVisitasController.cs @@ -40,6 +40,15 @@ public class RegistrarVisitasController : Controller s.Promotor = null; Db.set (s); } + + public void EliminarSolicitante (ETipoDocumento tipoDoc, int nroDoc) + { + /* Obtengo el solicitante */ + Solicitante s = new Solicitante (tipoDoc, nroDoc, null, null); + ObjectSet result = Db.get (s); + s = (Solicitante)result.next (); + Db.delete (s); + } } } diff --git a/demo/src/Vistas/VRegistrarVisitas.cs b/demo/src/Vistas/VRegistrarVisitas.cs index ab0088b..7df614f 100644 --- a/demo/src/Vistas/VRegistrarVisitas.cs +++ b/demo/src/Vistas/VRegistrarVisitas.cs @@ -61,6 +61,27 @@ public class VRegistrarVisitas c.EstablecerPendiente (tipoDoc, nroDoc); c.Dispose (); } + + public void OnEliminarSolicitante (object o, EventArgs args) + { + TreeSelection fromSel = visitas.Selection; + TreeIter iter; + TreeModel model; + ListStore store = (ListStore)visitas.Model; + + if (fromSel.GetSelected (out model, out iter) == false) { + /* Nada seleccionado */ + return; + } + ETipoDocumento tipoDoc; + int nroDoc; + tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)store.GetValue (iter, 0), true); + nroDoc = (int)store.GetValue (iter, 1); + + RegistrarVisitasController c = new RegistrarVisitasController (null); + c.EliminarSolicitante (tipoDoc, nroDoc); + c.Dispose (); + } public void Run () {