</child>
<child>
- <widget class="GtkLabel" id="label28">
+ <widget class="GtkLabel" id="label">
<property name="visible">True</property>
- <property name="label" translatable="yes"></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>
</child>
<child>
- <widget class="GtkLabel" id="label29">
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</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="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>
+ <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="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
- <property name="y_options"></property>
+ <property name="y_options">fill</property>
</packing>
</child>
</widget>
</child>
</widget>
+<widget class="GtkDialog" id="resolucion">
+ <property name="width_request">250</property>
+ <property name="height_request">250</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Motivo Resolucion</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="okbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="border_width">12</property>
+ <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="motivo">
+ <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="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
--- /dev/null
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkDialog" id="buscar_plan">
+ <property name="width_request">400</property>
+ <property name="height_request">500</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Seleccionar Plan</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="has_separator">True</property>
+ <signal name="response" handler="OnDialogResponse" last_modification_time="Wed, 06 Jul 2005 22:46:48 GMT"/>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Seleccionar</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkFrame" id="frame4">
+ <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="alignment5">
+ <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="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="border_width">12</property>
+ <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="GtkTreeView" id="lista">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">True</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Planes</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>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
return salida;
}
- public Afiliado AfiliarTitular (ETipoDocumento tipoDoc, int nroDoc, Plan plan)
+ public Afiliado AfiliarTitular (ETipoDocumento tipoDoc, int nroDoc, int codplan)
{
/* Obtengo el Solicitante asi luego lo borro */
Solicitante s = new Solicitante (tipoDoc, nroDoc, null, null);
if (s == null)
Console.WriteLine ("ERROR");
+ Plan c = new Plan ();
+ c.Codigo = codplan;
+ ObjectSet r = Db.get (c);
+ Plan plan = r.next () as Plan;
+
/* Creo el afiliado */
Afiliado afil = new Afiliado (s, plan, DateTime.Now);
AutoIncrementable i = new AutoIncrementable ();
\r
private void InsertarDatosNecesarios()\r
{\r
+ return;
//PRESTADOR\r
Prestador pre = new Prestador();\r
pre.Cuit = "11-11111111-1";\r
using System;
using System.Collections;
+using Dominio.Autorizaciones;
+using Dominio.Planes;
public class Plan
{
public Plan ()
{
+ _coberturas = new ArrayList ();
}
public Plan (float categoria)
{
return String.Format ("Plan : {0} {1} {2}", _codigo, _categoria, _descripcion);
}
+
+ public Cobertura BuscarCobertura (Prestador p, Prestacion pe)
+ {
+ if ((p == null) || (pe == null)) {
+ Console.WriteLine ("Prestador o Prestacion es null!!");
+ return null;
+ }
+ if (pe.ExistePrestador (p) == false) {
+ Console.WriteLine ("La prestacion no esta dada por este prestador.");
+ return null;
+ }
+
+ if (_coberturas == null) return null;
+
+ Cobertura ret = null;
+ foreach (Cobertura c in _coberturas) {
+ if (pe.Codigo.Equals(c.Prestacion.Codigo) == true) {
+ ret = c;
+ break;
+ }
+ }
+ return ret;
+ }
}
}
public Prestacion()
{
+ _prestadores = new ArrayList ();
}
public Prestacion( string codigo )
_prestadores.Add (p);
return true;
}
-
+
+ public bool ExistePrestador (Prestador p)
+ {
+ if (_prestadores == null) return false;
+
+ foreach (Prestador p1 in _prestadores) {
+ if (p1.Cuit.Equals (p.Cuit))
+ return true;
+ }
+ return false;
+ }
}
}
#warning Descomentar para inicializar la base de datos con algunos valores de prueba !
logo.FromFile = "logo.png";
- /* InitDemo (); */
+ /*InitDemo ();*/
Application.Run();
}
p4.Nombre = "Aplique clavos fractura multiple";
p4.Categoria = c2;
+ Prestador prestador = new Prestador ("30-11223366-0");
+ prestador.Nombre = "DePrueba";
+ prestador.Email = "DePrueba";
+
+ p1.AgregarPrestador (prestador);
+ p2.AgregarPrestador (prestador);
+ p3.AgregarPrestador (prestador);
+ p4.AgregarPrestador (prestador);
+
ObjectContainer db;
db = Db4o.openFile("os.yap");
db.set (p1);
ETipoDocumento tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)model.GetValue (parent, 0), true);
int nroDoc = (int)model.GetValue (parent, 1);
+ /* Selecciono plan */
+ VBuscarPlan v = new VBuscarPlan ();
+ string plan = v.Run ();
+
/* Afilio el titular */
- Afiliado AfiTitular = c.AfiliarTitular (tipoDoc, nroDoc, null);
+ Afiliado AfiTitular = c.AfiliarTitular (tipoDoc, nroDoc, Int32.Parse (plan));
Console.WriteLine ("Titular afiliado!! {0} {1}", tipoDoc, nroDoc);
/* Obtengo el primer familiar, si es que existe */
--- /dev/null
+
+using System;
+using System.Collections;
+using Gtk;
+using Glade;
+
+using Controlador.Afiliacion;
+using Dominio.Autorizaciones;
+using Dominio.Planes;
+using Dominio.Afiliados;
+using Dominio;
+
+public class VBuscarPlan
+{
+ Glade.XML xml;
+ string retorno = null;
+
+ [Widget] TreeView lista;
+
+ public VBuscarPlan ()
+ {
+ xml = new Glade.XML (null, "buscar_plan.glade", "buscar_plan", null);
+ xml.Autoconnect (this);
+
+ ListStore store;
+ lista.Model = store = new ListStore (typeof(int), typeof(float), typeof (string));
+
+ /* Columnas */
+ lista.HeadersVisible = true;
+ lista.AppendColumn ("Codigo", new CellRendererText (), "text", 0);
+ lista.AppendColumn ("Categoria", new CellRendererText (), "text", 1);
+ lista.AppendColumn ("Descripcion", new CellRendererText (), "text", 2);
+
+ PlanesController c = new PlanesController ();
+ ArrayList lst = c.ObtenerPlanesVigentes ();
+ foreach (Plan p in lst) {
+ TreeIter iter = store.Append ();
+ store.SetValue (iter, 0, p.Codigo);
+ store.SetValue (iter, 1, p.Categoria);
+ store.SetValue (iter, 2, p.Descripcion);
+ }
+ }
+
+ public void OnDialogResponse (object o, ResponseArgs args)
+ {
+ if (args.ResponseId == ResponseType.Cancel)
+ return;
+
+ /* Todo el seleccionado. TODO : abortar si no hay nada seleccionado! :) */
+
+ TreeSelection fromSel = lista.Selection;
+ TreeIter iter;
+ TreeModel model;
+
+ if (fromSel.GetSelected (out model, out iter)) {
+ retorno = String.Format ("{0}", (int)model.GetValue (iter, 0));
+ }
+ }
+
+ public string Run ()
+ {
+ Dialog w = (Dialog)xml.GetWidget ("buscar_plan");
+ w.Run ();
+ w.Destroy ();
+
+ return retorno;
+ }
+}
+
using Controlador.Afiliacion;
using Dominio.Afiliados;
using Dominio.Autorizaciones;
+using Dominio.Planes;
using Dominio;
public class VRevisarAutorizacionManual
[Widget] Label cobertura;
[Widget] Entry consumo_actual;
[Widget] Entry consumo_limite;
+ [Widget] TextView observaciones;
+
+ float percent_cobertura;
public VRevisarAutorizacionManual ()
{
codigo.Text = String.Format ("{0}", a.Codigo);
fechaSolicitud.Text = a.FechaSolicitud.ToString ();
+ observaciones.Buffer.Text = a.Observaciones;
prestacion_nombre.Text = a.Prestacion.Nombre;
prestacion_codigo.Text = a.Prestacion.Codigo;
prestador_nombre.Text = a.Prestador.Nombre;
estado_cuenta.Text = "No se registra deuda del Afiliado";
else
estado_cuenta.Text = String.Format ("El afiliado debe {0} meses.", a.Afiliado.Moroso);
-
- cobertura.Text = "La prestacion esta cubierta";
+
+ Cobertura cob;
+ if (a.Afiliado.PlanActual != null) {
+ cob = a.Afiliado.PlanActual.BuscarCobertura (a.Prestador, a.Prestacion);
+ } else {
+ cob = null;
+ }
+
+ if (cob == null)
+ cobertura.Markup = "<b>La prestacion no esta cubierta</b>";
+ else
+ cobertura.Text = "La prestacion esta cubierta";
+
/* Necesitariamos un query que cuente este dato */
consumo_actual.Text = "1";
/* Necesitariamos un metodo que busque la Cobertura para este Prestador y esta Prestacion
* del Plan del cliente
*/
- consumo_limite.Text = "2";
+ if (cob != null)
+ consumo_limite.Text = String.Format ("{0}", cob.LimiteAnual);
+ if (cob == null)
+ percent_cobertura = 1.0f;
+ else
+ percent_cobertura = cob.Porcentaje;
Dialog v = (Dialog)xml_revisar.GetWidget ("revisar_autorizacion");
v.Run ();
v.Destroy ();
Console.WriteLine ("Cerrando");
return;
}
+
+ Glade.XML resolucion = new Glade.XML (null, "actualizar_autorizacion_manual.glade", "resolucion", null);
+ resolucion.Autoconnect (this);
+
+ Dialog v = (Dialog)resolucion.GetWidget ("resolucion");
+ v.Run ();
+
+ TextView texto = (TextView)resolucion.GetWidget ("motivo");
+
+ string r = texto.Buffer.Text;
+
+ v.Destroy ();
+
+ float percent = 0.0f;
if (((int)args.ResponseId) == 0) {
- Console.WriteLine ("Aprobado");
+ percent = percent_cobertura;
}
if (((int)args.ResponseId) == 1) {
- Console.WriteLine ("Rechazado");
+ percent = 0.0f;
}
+
+ int cod = Int32.Parse (codigo.Text);
+
+ AutorizacionController c = new AutorizacionController (DateTime.Now);
+ c.setResolucionAutorizacionManual (cod, r, percent);
+ c.Dispose ();
}
private void CargarAutorizaciones ()