home *** CD-ROM | disk | FTP | other *** search
- program OORDB;
-
- uses
- Forms,
- SysUtils,
- Mapping in 'Mapping.pas',
- DataMod in 'P:\Delphi2\Demos\DB\MASTAPP\Datamod.pas' {MastData: TDataModule},
- Mastapp in 'Mastapp.pas';
-
- {$R *.RES}
- var
- c, c2 :TCustomer;
- o :TOrder;
- i, j, k,
- Times :Integer;
- begin
- try
- Randomize;
- for Times :=1 to 2 do begin
- for k := 0 to MastMap.Customers.Count-1 do begin
- i := Random(MastMap.Customers.Count);
- c := MastMap.Customers[i];
- WriteLn('Cust[',i,'] = CustNo ', c.CustNo, ' #orders ', c.Orders.Count);
- for j := 0 to c.Orders.Count-1 do begin
- o := c.Orders[j];
- Write(' Order[',j,'] = ', o.OrderNo);
- if o.Customer = c then
- Writeln(' fine.')
- else begin
- Write(' has customer ', c.Orders[j].Customer.CustNo);
- Write(', inconsistent.');
- c2 := TCustomer(MastMap.Customers.FindInCached(c.CustNo));
- Writeln(' Cached is', IntToHex(Longint(c2), 8))
- end
- end
- end
- end;
- except
- end;
- end.
-