+
+ 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<familiares; i++) {
+ AgregarFamiliar (i+1, familiares);
+ }
+ }
+
+ c.Dispose ();
+ store.Remove (ref iter);
+ }
+
+ private void AgregarFamiliar (int n, int total)
+ {
+ Glade.XML xml1 = new Glade.XML (null, "registrar_visitas.glade", "agregar_familiar", null);
+ xml1.Autoconnect (this);
+
+ Dialog w = (Dialog)xml1.GetWidget ("agregar_familiar");
+ w.Title = String.Format ("Agregar Familiar {0} de {1}", n, total);
+ w.Run ();
+ w.Destroy ();
+ }
+
+ public void OnSeleccionarFechaClicked (object o, EventArgs args)
+ {
+ CalendarDialog d;
+ if (fechaNac.Text.Equals (""))
+ d = new CalendarDialog ();
+ else
+ d = new CalendarDialog (fechaNac.Text);
+
+ int response;
+
+ response = d.Run();
+ if (response == -3)
+ fechaNac.Text = d.Date.ToLongDateString ();
+ d.Destroy ();