3 using System.Collections;
6 using Dominio.Afiliados;
11 Dialog wConsultarAfiliado;
15 static public void Main (string[] args)
24 Glade.XML gxml = new Glade.XML (null, "main.glade", "main", null);
25 gxml.Autoconnect (this);
26 Widget w = gxml.GetWidget ("main");
28 w.SetSizeRequest (450, 250);
34 private void InitDemo ()
36 lst = new ArrayList ();
37 Plan p = new Plan (1);
38 p.Descripcion = "Hola";
39 p.PermanenciaMinima = 2;
41 Solicitante s = new Solicitante (ETipoDocumento.DNI, 27000193, "Gazer");
42 Afiliado f = new Afiliado (s, p, new DateTime (2005, 7, 8));
46 public void OnSalirActivate (object o, EventArgs args)
51 public void OnConsultarAfiliado (object o, EventArgs args)
53 xmla = new Glade.XML (null, "consultar_afiliado.glade", "consultarAfiliado", null);
54 xmla.Autoconnect (this);
55 wConsultarAfiliado = (Dialog)xmla.GetWidget ("consultarAfiliado");
56 wConsultarAfiliado.SetSizeRequest (450, 250);
57 TreeView lista = (TreeView)xmla.GetWidget ("lista");
59 TreeStore store = new TreeStore (typeof (string), typeof (string));
62 lista.AppendColumn ("Codigo", new CellRendererText (), "text", 0);
63 lista.AppendColumn ("Nombre", new CellRendererText (), "text", 1);
65 wConsultarAfiliado.Run ();
68 public void OnConsultarAfiliadoClose (object o, EventArgs args)
70 wConsultarAfiliado.Destroy ();
73 public void OnVerAfiliado (object o, EventArgs args)
77 public void OnBuscarAfiliado (object o, EventArgs args)
79 Entry codigo = (Entry)xmla.GetWidget ("s_codigo");
80 TreeView lista = (TreeView)xmla.GetWidget ("lista");
81 TreeStore store = (TreeStore)lista.Model;
82 foreach (Afiliado a in lst) {
83 if (a.Codigo == Int32.Parse (codigo.Text))
84 store.AppendValues (String.Format("{0}", a.Codigo), a.Nombre);