]> git.llucax.com Git - z.facultad/75.10/miklolife.git/commitdiff
* 10 minutos mas y tenemos nuestro primer afiliado :)
authorRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 4 Jul 2005 03:08:00 +0000 (03:08 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Mon, 4 Jul 2005 03:08:00 +0000 (03:08 +0000)
demo/glade/agregar_afiliado.glade
demo/glade/main.glade
demo/src/Controlador/AfiliadoSolicitanteController.cs
demo/src/Controlador/RegistrarVisitasController.cs
demo/src/Main.cs
demo/src/Vistas/AgregarAfiliado.cs [new file with mode: 0644]
demo/src/Vistas/RegistrarVisitas.cs

index 98b7a7609baa9e01784efba6b1ccc818074972f2..148ad505049f2aa3429a39f9bb551d81a777b65d 100644 (file)
@@ -16,6 +16,7 @@
   <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">
                      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
                      <child>
-                       <widget class="GtkTreeView" id="treeview1">
+                       <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>
                  <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>
                  <property name="can_focus">True</property>
                  <property name="relief">GTK_RELIEF_NORMAL</property>
                  <property name="focus_on_click">True</property>
+                 <signal name="clicked" handler="OnAfiliar" last_modification_time="Mon, 04 Jul 2005 02:27:49 GMT"/>
 
                  <child>
                    <widget class="GtkAlignment" id="alignment5">
                              <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="padding">0</property>
index 7555ae554cac5bde7e319e07ad4ba98c5069284e..f058d10dce7dffda2adb53ceb9c92a4344251316 100644 (file)
                      <signal name="activate" handler="OnRegistrarVisitas" last_modification_time="Sun, 26 Jun 2005 00:09:38 GMT"/>
                    </widget>
                  </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separador2">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="afiliar1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Agregar Afiliados</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="OnAgregarAfiliado" last_modification_time="Mon, 04 Jul 2005 02:36:05 GMT"/>
+                   </widget>
+                 </child>
                </widget>
              </child>
            </widget>
index dfa25528c7192c27610fa2527f41b8ac6541a2be..59c7750961f3a35080e1da51070c0dd3006ccd8f 100644 (file)
@@ -5,6 +5,7 @@ using Dominio.Afiliados;
 using Dominio.Planes;
 using Dominio;
 using com.db4o;
+using com.db4o.query;
 
 using System;
 using System.Collections;
@@ -19,9 +20,18 @@ public class AfiliadoSolicitanteController : Controller
        }
 
 
-       public ArrayList obtenerSolicitantesAfiliar ()
+       public ArrayList ObtenerSolicitantesAfiliar ()
        {
-               return _solicitantes;
+               Query query = Db.query();
+               query.constrain(typeof(Solicitante));
+               query.descend("_promotor").constrain(null);
+               query.descend("_pendiente").constrain(false);
+               query.descend("_titular").constrain(null);
+
+               ObjectSet result = query.execute();
+               ArrayList lst = ObjectSetToArrayList (result);
+
+               return lst;
        }
 
        public bool ExisteAfiliado (ETipoDocumento tipoDoc, int nroDoc)
index d1966fb41f6187576d2cdfeaf438db1391ffdca8..5949704f26757fcdb6240bd5de09435425876a02 100644 (file)
@@ -55,10 +55,19 @@ public class RegistrarVisitasController : Controller
        {
                /* Obtengo el solicitante */
                Solicitante s = new Solicitante (tipoDoc, nroDoc, null, null);
+               s.Pendiente = false;
+               s.Promotor = _promotor;
+
                ObjectSet result = Db.get (s);
                s = (Solicitante)result.next ();
-               s.Promotor = null;
-               Db.set (s);
+
+               if (s == null) {
+                       Console.WriteLine ("Error, No se encontre Solicitante {0} {1}", tipoDoc, nroDoc);
+               } else {
+                       s.Promotor = null;
+                       s.Pendiente = false;
+                       Db.set (s);
+               }
        }
 
        public int ObtenerCantidadFamiliares (ETipoDocumento tipoDoc, int nroDoc)
index aa083cc74343ed5f6d29aa2632288ffdd891be63..3f1e69de1046275b082489bfd2e0eac919f8bc48 100644 (file)
@@ -80,6 +80,13 @@ public class App
                v.Run ();
        }
 
+       public void OnAgregarAfiliado (object o, EventArgs args)
+       {
+               VAgregarAfiliado v = new VAgregarAfiliado ();
+               v.Run ();
+       }
+
+
        public void OnMantenerPlanes (object o, EventArgs args)
        {
                VMantenerPlanes v = new VMantenerPlanes ();
@@ -88,11 +95,8 @@ public class App
 
        public void OnRegistrarVisitas (object o, EventArgs args)
        {
-               ABMGenerico g = new ABMGenerico (typeof(Plan));
-               g.Run ();
-               return;
-               /*VRegistrarVisitas v = new VRegistrarVisitas ();
-               v.Run ();*/
+               VRegistrarVisitas v = new VRegistrarVisitas ();
+               v.Run ();
        }
 }
 
diff --git a/demo/src/Vistas/AgregarAfiliado.cs b/demo/src/Vistas/AgregarAfiliado.cs
new file mode 100644 (file)
index 0000000..b607752
--- /dev/null
@@ -0,0 +1,54 @@
+
+using System;
+using System.Collections;
+using Gtk;
+using Glade;
+
+using Controlador.Afiliacion;
+using Dominio.Afiliados;
+using Dominio;
+
+public class VAgregarAfiliado
+{
+       Glade.XML xml;
+       [Widget] TreeView lista;
+
+       public VAgregarAfiliado ()
+       {
+               xml = new Glade.XML (null, "agregar_afiliado.glade", "agregar_afiliado", null);
+               xml.Autoconnect (this);
+
+               ListStore store = new ListStore (typeof(string), typeof(int), typeof (string), typeof (string));
+               lista.Model = store;
+
+               /* Columnas */
+               lista.HeadersVisible = true;
+               lista.AppendColumn ("Tipo Doc.", new CellRendererText (), "text", 0);
+               lista.AppendColumn ("Nro Doc.", new CellRendererText (), "text", 1);
+               lista.AppendColumn ("Apellido", new CellRendererText (), "text", 2);
+               lista.AppendColumn ("Nombre", new CellRendererText (), "text", 3);
+
+               ArrayList afiliados;
+               AfiliadoSolicitanteController c = new AfiliadoSolicitanteController ();
+               afiliados = c.ObtenerSolicitantesAfiliar ();
+
+               foreach (Solicitante s in afiliados) {
+                       TreeIter iter = store.AppendValues (s.TipoDocumento.ToString (), s.NroDocumento, s.Nombre, s.Apellido);
+               }
+
+               c.Dispose ();
+       }
+
+       public void OnAfiliar (object o, EventArgs args)
+       {
+               
+       }
+
+       public void Run ()
+       {
+               Dialog w = (Dialog)xml.GetWidget ("agregar_afiliado");
+               w.Run ();
+               w.Destroy ();
+       }
+}
+
index e4d05e1a21c1a50f01c6a0ad5c9d3c553d3dee5a..9390248c5e86c43401020cfb8e53e8d7f23df119 100644 (file)
@@ -130,6 +130,8 @@ public class VRegistrarVisitas
                        }
                }
 
+               c.Visitado (tipoDoc, nroDoc);
+
                c.Dispose ();
                store.Remove (ref iter);
        }