Ver Mensaje Individual
  #10  
Antiguo 18-12-2008
DANY DANY is offline
Miembro
 
Registrado: nov 2003
Posts: 145
Reputación: 23
DANY Va por buen camino
Lo logre!!!

Metodos de mi clase :
Código Delphi [-]
function TCuentasContables.DevuelveSaldoCuenta: Double;
begin

  //Si la cuenta es imputable devuelvo el valor saldo cuenta cargado de la BD una vez creada la cuenta
  if CuentaImputable  then
    Result := SaldoCuenta
 //Si no lo es itero hasta llegar a cuentas imputables.
  Else
    Result := Result + DevuelveSaldoCuentasHijas ;

end;

Código Delphi [-]
function TCuentasContables.DevuelveSaldoCuentasHijas: Double;
var
  I : Integer;
begin
  if not Assigned(CuentasHijas) then
  Begin
    Result :=0;
    Exit;
  End;

  for I := 0 to CuentasHijas.Count-1 do
    Result := Result +TCuentasContables(CuentasHijas.Items[i]).DevuelveSaldoCuenta ;

end;

Luego desde el form para mostrar en el arbol:
Código Delphi [-]
  for N :=1  to tvArbol.Items.Count -1 do
    tvArbol.Items [N].Text := tvArbol.Items [N].Text +' ( '+ FormatFloat ('$0.00', TCuentasContables (tvArbol.Items [N].Data ).DevuelveSaldoCuenta )+' )';

Gracias a todos.
Mision Cumplida!!!
Responder Con Cita