X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/420e0b14d45f1f0433f4492f9dd08bfd068c6613..afbf89745cac12021bfe71bc6739dbd9459cacc0:/demo/src/Vistas/AgregarFamiliar.cs?ds=sidebyside diff --git a/demo/src/Vistas/AgregarFamiliar.cs b/demo/src/Vistas/AgregarFamiliar.cs index 38dbc12..2991f47 100644 --- a/demo/src/Vistas/AgregarFamiliar.cs +++ b/demo/src/Vistas/AgregarFamiliar.cs @@ -33,12 +33,15 @@ public class VAgregarFamiliar int actual; int total; + bool error = false; ETipoDocumento tipoTitular; int nroTitular; + RegistrarVisitasController c; - public VAgregarFamiliar(int n, int t, ETipoDocumento td_titular, int doc_titular) + public VAgregarFamiliar(int n, int t, ETipoDocumento td_titular, int doc_titular, RegistrarVisitasController c) { + this.c = c; xml = new Glade.XML (null, "registrar_visitas.glade", "agregar_familiar", null); xml.Autoconnect (this); actual = n; @@ -50,8 +53,8 @@ public class VAgregarFamiliar public void OnDialogResponse (object o, ResponseArgs args) { TreeIter iter; - if (args.ResponseId == ResponseType.Cancel) - return; + /*if (args.ResponseId == ResponseType.Cancel) + return; */ ETipoDocumento _tipoDoc; int _nroDoc; @@ -67,9 +70,6 @@ public class VAgregarFamiliar EProvincia _provincia; string _telefono; - /* Acept presionado, guardo */ - RegistrarVisitasController c = new RegistrarVisitasController (null); - tipoDoc.GetActiveIter (out iter); _tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)tipoDoc.Model.GetValue (iter, 0), true); _nroDoc = Int32.Parse (nroDoc.Text); @@ -91,12 +91,15 @@ public class VAgregarFamiliar //_provincia _telefono = telefono.Text; - c.CargarFamiliar ( + if (c.CargarFamiliar ( tipoTitular, nroTitular, _tipoDoc, _nroDoc, _nombre, _apellido, _email, _fechaNac, _calle, _numero, _piso, _dpto, _telefono, - _sexo); - - c.Dispose (); + _sexo) == false ) + { + Console.WriteLine ("ERROR AL CARGAR FAMILIAR"); + error = true; + } + } public void OnSeleccionarFechaClicked (object o, EventArgs args) @@ -116,12 +119,13 @@ public class VAgregarFamiliar d.Destroy (); } - public void Run () + public bool Run () { Dialog w = (Dialog)xml.GetWidget ("agregar_familiar"); w.Title = String.Format ("Agregar Familiar {0} de {1}", actual, total); w.Run (); w.Destroy (); + return error; } }