AS MAYOR MARION Barry tells it, the corruption conviction of his longtime aide and chief political adviser, Ivanhoe Donaldson, shows that the District government's system of exposing wrongdoing works.

"It was our system that detected this," Barry said the day after Donaldson pleaded guilty to charges that he systematically stole nearly $200,000 in public funds over a three-year period. "It wasn't the news media ferreting it out. It wasn't the U.S. attorney finding it out. It was the D.C. government," the mayor said, alluding to an audit by Barry's inspector general's office that triggered the federal investigation that led to Donaldson's downfall.

However, a review of the facts in the Donaldson investigation offers a different interpretation of how it came to light. It shows a system that -- far from working -- failed to detect wrongdoing promptly and indeed discovered Donaldson's corruption only by accident.

Rather than showing a properly functioning system, the Donaldson affair exposed a number of problems in the city's procedures -- or lack of them -- for discovering corruption in the city government. Federal prosecutors had already spotted these defects and called attention to them in a memo filed with the U.S. District Court in a case that led to Donaldson's undoing. In that memo, the prosecutors said that they had found a "pervasive" situation in the District government "wherein administrative record keeping is sloppy, and through the absence of checks and balances, officials in responsible positions can steal the taxpayers' money with impunity."

Contrary to Barry's characterization, a close reading of the details of the Donaldson case as presented in court by the U.S. attorney's office and in inteviews with knowledgeable city and federal officials shows that:

The uncovering of the Donaldson case was a fluke. It grew out of an unrelated federal grand jury investigation into the city's Department of Employment Services that began in July 1984. That investigation was triggered by the complaint of the sister of the employment services director, who told police her child had been assaulted by her boyfriend, who had a contract with the department. In the course of reporting the assault, she also disclosed that her boyfriend was at the center of an illegal purchasing scheme. It was the unraveling of that scheme, initially by the U.S. attorney, that eventually exposed Donaldson.

The city's subsequent decision to examine a special Employment Services Department fund where the allegations against Donaldson were first found was a reaction to a federal grand jury's decision to investigate the fund.

The special administrative fund, which usually contained $250,000, had not been audited in the three years after the city took control of the account from the federal government. The fund operated outside the city's centralized financial management system, and Donaldson could both authorize and sign checks issued from the account without the approval of any other city officials.

Despite Barry's claims that the city has now strengthened controls over such accounts, Donaldson and other city officials routinely broke city rules in effect at the time, rules that if followed might have prevented at least some of Donaldson's misdeeds. Prosecutors found in many instances that documentation required by city rules was either nonexistent or was knowingly fabricated by city officials to accommodate Donaldson.

Donaldson's systematic diversion of nearly $200,000 in public funds was so complex and extensive -- taking place on 11 separate occasions between August 1981 and July 1984 -- that it involved a broad spectrum of District government officials. Prosecutors' court papers suggest that at least six Barry administration officials, including the deputy mayor for economic development, Curtis McClinton, Employment Services Director Matthew Shannon and one of his deputies, James George, failed to question Donaldson's actions -- and further that Shannon and George ignored questions raised by other city officials.

"Much of what happened throughout the Donaldson case was that people did not ask questions when Donaldson wanted something done," said Joyce Blalock, the former city inspector general who headed up the District's probe. "There was a tremendous reluctance to stand up to Donaldson."

City Council Chairman David A. Clarke said the Donaldson case has prompted him to examine other cities' systems for uncovering criminal wrongdoing to see if the D.C. system can be strengthened.

"What I'm concerned about is . . . why did it take three years for the information to surface?" Clarke asked.

Donaldson, whose relationship with Barry dates back more than 20 years to their work in the civil rights movement, pleaded guilty Dec. 10 to three felonies, interstate transportation of fraudulently obtained city funds, obstruction of justice and tax fraud. His plea climaxed a long investigation by Assistant U.S. Attorneys Daniel J. Bernstein, David F. Geneson and agents from the FBI and the Internal Revenue Service. He is scheduled to be sentenced Jan. 27 and is facing up to 23 years in prison and a maximun fine of $360,000.

Over the last decade Donaldson, who managed both of Barry's successful mayoral campaigns, became widely known as Barry's most trusted aide and political adviser. He followed Barry into office in 1979 as a general assistant and between October 1980 and May 1982 he served as acting head of the Department of Employment Services. He later was deputy mayor for economic development until he resigned to take a private-sector job in late 1983.

Politicians and city officials have said that Barry gave Donaldson wide authority to act on his behalf and that with rare exceptions Donaldson usually got his way.

Donaldson's power was so extensive -- and the city's auditing controls so weak -- that he was able to continue his illegal scheme even after he left city government, according to the evidence. In fact, his biggest single theft occurred in February and April 1984, several months after he left city government, when he ordered city officials to approve what turned out to be a sham $65,000 Department of Employment Services contract to a community group.

According to prosecutors, an initial $32,500 was paid to the community group in February 1984, even though city regulations said advance payments could not be made on this type of contract. The final payment of $32,500 was made in April 1984, despite city officials' knowing that the final work product had not been finished as required by the contract, prosecutors said.

Prosecutors said the payments were actually part of a scheme devised by Donaldson in which the community group served as a conduit through which $52,000 out of the $65,000 in city funds ended up in Donaldson's pockets.

The department first learned Donaldson wanted the contract awarded when McClinton, Donaldson's successor as deputy mayor for economic development, told Department Director Shannon that Donaldson wanted the contract. Shannon passed the word to subordinates and the contract was issued.

