using System; using System.Collections; using Gtk; using Glade; using Controlador.Afiliacion; using Dominio.Autorizaciones; using Dominio.Planes; using Dominio.Afiliados; using Dominio; public class VConsultarAfiliado { Glade.XML xml; [Widget] TreeView lista; /* Busqueda */ [Widget] Entry codigo; [Widget] ComboBox s_tipoDocumento; [Widget] Entry s_nroDocument; [Widget] Entry s_apellido; public VConsultarAfiliado () { xml = new Glade.XML (null, "consultar_afiliado.glade", "consultar_afiliado", null); xml.Autoconnect (this); lista.Model = new ListStore (typeof(int), typeof(string), typeof(string), typeof (string), typeof(string)); /* Columnas */ lista.HeadersVisible = true; lista.AppendColumn ("Codigo", new CellRendererText (), "text", 0); lista.AppendColumn ("Nombre", new CellRendererText (), "text", 1); lista.AppendColumn ("Apellido", new CellRendererText (), "text", 2); lista.AppendColumn ("Tipo Doc.", new CellRendererText (), "text", 3); lista.AppendColumn ("Número Doc.", new CellRendererText (), "text", 4); } public void OnVerAfiliado (object o, EventArgs args) { } public void OnBuscarAfiliado (object o, EventArgs args) { ETipoDocumento tipoDoc; try { TreeIter iter; s_tipoDocumento.GetActiveIter (out iter); tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)s_tipoDocumento.Model.GetValue (iter, 0), true); } catch (Exception e) { tipoDoc = ETipoDocumento.NONE; } int nroDoc; try { nroDoc = Int32.Parse (s_nroDocument.Text); } catch (Exception e) { nroDoc = 0; } AfiliadoSolicitanteController c = new AfiliadoSolicitanteController (); ListStore store = (ListStore)lista.Model; store.Clear (); ArrayList lst = new ArrayList (); foreach (Prestacion p in lst) { TreeIter i = store.Append (); store.SetValue (i, 0, p.Codigo); store.SetValue (i, 1, p.Nombre); } c.Dispose (); } public void Run () { Dialog w = (Dialog)xml.GetWidget ("consultar_afiliado"); w.Run (); w.Destroy (); } }