3 using System.Collections;
7 using Controlador.Afiliacion;
8 using Dominio.Autorizaciones;
10 using Dominio.Afiliados;
13 public class VBuscarPlan
16 string retorno = null;
18 [Widget] TreeView lista;
22 xml = new Glade.XML (null, "buscar_plan.glade", "buscar_plan", null);
23 xml.Autoconnect (this);
26 lista.Model = store = new ListStore (typeof(int), typeof(float), typeof (string));
29 lista.HeadersVisible = true;
30 lista.AppendColumn ("Codigo", new CellRendererText (), "text", 0);
31 lista.AppendColumn ("Categoria", new CellRendererText (), "text", 1);
32 lista.AppendColumn ("Descripcion", new CellRendererText (), "text", 2);
34 PlanesController c = new PlanesController ();
35 ArrayList lst = c.ObtenerPlanesVigentes ();
36 foreach (Plan p in lst) {
37 TreeIter iter = store.Append ();
38 store.SetValue (iter, 0, p.Codigo);
39 store.SetValue (iter, 1, p.Categoria);
40 store.SetValue (iter, 2, p.Descripcion);
44 public void OnDialogResponse (object o, ResponseArgs args)
46 if (args.ResponseId == ResponseType.Cancel)
49 /* Todo el seleccionado. TODO : abortar si no hay nada seleccionado! :) */
51 TreeSelection fromSel = lista.Selection;
55 if (fromSel.GetSelected (out model, out iter)) {
56 retorno = String.Format ("{0}", (int)model.GetValue (iter, 0));
62 Dialog w = (Dialog)xml.GetWidget ("buscar_plan");