]> git.llucax.com Git - z.facultad/75.10/miklolife.git/commitdiff
* Algunas cosas necesarias para dar de alta planes, como se buscar prestaciones.
authorRicardo Markiewicz <gazer.arg@gmail.com>
Tue, 5 Jul 2005 06:19:54 +0000 (06:19 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Tue, 5 Jul 2005 06:19:54 +0000 (06:19 +0000)
demo/glade/buscar_prestacion.glade [new file with mode: 0644]
demo/glade/main.glade
demo/src/Controlador/PrestacionesController.cs [new file with mode: 0644]
demo/src/Dominio/Categoria.cs
demo/src/Dominio/Prestacion.cs
demo/src/Main.cs
demo/src/Vistas/ABMGenerico.cs
demo/src/Vistas/BuscarPrestacion.cs [new file with mode: 0644]

diff --git a/demo/glade/buscar_prestacion.glade b/demo/glade/buscar_prestacion.glade
new file mode 100644 (file)
index 0000000..19c53a8
--- /dev/null
@@ -0,0 +1,300 @@
+<?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_prestacion">
+  <property name="width_request">400</property>
+  <property name="height_request">450</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Buscar Prestación</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="Tue, 05 Jul 2005 05:49:12 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="cerrar">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-close</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">-7</property>
+           </widget>
+         </child>
+
+         <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">Select</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="frame1">
+             <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="alignment1">
+                 <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="table1">
+                     <property name="border_width">12</property>
+                     <property name="visible">True</property>
+                     <property name="n_rows">2</property>
+                     <property name="n_columns">3</property>
+                     <property name="homogeneous">False</property>
+                     <property name="row_spacing">5</property>
+                     <property name="column_spacing">5</property>
+
+                     <child>
+                       <widget class="GtkLabel" id="label3">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Categoría :</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="GtkHButtonBox" id="hbuttonbox2">
+                         <property name="visible">True</property>
+                         <property name="layout_style">GTK_BUTTONBOX_END</property>
+                         <property name="spacing">0</property>
+
+                         <child>
+                           <widget class="GtkButton" id="buscar">
+                             <property name="visible">True</property>
+                             <property name="can_default">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="label">gtk-find</property>
+                             <property name="use_stock">True</property>
+                             <property name="relief">GTK_RELIEF_NORMAL</property>
+                             <property name="focus_on_click">True</property>
+                             <signal name="clicked" handler="OnBuscar" last_modification_time="Tue, 05 Jul 2005 05:53:40 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">2</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkComboBox" id="categoria">
+                         <property name="visible">True</property>
+                         <property name="items" translatable="yes">
+</property>
+                         <property name="add_tearoffs">False</property>
+                         <property name="focus_on_click">True</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">1</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">0</property>
+                         <property name="bottom_attach">1</property>
+                         <property name="y_options">fill</property>
+                       </packing>
+                     </child>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label1">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;Criterios de Búsqueda&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">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+
+         <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;Coincidencias&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 f058d10dce7dffda2adb53ceb9c92a4344251316..5f804db628582b8f049d41c3656e61308eb7737c 100644 (file)
              <child>
                <widget class="GtkMenu" id="mantenimiento1_menu">
 
+                 <child>
+                   <widget class="GtkMenuItem" id="prestadores1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Prestadores</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="OnMantenerPrestadores" last_modification_time="Tue, 05 Jul 2005 05:30:38 GMT"/>
+                   </widget>
+                 </child>
+
                  <child>
                    <widget class="GtkMenuItem" id="planes1">
                      <property name="visible">True</property>
diff --git a/demo/src/Controlador/PrestacionesController.cs b/demo/src/Controlador/PrestacionesController.cs
new file mode 100644 (file)
index 0000000..1bdf845
--- /dev/null
@@ -0,0 +1,32 @@
+
+namespace Controlador {
+namespace Afiliacion {
+
+using Dominio.Autorizaciones;
+using Dominio;
+using com.db4o;
+using com.db4o.query;
+
+using System;
+using System.Collections;
+
+public class PrestacionesController : Controller 
+{
+
+       public ArrayList Categorias ()
+       {
+               Categoria c = new Categoria ();
+               c.Codigo = 0;
+               c.Nombre = null;
+
+               ObjectSet result = Db.get (c);
+               ArrayList lst = ObjectSetToArrayList (result);
+
+               return lst;
+       }
+
+}
+
+}
+}
+
index 7fc7cfb1326f119f47d8580ee91d41137e3385ee..21bb26a7bf9c02bad812df81faa6a44021100d03 100644 (file)
@@ -5,9 +5,9 @@ using System;
 
 public class Categoria
 {
-       private int _codigo;
-       private string _nombre;
-       private DateTime _fechaBajar;
+       public int Codigo;
+       public string Nombre;
+       DateTime _fechaBajar = DateTime.MinValue;
 }
 
 }
