<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <signal name="clicked" handler="BuscarPorAfiliado" last_modification_time="Thu, 07 Jul 2005 05:44:20 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment12">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <signal name="clicked" handler="BuscarPorCodigo" last_modification_time="Thu, 07 Jul 2005 05:44:41 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment13">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <signal name="clicked" handler="BuscarPorAuditor" last_modification_time="Thu, 07 Jul 2005 05:45:08 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment14">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <signal name="clicked" handler="BuscarPorFecha" last_modification_time="Thu, 07 Jul 2005 05:45:23 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment15">
<child>
<widget class="GtkLabel" id="label34">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Búesquedas</b></property>
+ <property name="label" translatable="yes"><b>Búsquedas</b></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
</child>
<child>
- <widget class="GtkEntry" id="entry1">
+ <widget class="GtkEntry" id="auth_codigo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="entry2">
+ <widget class="GtkEntry" id="auth_fecha">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
- <widget class="GtkTextView" id="textview2">
+ <widget class="GtkTextView" id="auth_obs">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="editable">True</property>
+ <property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
</child>
<child>
- <widget class="GtkEntry" id="entry4">
+ <widget class="GtkEntry" id="prestacion_codigo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="entry5">
+ <widget class="GtkEntry" id="prestacion_nombre">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="entry6">
+ <widget class="GtkEntry" id="prestador_cuit">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="entry7">
+ <widget class="GtkEntry" id="prestador_nombre">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="entry8">
+ <widget class="GtkEntry" id="prestador_email">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
- <property name="n_rows">5</property>
+ <property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">8</property>
</packing>
</child>
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sexo : </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">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="homogeneous">True</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="sexom">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Masculino</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="sexof">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Femenino</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">sexom</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="spacing">0</property>
<child>
- <widget class="GtkComboBox" id="tipoDoc">
- <property name="visible">True</property>
- <property name="items" translatable="yes">DNI
-LC
-LE
-CI</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="nroDoc">
+ <widget class="GtkEntry" id="afiliado_documento">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="apellido">
+ <widget class="GtkEntry" id="afiliado_apellido">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="nombre">
+ <widget class="GtkEntry" id="afiliado_nombre">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkEntry" id="entry11">
+ <widget class="GtkEntry" id="afiliado_codigo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="right_padding">0</property>
<child>
- <widget class="GtkLabel" id="label24">
+ <widget class="GtkLabel" id="tipo_auth">
<property name="visible">True</property>
- <property name="label" translatable="yes">[Manual|Automática]</property>
+ <property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
</child>
<child>
- <widget class="GtkEntry" id="entry10">
+ <widget class="GtkEntry" id="fecha_res">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
</child>
<child>
- <widget class="GtkLabel" id="label31">
+ <widget class="GtkLabel" id="estado">
<property name="visible">True</property>
- <property name="label" translatable="yes">[Pendiente|Aprobada|Rechazada]</property>
+ <property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
- <widget class="GtkTextView" id="textview1">
+ <widget class="GtkTextView" id="fundamento_res">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="editable">True</property>
+ <property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
</child>
<child>
- <widget class="GtkLabel" id="label40">
+ <widget class="GtkLabel" id="auditor">
<property name="visible">True</property>
- <property name="label" translatable="yes">Apellido y Nombre</property>
+ <property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="spacing">8</property>
<child>
- <widget class="GtkButton" id="button11">
+ <widget class="GtkButton" id="primero">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</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="OnMove" last_modification_time="Thu, 07 Jul 2005 06:20:49 GMT"/>
</widget>
</child>
<child>
- <widget class="GtkButton" id="button12">
+ <widget class="GtkButton" id="anterior">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</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="OnMove" last_modification_time="Thu, 07 Jul 2005 06:20:42 GMT"/>
</widget>
</child>
<child>
- <widget class="GtkButton" id="button13">
+ <widget class="GtkButton" id="siguiente">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</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="OnMove" last_modification_time="Thu, 07 Jul 2005 06:20:34 GMT"/>
</widget>
</child>
<child>
- <widget class="GtkButton" id="button14">
+ <widget class="GtkButton" id="ultimo">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</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="OnMove" last_modification_time="Thu, 07 Jul 2005 06:20:23 GMT"/>
</widget>
</child>
</widget>
--- /dev/null
+
+using System;
+using System.Collections;
+using Gtk;
+using Glade;
+
+using Controlador.Afiliacion;
+using Controlador;
+using Dominio.Autorizaciones;
+using Dominio.Planes;
+using Dominio.Afiliados;
+using Dominio;
+
+public class VConsultarAutorizaciones
+{
+ Glade.XML xml;
+
+ /* Campos de datos */
+ [Widget] Entry afiliado_documento;
+ [Widget] Entry afiliado_apellido;
+ [Widget] Entry afiliado_nombre;
+ [Widget] Entry afiliado_codigo;
+ [Widget] Entry auth_codigo;
+ [Widget] Entry auth_fecha;
+ [Widget] TextView auth_obs;
+ [Widget] Entry prestacion_nombre;
+ [Widget] Entry prestacion_codigo;
+ [Widget] Entry prestador_cuit;
+ [Widget] Entry prestador_nombre;
+ [Widget] Entry prestador_email;
+ [Widget] Label tipo_auth;
+ [Widget] Label auditor;
+ [Widget] Label estado;
+ [Widget] Entry fecha_res;
+ [Widget] TextView fundamento_res;
+
+ /* Botones */
+ [Widget] Button primero;
+ [Widget] Button anterior;
+ [Widget] Button siguiente;
+ [Widget] Button ultimo;
+
+ ArrayList autorizaciones;
+ int actualpos = 0;
+
+ public VConsultarAutorizaciones ()
+ {
+ xml = new Glade.XML (null, "consultar_autorizacion.glade", "consultar_autorizacion", null);
+ xml.Autoconnect (this);
+ }
+
+ public void BuscarPorAfiliado (object o, EventArgs args)
+ {
+ AutorizacionController c = new AutorizacionController (DateTime.Now);
+
+ VBuscarAfiliado v = new VBuscarAfiliado ();
+ string r = v.Run ();
+ if (r == null)
+ return;
+
+ autorizaciones = c.obtenerAutorizacionesPorAfiliado (Int32.Parse (r));
+
+ c.Dispose ();
+
+ actualpos = 0;
+ Mostrar ();
+ }
+
+ public void BuscarPorCodigo (object o, EventArgs args)
+ {
+ }
+
+ public void BuscarPorAuditor (object o, EventArgs args)
+ {
+ }
+
+ public void BuscarPorFecha (object o, EventArgs args)
+ {
+ }
+
+ private void SetButton (bool p, bool a, bool s, bool u)
+ {
+ primero.Sensitive = p;
+ anterior.Sensitive = a;
+ siguiente.Sensitive = s;
+ ultimo.Sensitive = u;
+ }
+
+ private void UpdateButtons ()
+ {
+ if (autorizaciones == null) {
+ SetButton (false, false, false, false);
+ return;
+ }
+ if (autorizaciones.Count == 1) {
+ SetButton (false, false, false, false);
+ return;
+ }
+ if (actualpos == 0) {
+ SetButton (false, false, true, true);
+ return;
+ }
+ if (actualpos == (autorizaciones.Count - 1)) {
+ SetButton (true, true, false, false);
+ return;
+ }
+ SetButton (true, true, true, true);
+ }
+
+ public void OnMove (object o, EventArgs args)
+ {
+ if (autorizaciones == null) {
+ UpdateButtons ();
+ return;
+ }
+ if (o == primero) actualpos = 0;
+ if (o == anterior) actualpos--;
+ if (o == siguiente) actualpos++;
+ if (o == ultimo) actualpos = autorizaciones.Count - 1;
+
+ if (actualpos < 0) actualpos = 0;
+ if (actualpos >= autorizaciones.Count) actualpos = autorizaciones.Count - 1;
+
+ Mostrar ();
+ }
+
+ private void Mostrar ()
+ {
+ if (autorizaciones == null) return;
+
+ Autorizacion auth;
+ try {
+ auth = autorizaciones[actualpos] as Autorizacion;
+ } catch (Exception e) {
+ UpdateButtons ();
+ return;
+ }
+
+ afiliado_documento.Text = String.Format ("{0} {1}", auth.Afiliado.TipoDocumento, auth.Afiliado.NroDocumento);
+ afiliado_apellido.Text = auth.Afiliado.Apellido;
+ afiliado_nombre.Text = auth.Afiliado.Nombre;
+ afiliado_codigo.Text = String.Format ("{0}", auth.Afiliado.Codigo);
+ auth_codigo.Text = String.Format ("{0}", auth.Codigo);
+ auth_fecha.Text = auth.FechaSolicitud.ToString ();
+ if (auth is AutorizacionManual)
+ auth_obs.Buffer.Text = (auth as AutorizacionManual).Observaciones;
+ prestacion_nombre.Text = auth.Prestacion.Nombre;
+ prestacion_codigo.Text = auth.Prestacion.Codigo;
+ prestador_cuit.Text = auth.Prestador.Cuit;
+ prestador_nombre.Text = auth.Prestador.Nombre;
+ prestador_email.Text = auth.Prestador.Email;
+ if (auth is AutorizacionManual)
+ tipo_auth.Text = "Manual";
+ else
+ tipo_auth.Text = "Automatica";
+ auditor.Text = "Auditor Medico";
+ estado.Text = auth.getEstado (DateTime.Now).ToString ();
+
+ if (auth is AutorizacionManual) {
+ DateTime t = (auth as AutorizacionManual).FechaResolucion;
+ if (t != DateTime.MinValue)
+ fecha_res.Text = t.ToString ();
+ }
+ /* [Widget] TextView fundamento_res;*/
+
+ UpdateButtons ();
+ }
+
+ public void Run ()
+ {
+ Dialog w = (Dialog)xml.GetWidget ("consultar_autorizacion");
+ w.Run ();
+ w.Destroy ();
+ }
+}
+