1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- unit ReportConnection;
- interface
- uses
- ADODB, ProjectData, ReportManager, rpgGatherControl;
- type
- TReportConnection = class
- private
- FProjectData: TProjectData;
- FConnection: TADOConnection;
- FCommonGather: TrpgGatherControl;
- public
- constructor Create(AProjectData: TProjectData);
- destructor Destroy; override;
- procedure RefreshConnection(ATemplate: TTemplateNode);
- property Connection: TADOConnection read FConnection;
- end;
- implementation
- { TReportConnection }
- constructor TReportConnection.Create(AProjectData: TProjectData);
- begin
- FProjectData := AProjectData;
- FCommonGather := TrpgGatherControl.Create(AProjectData.ProjectID);
- end;
- destructor TReportConnection.Destroy;
- begin
- FCommonGather.Free;
- inherited;
- end;
- procedure TReportConnection.RefreshConnection(ATemplate: TTemplateNode);
- begin
- case ATemplate.DataBaseFlag of
- 0: FConnection := FProjectData.ADOConnection;
- 1: FConnection := FCommonGather.RefreshConnection;
- end;
- end;
- end.
|