]> git.llucax.com Git - z.facultad/75.10/miklolife.git/commitdiff
* ya casi estaria todo para la demo. Faltan
authorRicardo Markiewicz <gazer.arg@gmail.com>
Thu, 7 Jul 2005 05:30:54 +0000 (05:30 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Thu, 7 Jul 2005 05:30:54 +0000 (05:30 +0000)
   - Revisar un par de bugfs
   - Ajustar un par de listas para que se borren elementos desactualizados
   - Agregar unos sort a algunos treeview como chiche
   - que dios nos ayude :)

demo/glade/actualizar_autorizacion_manual.glade
demo/glade/buscar_plan.glade [new file with mode: 0644]
demo/src/Controlador/AfiliadoSolicitanteController.cs
demo/src/Controlador/AutorizacionController.cs
demo/src/Dominio/Plan.cs
demo/src/Dominio/Prestacion.cs
demo/src/Main.cs
demo/src/Vistas/AgregarAfiliado.cs
demo/src/Vistas/BuscarPlan.cs [new file with mode: 0644]
demo/src/Vistas/RevisarAutorizacionManual.cs

index dc99f42dab07ebf54babf28dcec715bfa6325287..66873340e94db5f5bb9b598c967dad3d19cf9628 100644 (file)
                          </child>
 
                          <child>
                          </child>
 
                          <child>
-                           <widget class="GtkLabel" id="label28">
+                           <widget class="GtkLabel" id="label">
                              <property name="visible">True</property>
                              <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>
                              <property name="use_underline">False</property>
                              <property name="use_markup">False</property>
                              <property name="justify">GTK_JUSTIFY_LEFT</property>
                          </child>
 
                          <child>
                          </child>
 
                          <child>
-                           <widget class="GtkLabel" id="label29">
+                           <widget class="GtkScrolledWindow" id="scrolledwindow2">
                              <property name="visible">True</property>
                              <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>
                            </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="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>
                            </packing>
                          </child>
                        </widget>
   </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>
 </glade-interface>
diff --git a/demo/glade/buscar_plan.glade b/demo/glade/buscar_plan.glade
new file mode 100644 (file)
index 0000000..267bdff
--- /dev/null
@@ -0,0 +1,150 @@
+<?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">&lt;b&gt;Planes&lt;/b&gt;</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>
index 51a28ab95ccda9019d899a03eaa3eea6110f12fb..86c3e36f2d9fcecb7bd560eb5b30aeea3da103bd 100644 (file)
@@ -78,7 +78,7 @@ public class AfiliadoSolicitanteController : Controller
                return salida;
        }
 
                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);
        {
                /* Obtengo el Solicitante asi luego lo borro */
                Solicitante s = new Solicitante (tipoDoc, nroDoc, null, null);
@@ -90,6 +90,11 @@ public class AfiliadoSolicitanteController : Controller
                if (s == null)
                        Console.WriteLine ("ERROR");
 
                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 ();
                /* Creo el afiliado */
                Afiliado afil = new Afiliado (s, plan, DateTime.Now);
                AutoIncrementable i = new AutoIncrementable ();
index 23cfe7402d252998bd5560b2cded822de03bead3..654ca0b6e7860f14fb4ff49fe073eb8473e70fbb 100644 (file)
@@ -212,6 +212,7 @@ namespace Controlador
                \r
                private void InsertarDatosNecesarios()\r
                {\r
                \r
                private void InsertarDatosNecesarios()\r
                {\r
+                       return;
                        //PRESTADOR\r
                        Prestador pre = new Prestador();\r
                        pre.Cuit = "11-11111111-1";\r
                        //PRESTADOR\r
                        Prestador pre = new Prestador();\r
                        pre.Cuit = "11-11111111-1";\r
index 98fe5721bcb526dfed49eea9d065e3496a57965a..d2dee108136d85c594782f01d1966b0b33ca495f 100644 (file)
@@ -3,6 +3,8 @@ namespace Planes {
 
 using System;
 using System.Collections;
 
 using System;
 using System.Collections;
+using Dominio.Autorizaciones;
+using Dominio.Planes;
 
 public class Plan 
 {
 
 public class Plan 
 {
@@ -39,6 +41,7 @@ public class Plan
 
        public Plan ()
        {
 
        public Plan ()
        {
+               _coberturas = new ArrayList ();
        }
        
        public Plan (float categoria)
        }
        
        public Plan (float categoria)
@@ -74,6 +77,29 @@ public class Plan
        {
                return String.Format ("Plan : {0} {1} {2}", _codigo, _categoria, _descripcion);
        }
        {
                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;
+       }
 }
 
 }
 }
 
 }
index 58e44475cb2702ca491ae139019122b2acd2e173..03fb51dc4196bd99e8eb5f0f1a7e0c84dcd2c88f 100644 (file)
@@ -23,6 +23,7 @@ namespace Dominio
                        
                        public Prestacion()
                        {
                        
                        public Prestacion()
                        {
+                               _prestadores = new ArrayList ();
                        }
 
                        public Prestacion( string codigo )
                        }
 
                        public Prestacion( string codigo )
@@ -43,7 +44,17 @@ namespace Dominio
                                _prestadores.Add (p);
                                return true;
                        }
                                _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;
+                       }                       
                }
 
        }
                }
 
        }
