3 using System.Collections;
7 using Controlador.Afiliacion;
8 using Dominio.Afiliados;
11 public class VMantenerPlanes
13 Dialog wIngresarSolicitud;
15 Glade.XML alta_plan_xml;
17 [Widget] TreeView lista;
19 /* Alta Plan Window */
20 [Widget] Entry descripcion;
21 [Widget] SpinButton categoria;
22 [Widget] SpinButton permanencia_minima;
23 [Widget] TreeView coberturas;
26 [Widget] Entry codigo_prestacion;
27 [Widget] Entry carencia;
28 [Widget] SpinButton cobertura;
29 [Widget] SpinButton limite_anual;
30 [Widget] RadioButton tipo_auth;
32 public VMantenerPlanes ()
34 xml = new Glade.XML (null, "mantener_planes.glade", "mantener_planes", null);
35 xml.Autoconnect (this);
37 ListStore m = new ListStore (typeof(string), typeof(float), typeof(int));
39 lista.HeadersVisible = true;
40 lista.AppendColumn ("Descripción", new CellRendererText (), "text", 0);
41 lista.AppendColumn ("Categoría", new CellRendererText (), "text", 1);
42 lista.AppendColumn ("Permanencia Mínima", new CellRendererText (), "text", 2);
44 TreeIter nuevo = m.Append ();
46 m.SetValue (nuevo, 0, "Neo 210");
47 m.SetValue (nuevo, 1, 1.0f);
48 m.SetValue (nuevo, 2, 1);
51 m.SetValue (nuevo, 0, "Neo 310");
52 m.SetValue (nuevo, 1, 2.0f);
53 m.SetValue (nuevo, 2, 2);
56 m.SetValue (nuevo, 0, "Neo 410");
57 m.SetValue (nuevo, 1, 3.0f);
58 m.SetValue (nuevo, 2, 4);
61 m.SetValue (nuevo, 0, "Ejecutive 510");
62 m.SetValue (nuevo, 1, 4.0f);
63 m.SetValue (nuevo, 2, 3);
66 public void OnDialogResponse (object o, ResponseArgs args)
70 public void OnAdd (object o, EventArgs args)
72 alta_plan_xml = new Glade.XML (null, "mantener_planes.glade", "alta_plan", null);
73 alta_plan_xml.Autoconnect (this);
75 coberturas.Model = new ListStore (typeof(int), typeof(float), typeof (float), typeof (int), typeof(string));
76 coberturas.HeadersVisible = true;
77 coberturas.AppendColumn ("Prestacion", new CellRendererText (), "text", 0);
78 coberturas.AppendColumn ("Carencia", new CellRendererText (), "text", 1);
79 coberturas.AppendColumn ("Cobertura", new CellRendererText (), "text", 2);
80 coberturas.AppendColumn ("Limite Anual", new CellRendererText (), "text", 3);
81 coberturas.AppendColumn ("Tipo", new CellRendererText (), "text", 4);
83 Dialog w = (Dialog)alta_plan_xml.GetWidget ("alta_plan");
88 public void OnAltaPlan (object o, ResponseArgs args)
90 if (args.ResponseId == ResponseType.Cancel)
96 public void OnProperties (object o, EventArgs args)
100 public void OnDelete (object o, EventArgs args)
104 public void OnAddCobertura (object o, EventArgs args)
106 alta_plan_xml = new Glade.XML (null, "mantener_planes.glade", "alta_cobertura", null);
107 alta_plan_xml.Autoconnect (this);
109 Dialog w = (Dialog)alta_plan_xml.GetWidget ("alta_cobertura");
110 if (w.Run () != -6) {
111 ListStore store = (ListStore)coberturas.Model;
112 TreeIter nuevo = store.Append ();
114 store.SetValue (nuevo, 0, Int32.Parse (codigo_prestacion.Text));
115 store.SetValue (nuevo, 1, (float)Double.Parse (carencia.Text));
116 store.SetValue (nuevo, 2, (float)cobertura.Value);
117 store.SetValue (nuevo, 3, limite_anual.ValueAsInt);
118 if (tipo_auth.Active == true)
119 store.SetValue (nuevo, 4, "Manual");
121 store.SetValue (nuevo, 4, "Automatica");
128 Dialog w = (Dialog)xml.GetWidget ("mantener_planes");