</packing>
</child>
+ <child>
+ <widget class="GtkToolButton" id="toolbutton5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Registrar
+ Visitas</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-open</property>
+ <property name="visible_horizontal">True</property>
+ <property name="visible_vertical">True</property>
+ <property name="is_important">False</property>
+ <signal name="clicked" handler="OnRegistrarVisitas" last_modification_time="Thu, 16 Jun 2005 02:29:25 GMT"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+
<child>
<widget class="GtkToolButton" id="toolbutton3">
<property name="visible">True</property>
<glade-interface>
<widget class="GtkDialog" id="registrar_visitas">
+ <property name="width_request">420</property>
+ <property name="height_request">500</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Registrar Visitas</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<child>
<widget class="GtkVBox" id="vbox3">
- <property name="border_width">8</property>
+ <property name="border_width">12</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
- <widget class="GtkTreeView" id="treeview1">
+ <widget class="GtkTreeView" id="visitas">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <signal name="clicked" handler="OnEstablecerPendiente" last_modification_time="Thu, 16 Jun 2005 02:38:13 GMT"/>
</widget>
</child>
--- /dev/null
+
+namespace Controlador {
+namespace Afiliacion {
+
+using Dominio.Afiliados;
+using Dominio.Planes;
+using Dominio;
+using com.db4o;
+
+using System;
+using System.Collections;
+
+public class RegistrarVisitasController : Controller
+{
+ private Promotor _promotor;
+
+ public RegistrarVisitasController (Promotor p):base ()
+ {
+ //_promotor = p;
+ Promotor a = new Promotor (ETipoDocumento.DNI, 12345678, null, null);
+ ObjectSet result = Db.get (a);
+ _promotor = (Promotor)result.next ();
+ }
+
+ public ArrayList ObtenerSolicitantesAsignados ()
+ {
+ Solicitante s = new Solicitante (0, 0, null, null);
+ s.Promotor = _promotor;
+
+ ObjectSet result = Db.get (s);
+ return ObjectSetToArrayList (result);
+ }
+
+ public void EstablecerPendiente (ETipoDocumento tipoDoc, int nroDoc)
+ {
+ /* Obtengo el solicitante */
+ Solicitante s = new Solicitante (tipoDoc, nroDoc, null, null);
+ ObjectSet result = Db.get (s);
+ s = (Solicitante)result.next ();
+ s.Promotor = null;
+ Db.set (s);
+ }
+}
+
+}
+}
+
v.Run ();
}
+ public void OnRegistrarVisitas (object o, EventArgs args)
+ {
+ VRegistrarVisitas v = new VRegistrarVisitas ();
+ v.Run ();
+ }
+
public void OnConsultarAfiliadoClose (object o, EventArgs args)
{
wConsultarAfiliado.Destroy ();
--- /dev/null
+
+
+using System;
+using System.Collections;
+using Gtk;
+using Glade;
+
+using Controlador;
+using Controlador.Afiliacion;
+using Dominio.Afiliados;
+using Dominio;
+
+public class VRegistrarVisitas
+{
+ Glade.XML xml;
+
+ [Widget] TreeView visitas;
+
+ public VRegistrarVisitas ()
+ {
+ xml = new Glade.XML (null, "registrar_visitas.glade", "registrar_visitas", null);
+ xml.Autoconnect (this);
+
+ RegistrarVisitasController c = new RegistrarVisitasController (null);
+
+ ArrayList l = c.ObtenerSolicitantesAsignados ();
+
+ visitas.Model = new ListStore (typeof(string), typeof(int), typeof (string), typeof (string));
+
+ visitas.HeadersVisible = true;
+ visitas.AppendColumn ("Tipo Doc.", new CellRendererText (), "text", 0);
+ visitas.AppendColumn ("Nro Doc.", new CellRendererText (), "text", 1);
+ visitas.AppendColumn ("Apellido", new CellRendererText (), "text", 2);
+ visitas.AppendColumn ("Nombre", new CellRendererText (), "text", 3);
+
+ ListStore store = (ListStore)visitas.Model;
+ foreach (Solicitante s in l) {
+ TreeIter iter = store.AppendValues (s.TipoDocumento.ToString (), s.NroDocumento, s.Nombre, s.Apellido);
+ Console.WriteLine ("Agregando {0}", s.Nombre);
+ }
+ c.Dispose ();
+ }
+
+ public void OnEstablecerPendiente (object o, EventArgs args)
+ {
+ TreeSelection fromSel = visitas.Selection;
+ TreeIter iter;
+ TreeModel model;
+ ListStore store = (ListStore)visitas.Model;
+
+ if (fromSel.GetSelected (out model, out iter) == false) {
+ /* Nada seleccionado */
+ return;
+ }
+ ETipoDocumento tipoDoc;
+ int nroDoc;
+ tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)store.GetValue (iter, 0), true);
+ nroDoc = (int)store.GetValue (iter, 1);
+
+ RegistrarVisitasController c = new RegistrarVisitasController (null);
+ c.EstablecerPendiente (tipoDoc, nroDoc);
+ c.Dispose ();
+ }
+
+ public void Run ()
+ {
+ Dialog w = (Dialog)xml.GetWidget ("registrar_visitas");
+ w.Run ();
+ w.Destroy ();
+ }
+}
+