/* Obtengo la cantidad de familiares */
int familiares = c.ObtenerCantidadFamiliares (tipoDoc, nroDoc);
+ bool error = false;
if (familiares > 0) {
for (int i=0; i<familiares; i++) {
- AgregarFamiliar (i+1, familiares);
+ error = AgregarFamiliar (i+1, familiares, tipoDoc, nroDoc, c);
}
}
+ if (!error) {
+ c.Visitado (tipoDoc, nroDoc);
+ store.Remove (ref iter);
+ }
+
c.Dispose ();
- store.Remove (ref iter);
}
- private void AgregarFamiliar (int n, int total)
+ private bool AgregarFamiliar (int n, int total, ETipoDocumento tipo, int nro, RegistrarVisitasController c)
{
- 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 ();
+ VAgregarFamiliar w = new VAgregarFamiliar (n, total, tipo, nro, c);
+ if (w.Run () == true) {
+ MessageDialog md = new MessageDialog (null,
+ DialogFlags.DestroyWithParent,
+ MessageType.Error,
+ ButtonsType.Close, "No se pudo agregar el familiar!.");
+
+ md.Run ();
+ md.Destroy();
+ return true;
+ }
+ return false;
}
public void OnSeleccionarFechaClicked (object o, EventArgs args)