"The only reason why this contract went out and the $65,000 was paid was due to the extraordinary pressure from the Director [Shannon] or James George and Ms. Lillian Neal," a department official who was placed in charge of the contract even though she had no expertise to do so, prosecutors said.

In a separate incident in July 1983, prosecutors said, department employes were forced to invent on paper "without rhyme or reason" additional work on an existing department contract after Donaldson, at the time a deputy mayor and Shannon's boss, ordered Shannon to pay the contractor an additional $20,000. Again the change in the contract was a ploy to channel $18,000 of the $20,000 to Donaldson, who used the money to pay his personal expenses, prosecutors said. Department officials monitoring the contract told prosecutors they complained to Shannon that there was no written justification for the change, but he ordered them to modify the contract in order to allow the payment. Shannon admitted to prosecutors that he never saw anything in writing justifying the contract modification Donaldson requested, but Shannon said he assumed his staff would follow up on it.

Blalock and former D.C. Auditor Matthew Watson both said the Donaldson case demonstrates what happens when other city officials do not question irregular procedures.

Watson said the best safeguards against theft can always be broken. "No system is going to be invulnerable if people set out to beat it and other people wink their eyes," Watson said.

"I think there was basically a people problem rather than a structural problem with the system," Watson said. Other city officials were aware that proper procedures were not being followed, he said, "Why didn't they say something?"

The answer, he said, is that the District governnment traditionally has rewarded loyal employes who obey orders rather than whistle-blowers. "Jim George, as the deputy director of the Employment Services Department and Shannon as the director both were people with enough contact with the mayor's office and could have said something," Watson said. "But that was not considered an admirable trait."

Council Chairman Clarke said he doesn't want the Donaldson case to go by without the city developing procedures that will enable it to detect improper government spending more quickly.

"I am also concerned that the inspector general happened upon it by accident," Clarke said

The Donaldson investigation came to light as a result of a totally unrelated criminal investigation that was triggered by an assault on a child.

Angry at what happened, the child's mother told police about what appeared at the time to be a petty corruption case within the Department of Employment Services.

The child's mother happened to be the sister of employment services director Shannon and she was upset at her boyfriend for allegedly assaulting her child. She also told police that her boyfriend, Clarence B. Wade Jr., was at the center of an illegal purchasing scheme within the employment services department.

The investigation first became public when D.C. police said in a search warrant filed in court in July 1984 that Shannon alerted police to the possibly illegal purchasing scheme, which centered on Wade, a private contractor hired to run a department job-training program for high school students.

Shannon had arranged for Wade to get his city contract, according to Wade and statements made in court by prosecutors.

According to sources familiar with the the investigation, Shannon talked to police after his sister became upset at what Wade had done to her child and blurted out that Wade had furnished their apartment with fixtures purchased with city funds.

After rumors that Wade was being investigated surfaced within the employment-services department, two mid-level department employes, Crystal J. Willis and Dwayne Moore, went before a D.C. Superior Court grand jury and acknowledged they had been involved with Wade in purchasing household goods with city funds. The investigation later was shifted to a grand jury in U.S. District Court.

The grand jury began hearing evidence about contracts and purchases made by the department, which handles most of the city's job-training programs and administers the District's multimillion-dollar unemployment and workers-compensation programs.

After reports of the federal investigation surfaced, Barry in early August 1984 announced that he was firing Moore and Willis and that Blalock was investigating the department's financial controls.

Meanwhile, Willis, who was cooperating with the federal investigation, tipped prosecutors that other department officials might have misused monies from the agency's special administrative fund, sources said. On July 11, 1984, the grand jury subpoenaed records for the special administrative fund along with a variety of other department files. It was in the special administrative fund that Blalock found questionable checks that ultimately triggered the Donaldson investigation.

Blalock said recently that she asked her staff to examine the fund after she learned that prosecutors were investigating it.

Said one source familiar with the investigation: "It wasn't the financial auditors at employment services that found out about the fund . . . . Prosecutors got Willis and she said she heard rumors about the special adminstrative fund. It wasn't the internal D.C. system that heard that. The inspector general's staff examined the fund because prosecutors subpoenaed it."

The source said Donaldson was "like the guy who committed the perfect crime but who could not foresee the unforeseen. If it had not been for the assault case none of this would have come out," the source said.

Under the current system, the city's two principal internal investigative agencies are the office of inspector general, which reports directly to the mayor, and the D.C. auditor, which is appointed by the council and works for that body. The Government Accounting Office, the auditing arm of Congress, also examine city agencies.

Blalock, who was inspector general for five years until last March when she became the inspector general for the U.S. Government Printing Office, said her office had "very, very few resources" compared to the size of the District government, but she said it still did an effective job.

The District has an annual budget of over $2 billion, employs nearly 30,000 workers and each year awards more than $500 million in contracts to private consultants and firms. The city inspector general has a staff of 25, including clerical workers, and an $895,000 budget.

Blalock said she could not recall specifically how many cases her office referred to the U.S. Attorney's office for prosecution, but she knows offhand that there were "several."

Besides the Donaldson case, she said the office's other major case was an investigation that led to the ouster of Mildred Bautista, the former executive director of the D.C. Commission on Arts and Humanities who was convicted of stealing nearly $24,000 in agency funds.

An official in the U.S. Attorney's office said the number of cases of any kind referred to prosecutors by the city inspector general's office is "abysmally small."