+ ETipoDocumento tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)model.GetValue (parent, 0), true);
+ int nroDoc = (int)model.GetValue (parent, 1);
+
+ /* Selecciono plan */
+ VBuscarPlan v = new VBuscarPlan ();
+ string plan = v.Run ();
+
+ /* Afilio el titular */
+ Afiliado AfiTitular = c.AfiliarTitular (tipoDoc, nroDoc, Int32.Parse (plan));
+ Console.WriteLine ("Titular afiliado!! {0} {1}", tipoDoc, nroDoc);
+
+ /* Obtengo el primer familiar, si es que existe */
+ TreeIter iter;
+ if (model.IterChildren (out iter, parent) == true) {
+ tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)model.GetValue (iter, 0), true);
+ nroDoc = (int)model.GetValue (iter, 1);
+
+ Console.WriteLine ("Titular familiar!! {0} {1}", tipoDoc, nroDoc);
+ while (model.IterNext (ref iter) == true) {
+ tipoDoc = (ETipoDocumento)Enum.Parse (typeof (ETipoDocumento), (string)model.GetValue (iter, 0), true);
+ nroDoc = (int)model.GetValue (iter, 1);
+
+ Console.WriteLine ("Titular familiar!! {0} {1}", tipoDoc, nroDoc);
+ c.AfiliarFamiliar (AfiTitular, tipoDoc, nroDoc, null);
+ }
+ }