<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="border_width">12</property>
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<child>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-media-previous</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="fill">True</property>
</packing>
</child>
-
- <child>
- <widget class="GtkButton" id="seleccionarFecha">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Seleccionar Fecha</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="OnSeleccionarFechaClicked" last_modification_time="Wed, 15 Jun 2005 23:29:45 GMT"/>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
</widget>
<packing>
<property name="left_attach">1</property>
</child>
<child>
- <widget class="GtkFrame" id="frame6">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkTable" id="table4">
- <property name="visible">True</property>
- <property name="n_rows">6</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">8</property>
- <property name="column_spacing">8</property>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cantidad de Familiares : </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Observaciones : </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="observaciones">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="overwrite">False</property>
- <property name="accepts_tab">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_NONE</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Disponibilidad : </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="disponibilidad">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="familiares">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Solicitud</b></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
+ <placeholder/>
</child>
</widget>
<packing>
using Controlador.Afiliacion;
using Dominio.Afiliados;
+using Dominio.Autorizaciones;
+using Dominio.Planes;
using Dominio;
public class VMantenerPlanes
[Widget] SpinButton limite_anual;
[Widget] RadioButton tipo_auth;
+ PlanesController planc;
+
public 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));
+ ListStore m = new ListStore (typeof(string), typeof(float), typeof(float));
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);
+
+ CargarPlanes ();
+ }
+
+ private void CargarPlanes ()
+ {
+ ListStore store = (ListStore)lista.Model;
+ store.Clear ();
+
+ planc = new PlanesController ();
+ ArrayList lst = planc.ObtenerPlanesVigentes ();
+ foreach (Plan p in lst) {
+ TreeIter iter = store.Append ();
+ store.SetValue (iter, 0, p.Descripcion);
+ store.SetValue (iter, 1, p.Categoria);
+ store.SetValue (iter, 2, p.PermanenciaMinima);
+ }
+
+ planc.Dispose ();
}
public void OnDialogResponse (object o, ResponseArgs args)
Dialog w = (Dialog)alta_plan_xml.GetWidget ("alta_plan");
w.Run ();
w.Destroy ();
+
+ CargarPlanes ();
}
public void OnAltaPlan (object o, ResponseArgs args)
if (args.ResponseId == ResponseType.Cancel)
return;
+
+ string desc = descripcion.Text;
+ float cat = (float)categoria.Value;
+ int perma = permanencia_minima.ValueAsInt;
+
+ planc = new PlanesController ();
+ planc.CrearPlan (desc, cat, perma);
+ TreeModel model = coberturas.Model;
+
+ model.Foreach (AgregarCoberturaAlPlan);
+
+ planc.CommitPlan ();
+ planc.Dispose ();
+ }
+ bool AgregarCoberturaAlPlan (TreeModel model, TreePath path, TreeIter iter)
+ {
+ int codprestador = (int)model.GetValue (iter, 0);
+ float carencia = (float)model.GetValue (iter, 1);
+ float percent = (float)model.GetValue (iter, 2);
+ int limite = (int)model.GetValue (iter, 3);
+ string t = (string)model.GetValue (iter, 4);
+ ETipoAutorizacion tipo;
+ if (t.Equals ("Manual"))
+ tipo = ETipoAutorizacion.MANUAL;
+ else
+ tipo = ETipoAutorizacion.AUTOMATICA;
+
+ planc.AgregarCobertura (codprestador, carencia, percent, limite, tipo);
+ return true;
}
public void OnProperties (object o, EventArgs args)