Читайте также:
|
|
Приложение А.
Листинг программы
Файл Main.pas
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, Buttons, jpeg, ExtCtrls,
Client, Master, Service, ReportSave, ReportClient;
type
TFormMenu = class(TForm)
ADOConnectionMain: TADOConnection;
btnMaster: TBitBtn;
btnService: TBitBtn;
btnClient: TBitBtn;
btnReportService: TBitBtn;
btnReportClient: TBitBtn;
Image1: TImage;
procedure btnClientClick(Sender: TObject);
procedure btnMasterClick(Sender: TObject);
procedure btnServiceClick(Sender: TObject);
procedure btnReportServiceClick(Sender: TObject);
procedure btnReportClientClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMenu: TFormMenu;
implementation
{$R *.dfm}
procedure TFormMenu.btnClientClick(Sender: TObject);
begin
FormClient.ShowModal;
end;
procedure TFormMenu.btnMasterClick(Sender: TObject);
begin
FormMaster.ShowModal;
end;
procedure TFormMenu.btnServiceClick(Sender: TObject);
begin
FormService.ShowModal;
end;
procedure TFormMenu.btnReportServiceClick(Sender: TObject);
begin
FormReportService.ShowModal;
end;
procedure TFormMenu.btnReportClientClick(Sender: TObject);
begin
FormReportClient.ShowModal;
end;
end.
Файл Master.pas
unit Master;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, ExtCtrls, DBCtrls;
type
TFormMaster = class(TForm)
DBGridMaster: TDBGrid;
DBNavigatorMaster: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMaster: TFormMaster;
implementation
{$R *.dfm}
end.
Файл Service.pas
unit Service;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, Grids, DBGrids;
type
TFormService = class(TForm)
DBGrid1: TDBGrid;
DBEditPrice: TDBEdit;
DBEditSrok: TDBEdit;
Label1: TLabel;
Label2: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormService: TFormService;
implementation
{$R *.dfm}
end.
Файл ReportClient.pas
unit ReportClient;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, RpCon, RpConDS, RpDefine, RpRave, DB, ADODB, StdCtrls, Grids,
DBGrids;
type
TFormReportClient = class(TForm)
ADOQueryClient: TADOQuery;
DataSourceReport: TDataSource;
RvProjectClient: TRvProject;
RvDataSetConnectionClient: TRvDataSetConnection;
ButtonPreview: TButton;
procedure ButtonPreviewClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormReportClient: TFormReportClient;
implementation
{$R *.dfm}
procedure TFormReportClient.ButtonPreviewClick(Sender: TObject);
begin
ADOQueryClient.Active:= True;
ADOQueryClient.ExecSQL;
RvProjectClient.Open;
RvProjectClient.Execute;
RvProjectClient.Close;
ADOQueryClient.Active:= False;
end;
end.
Файл ReportSave.pas
unit ReportSave;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, RpCon, RpConDS, DB, ADODB, RpDefine, RpRave, Grids,
DBGrids;
type
TFormReportService = class(TForm)
RvProjectService: TRvProject;
ADOQueryService: TADOQuery;
RvDataSetConnection1: TRvDataSetConnection;
ButtonPreview: TButton;
DataSource1: TDataSource;
Label1: TLabel;
EditYear: TEdit;
procedure ButtonPreviewClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormReportService: TFormReportService;
implementation
{$R *.dfm}
procedure TFormReportService.ButtonPreviewClick(Sender: TObject);
begin
ADOQueryService.Parameters[0].Value:= StrToInt(EditYear.Text);
ADOQueryService.Active:= True;
ADOQueryService.ExecSQL;
RvProjectService.Open;
RvProjectService.Execute;
RvProjectService.Close;
ADOQueryService.Active:= False;
end;
end.
Дата добавления: 2015-09-01; просмотров: 43 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Экранные формы приложения | | | СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ |