<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>
<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>
using Dominio.Planes;
using Dominio;
using com.db4o;
+using com.db4o.query;
using System;
using System.Collections;
}
- 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)
{
/* 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)
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 ();
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 ();
}
}
--- /dev/null
+
+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 ();
+ }
+}
+
}
}
+ c.Visitado (tipoDoc, nroDoc);
+
c.Dispose ();
store.Remove (ref iter);
}