index 8b5f7e76a6c2d7ce1b89cdb957650bd376848d6b..e3085afb52868f701b8f65b6472b2a6a008bb9ec 100644 (file)
@@ -55,7 +55,7 @@ public class App
 
                #warning Descomentar para inicializar la base de datos con algunos valores de prueba !
                logo.FromFile = "logo.png";
 
                #warning Descomentar para inicializar la base de datos con algunos valores de prueba !
                logo.FromFile = "logo.png";
-               /* InitDemo (); */
+               /*InitDemo ();*/
                Application.Run();
        }
        
                Application.Run();
        }
        
@@ -90,6 +90,15 @@ public class App
                p4.Nombre = "Aplique clavos fractura multiple";
                p4.Categoria = c2;
 
                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);
                ObjectContainer db;
                db = Db4o.openFile("os.yap");
                db.set (p1);
index 866a334fa9b45c448f7a84ea887d6ce9936f1efc..e0276faa96f77bdbb957ad88b4f0c4c1de311dad 100644 (file)
@@ -85,8 +85,12 @@ public class VAgregarAfiliado
                ETipoDocumento tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)model.GetValue (parent, 0), true);
                int nroDoc = (int)model.GetValue (parent, 1);
 
                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 */
                /* 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 */
                Console.WriteLine ("Titular afiliado!! {0} {1}", tipoDoc, nroDoc);
 
                /* Obtengo el primer familiar, si es que existe */
diff --git a/demo/src/Vistas/BuscarPlan.cs b/demo/src/Vistas/BuscarPlan.cs
new file mode 100644 (file)
index 0000000..ef691d1
--- /dev/null
@@ -0,0 +1,69 @@
+
+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;
+       }
+}
+
index 029cef981f6ded5371a1efe4ac8be405fa5665ff..939eaed44001a6cd25e46d546f46db55bf4bc552 100644 (file)
@@ -9,6 +9,7 @@ using Controlador;
 using Controlador.Afiliacion;
 using Dominio.Afiliados;
 using Dominio.Autorizaciones;
 using Controlador.Afiliacion;
 using Dominio.Afiliados;
 using Dominio.Autorizaciones;
+using Dominio.Planes;
 using Dominio;
 
 public class VRevisarAutorizacionManual
 using Dominio;
 
 public class VRevisarAutorizacionManual
@@ -34,6 +35,9 @@ public class VRevisarAutorizacionManual
        [Widget] Label cobertura;
        [Widget] Entry consumo_actual;
        [Widget] Entry consumo_limite;
        [Widget] Label cobertura;
        [Widget] Entry consumo_actual;
        [Widget] Entry consumo_limite;
+       [Widget] TextView observaciones;
+
+       float percent_cobertura;
 
        public VRevisarAutorizacionManual ()
        {
 
        public VRevisarAutorizacionManual ()
        {
@@ -70,6 +74,7 @@ public class VRevisarAutorizacionManual
                
                codigo.Text = String.Format ("{0}", a.Codigo);
                fechaSolicitud.Text = a.FechaSolicitud.ToString ();
                
                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;
                prestacion_nombre.Text = a.Prestacion.Nombre;
                prestacion_codigo.Text = a.Prestacion.Codigo;
                prestador_nombre.Text = a.Prestador.Nombre;
@@ -83,15 +88,31 @@ public class VRevisarAutorizacionManual
                        estado_cuenta.Text = "No se registra deuda del Afiliado";
                else
                        estado_cuenta.Text = String.Format ("El afiliado debe {0} meses.", a.Afiliado.Moroso);
                        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
                 */
                /* 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 ();
                Dialog v = (Dialog)xml_revisar.GetWidget ("revisar_autorizacion");
                v.Run ();
                v.Destroy ();
@@ -105,12 +126,32 @@ public class VRevisarAutorizacionManual
                        Console.WriteLine ("Cerrando");
                        return; 
                }
                        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) {
                if (((int)args.ResponseId) == 0) {
-                       Console.WriteLine ("Aprobado");
+                       percent = percent_cobertura;
                }
                if (((int)args.ResponseId) == 1) {
                }
                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 ()
        }
 
        private void CargarAutorizaciones ()