X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/e826fb5076f847072bfe16584c36e3b2da8a442d..6a9bca8f723013b80486025159fa59c3e61cb612:/demo/src/Vistas/MantenerPlanes.cs diff --git a/demo/src/Vistas/MantenerPlanes.cs b/demo/src/Vistas/MantenerPlanes.cs index d0f5257..604cb99 100644 --- a/demo/src/Vistas/MantenerPlanes.cs +++ b/demo/src/Vistas/MantenerPlanes.cs @@ -33,6 +33,34 @@ public class VMantenerPlanes { xml = new Glade.XML (null, "mantener_planes.glade", "mantener_planes", null); xml.Autoconnect (this); + + ListStore m = new ListStore (typeof(string), typeof(float), typeof(int)); + lista.Model = m; + lista.HeadersVisible = true; + lista.AppendColumn ("Descripción", new CellRendererText (), "text", 0); + lista.AppendColumn ("Categoría", new CellRendererText (), "text", 1); + lista.AppendColumn ("Permanencia Mínima", new CellRendererText (), "text", 2); + + TreeIter nuevo = m.Append (); + + m.SetValue (nuevo, 0, "Neo 210"); + m.SetValue (nuevo, 1, 1.0f); + m.SetValue (nuevo, 2, 1); + + nuevo = m.Append (); + m.SetValue (nuevo, 0, "Neo 310"); + m.SetValue (nuevo, 1, 2.0f); + m.SetValue (nuevo, 2, 2); + + nuevo = m.Append (); + m.SetValue (nuevo, 0, "Neo 410"); + m.SetValue (nuevo, 1, 3.0f); + m.SetValue (nuevo, 2, 4); + + nuevo = m.Append (); + m.SetValue (nuevo, 0, "Ejecutive 510"); + m.SetValue (nuevo, 1, 4.0f); + m.SetValue (nuevo, 2, 3); } public void OnDialogResponse (object o, ResponseArgs args) @@ -44,12 +72,13 @@ public class VMantenerPlanes alta_plan_xml = new Glade.XML (null, "mantener_planes.glade", "alta_plan", null); alta_plan_xml.Autoconnect (this); - coberturas.Model = new ListStore (typeof(int), typeof(float), typeof (string), typeof (float)); + coberturas.Model = new ListStore (typeof(int), typeof(float), typeof (float), typeof (int), typeof(string)); coberturas.HeadersVisible = true; coberturas.AppendColumn ("Prestacion", new CellRendererText (), "text", 0); coberturas.AppendColumn ("Carencia", new CellRendererText (), "text", 1); coberturas.AppendColumn ("Cobertura", new CellRendererText (), "text", 2); coberturas.AppendColumn ("Limite Anual", new CellRendererText (), "text", 3); + coberturas.AppendColumn ("Tipo", new CellRendererText (), "text", 4); Dialog w = (Dialog)alta_plan_xml.GetWidget ("alta_plan"); w.Run (); @@ -83,9 +112,13 @@ public class VMantenerPlanes TreeIter nuevo = store.Append (); store.SetValue (nuevo, 0, Int32.Parse (codigo_prestacion.Text)); - store.SetValue (nuevo, 1, (float)Double.Parse (categoria.Text)); - store.SetValue (nuevo, 2, descripcion.Text)); - store.SetValue (nuevo, 3, Int32.Parse (codigo_prestacion.Text)); + store.SetValue (nuevo, 1, (float)Double.Parse (carencia.Text)); + store.SetValue (nuevo, 2, (float)cobertura.Value); + store.SetValue (nuevo, 3, limite_anual.ValueAsInt); + if (tipo_auth.Active == true) + store.SetValue (nuevo, 4, "Manual"); + else + store.SetValue (nuevo, 4, "Automatica"); } w.Destroy (); }