X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/655bbc1c5b72f9c52fa42302de6cfcfd9fd0a80e..52dc39ea6822f9767e480581e9a59d8a7896e3a6:/demo/src/Vistas/RegistrarVisitas.cs diff --git a/demo/src/Vistas/RegistrarVisitas.cs b/demo/src/Vistas/RegistrarVisitas.cs index 7df614f..83d4e7b 100644 --- a/demo/src/Vistas/RegistrarVisitas.cs +++ b/demo/src/Vistas/RegistrarVisitas.cs @@ -15,6 +15,7 @@ public class VRegistrarVisitas Glade.XML xml; [Widget] TreeView visitas; + [Widget] Entry fechaNac; public VRegistrarVisitas () { @@ -60,6 +61,7 @@ public class VRegistrarVisitas RegistrarVisitasController c = new RegistrarVisitasController (null); c.EstablecerPendiente (tipoDoc, nroDoc); c.Dispose (); + store.Remove (ref iter); } public void OnEliminarSolicitante (object o, EventArgs args) @@ -81,6 +83,65 @@ public class VRegistrarVisitas RegistrarVisitasController c = new RegistrarVisitasController (null); c.EliminarSolicitante (tipoDoc, nroDoc); c.Dispose (); + + store.Remove (ref iter); + } + + public void OnAfiliar (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); + /* Obtengo la cantidad de familiares */ + int familiares = c.ObtenerCantidadFamiliares (tipoDoc, nroDoc); + + if (familiares > 0) { + for (int i=0; i