]> git.llucax.com Git - z.facultad/75.10/miklolife.git/commitdiff
Done, busqueda simple de afiliados, muestra todos los datos
authorRicardo Markiewicz <gazer.arg@gmail.com>
Wed, 6 Jul 2005 22:47:27 +0000 (22:47 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Wed, 6 Jul 2005 22:47:27 +0000 (22:47 +0000)
demo/glade/consultar_afiliado.glade
demo/src/Vistas/ConsultarAfiliado.cs

index 3de2c963ab7a722331be11c0c99203ed9c791a60..858605a23879a43cfd660d5ce1370dff9bae69b5 100644 (file)
@@ -757,24 +757,7 @@ LC</property>
                              <property name="spacing">0</property>
 
                              <child>
-                               <widget class="GtkComboBox" id="tipoDoc">
-                                 <property name="visible">True</property>
-                                 <property name="items" translatable="yes">DNI
-LC
-LE
-CI</property>
-                                 <property name="add_tearoffs">False</property>
-                                 <property name="focus_on_click">True</property>
-                               </widget>
-                               <packing>
-                                 <property name="padding">0</property>
-                                 <property name="expand">False</property>
-                                 <property name="fill">True</property>
-                               </packing>
-                             </child>
-
-                             <child>
-                               <widget class="GtkEntry" id="nroDoc">
+                               <widget class="GtkEntry" id="documento">
                                  <property name="visible">True</property>
                                  <property name="can_focus">True</property>
                                  <property name="editable">False</property>
@@ -822,7 +805,7 @@ CI</property>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
-                                 <property name="expand">False</property>
+                                 <property name="expand">True</property>
                                  <property name="fill">True</property>
                                </packing>
                              </child>
@@ -1172,24 +1155,6 @@ CI</property>
                            </packing>
                          </child>
 
-                         <child>
-                           <widget class="GtkComboBox" id="provincia">
-                             <property name="visible">True</property>
-                             <property name="items" translatable="yes">Rio Negro
-Neuquen</property>
-                             <property name="add_tearoffs">False</property>
-                             <property name="focus_on_click">True</property>
-                           </widget>
-                           <packing>
-                             <property name="left_attach">3</property>
-                             <property name="right_attach">4</property>
-                             <property name="top_attach">2</property>
-                             <property name="bottom_attach">3</property>
-                             <property name="x_options">fill</property>
-                             <property name="y_options">fill</property>
-                           </packing>
-                         </child>
-
                          <child>
                            <widget class="GtkLabel" id="label22">
                              <property name="visible">True</property>
@@ -1309,6 +1274,27 @@ Neuquen</property>
                              <property name="y_options"></property>
                            </packing>
                          </child>
+
+                         <child>
+                           <widget class="GtkEntry" id="provincia">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="editable">False</property>
+                             <property name="visibility">True</property>
+                             <property name="max_length">0</property>
+                             <property name="text" translatable="yes"></property>
+                             <property name="has_frame">True</property>
+                             <property name="invisible_char">*</property>
+                             <property name="activates_default">False</property>
+                           </widget>
+                           <packing>
+                             <property name="left_attach">3</property>
+                             <property name="right_attach">4</property>
+                             <property name="top_attach">2</property>
+                             <property name="bottom_attach">3</property>
+                             <property name="y_options"></property>
+                           </packing>
+                         </child>
                        </widget>
                      </child>
                    </widget>
index 073940f4bbeeb72d5dd2bbd60092a6a51d57fc47..0b865b7262e66f12aa9b8ad003a5f84a89c13c79 100644 (file)
@@ -17,12 +17,29 @@ public class VConsultarAfiliado
        [Widget] TreeView lista;
 
        /* Busqueda */
-       [Widget] Entry codigo;
        [Widget] ComboBox s_tipoDocumento;
        [Widget] Entry s_nroDocument;
        [Widget] Entry s_apellido;
        [Widget] Entry s_codigo;
 
+       /* Campos de datos */
+       [Widget] Entry documento;
+       [Widget] Entry nombre;
+       [Widget] Entry apellido;
+       [Widget] Entry email;
+       [Widget] RadioButton sexom;
+       [Widget] RadioButton sexof;
+       [Widget] Entry fechaNac;
+       [Widget] Entry calle;
+       [Widget] Entry numero;
+       [Widget] Entry piso;
+       [Widget] Entry dpto;
+       [Widget] Entry provincia;
+       [Widget] Entry codigopostal;
+       [Widget] Entry telefono;
+       [Widget] Entry deuda;
+       [Widget] Entry codigo;
+
        public VConsultarAfiliado ()
        {
                xml = new Glade.XML (null, "consultar_afiliado.glade", "consultar_afiliado", null);
@@ -41,6 +58,39 @@ public class VConsultarAfiliado
 
        public void OnVerAfiliado (object o, EventArgs args)
        {
+               TreeIter iter;
+               TreeModel model; 
+               TreeSelection sel = lista.Selection;
+
+               
+               if (sel.GetSelected(out model, out iter) == true) {
+                       ETipoDocumento tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)model.GetValue (iter, 1), true);
+                       int nroDoc = (int)model.GetValue (iter, 0);
+
+                       AfiliadoSolicitanteController c = new AfiliadoSolicitanteController ();
+                       Afiliado a = c.ExisteAfiliado (nroDoc);
+
+                       Console.WriteLine ("{0}",nroDoc);
+                       Console.WriteLine (a);
+                       documento.Text = String.Format ("{0} {1}", a.TipoDocumento.ToString(), a.NroDocumento);
+                       nombre.Text = a.Nombre;
+                       apellido.Text = a.Apellido;
+                       codigo.Text = String.Format ("{0}", a.Codigo);
+                       email.Text = a.EMail;
+                       fechaNac.Text = a.FechaNacimiento.ToString ();
+                       calle.Text = a.Direccion.Calle;
+                       numero.Text = String.Format ("{0}", a.Direccion.Numero);
+                       piso.Text = String.Format ("{0}", a.Direccion.Piso);
+                       dpto.Text = String.Format ("{0}", a.Direccion.Departamento);
+                       provincia.Text = a.Direccion.Provincia.ToString ();
+                       codigopostal.Text = a.Direccion.CodigoPostal;
+                       if (a.Moroso == 0)
+                               deuda.Text = "El Afiliado está al día con la cuota";
+                       else
+                               deuda.Text = String.Format ("El Afiliado debe {0} meses");
+
+                       c.Dispose ();
+               }
        }
 
        public void OnBuscarAfiliado (object o, EventArgs args)