index 17b4dee76b3d6e2a39dd13c9e9fb3229f43dd6be..01e585f6849c1875a645f7192b81ea808788d18e 100644 (file)
@@ -6,11 +6,11 @@ using System.Collections;
 
 public class Prestacion 
 {
-       private string _codigo;
-       private string _nombre;
-       private DateTime _fechaBaja;
-       private ArrayList _prestadores;
-       private Categoria _categoria;
+       public string Codigo;
+       public string Nombre;
+       DateTime _fechaBaja = DateTime.MinValue;
+       ArrayList _prestadores = null;
+       public Categoria Categoria;
 
        public bool AgregarPrestador (Prestador p)
        {
index 49985f95e51a1d9e05db3ae6876d82db03c75f30..24a7a48a5192337b40667a114b12e772e1206299 100644 (file)
@@ -5,6 +5,7 @@ using Gtk;
 using Glade;
 using Dominio.Afiliados;
 using Dominio.Planes;
+using Dominio.Autorizaciones;
 using com.db4o;
 using com.db4o.query;
 
@@ -57,7 +58,46 @@ public class App
        
        private void InitDemo ()
        {
-
+               
+               #warning Descomentar para inicializar la base de datos con algunos valores de prueba !
+               return;
+
+               /* Algunas categorias */
+               Categoria c1 = new Categoria ();
+               c1.Codigo = 1;
+               c1.Nombre = "Odontologia";
+
+               Categoria c2 = new Categoria ();
+               c2.Codigo = 2;
+               c2.Nombre = "Traumatologia";
+
+               Prestacion p1 = new Prestacion ();
+               p1.Codigo = "101010";
+               p1.Nombre = "Extracion Muelas de Juicio";
+               p1.Categoria = c1;
+
+               Prestacion p2 = new Prestacion ();
+               p2.Codigo = "101011";
+               p2.Nombre = "Aplique de Fluor";
+               p2.Categoria = c1;
+
+               Prestacion p3 = new Prestacion ();
+               p3.Codigo = "201010";
+               p3.Nombre = "Yeso parcial";
+               p3.Categoria = c2;
+
+               Prestacion p4 = new Prestacion ();
+               p4.Codigo = "201011";
+               p4.Nombre = "Aplique clavos fractura multiple";
+               p4.Categoria = c2;
+
+               ObjectContainer db;
+               db = Db4o.openFile("os.yap");
+               db.set (p1);
+               db.set (p2);
+               db.set (p3);
+               db.set (p4);
+               db.close ();
        }
 
        public void OnSalirActivate (object o, EventArgs args)
@@ -95,6 +135,12 @@ public class App
                v.Run ();
        }
 
+       public void OnMantenerPrestadores (object o, EventArgs args)
+       {
+               VBuscarPrestacion v = new VBuscarPrestacion ();
+               v.Run ();
+       }
+
        public void OnRegistrarVisitas (object o, EventArgs args)
        {
                VRegistrarVisitas v = new VRegistrarVisitas ();
index ceb15d32d21ffcabf25845bba2b8ab2b43fca36b..9a757864bb600750932837c0cbeb38c4abeb788b 100644 (file)
@@ -97,9 +97,10 @@ public class ABMGenerico
                c.Dispose ();
        }
        
-       public void Run ()
+       public void Run (string title)
        {
                Dialog w = (Dialog)xml.GetWidget ("abm_one");
+               w.Title = title;
                w.Run ();
                w.Destroy ();
        }
diff --git a/demo/src/Vistas/BuscarPrestacion.cs b/demo/src/Vistas/BuscarPrestacion.cs
new file mode 100644 (file)
index 0000000..c908752
--- /dev/null
@@ -0,0 +1,65 @@
+
+using System;
+using System.Collections;
+using Gtk;
+using Glade;
+
+using Controlador.Afiliacion;
+using Dominio.Autorizaciones;
+using Dominio;
+
+public class VBuscarPrestacion
+{
+       Glade.XML xml;
+
+       ComboBox categoria;
+       TreeView lista;
+
+       public VBuscarPrestacion ()
+       {
+               xml = new Glade.XML (null, "buscar_prestacion.glade", "buscar_prestacion", null);
+               xml.Autoconnect (this);
+
+               categoria = (ComboBox)xml.GetWidget ("categoria");
+               lista = (TreeView)xml.GetWidget ("lista");
+
+               lista.Model = new ListStore (typeof(string), typeof(string), typeof(string), typeof (DateTime));
+
+               /* Columnas */
+               lista.HeadersVisible = true;
+               lista.AppendColumn ("Codigo", new CellRendererText (), "text", 0);
+               lista.AppendColumn ("Nombre", new CellRendererText (), "text", 1);
+               lista.AppendColumn ("Cagetoria", new CellRendererText (), "text", 2);
+               lista.AppendColumn ("Fecha Baja", new CellRendererText (), "text", 3);
+
+               /* Cargo las categorias */
+               ListStore l = (ListStore)categoria.Model;
+               l.Clear ();
+               PrestacionesController c = new PrestacionesController ();
+
+               ArrayList lst = c.Categorias ();
+               foreach (Categoria p in lst) {
+                       l.AppendValues (String.Format ("{0}", p.Nombre));
+               }
+               c.Dispose ();
+       }
+
+       public void OnDialogResponse (object o, ResponseArgs args)
+       {
+               if (args.ResponseId == ResponseType.Cancel)
+                       return; 
+       }
+
+       public void OnBuscar (object o, EventArgs args)
+       {
+
+       }
+
+       public void Run ()
+       {
+               Dialog w = (Dialog)xml.GetWidget ("buscar_prestacion");
+               w.Run ();
+               w.Destroy ();
+       }
+}
+