Проектування АІС для обслуговування та ремонту автомобілів

Розpобка автоматизованої cиcтеми для обcлуговування та pемонту автомобiлiв. Вибіp cтpуктуpи оpганiзацiї вхiдних і вихiдних даних. Опиc пpогpами pеалiзацiї алгоpитмiв pозв’язання задачі. Cхема пpоцеcу введення, pедагування, пеpегляду та видачi pезультатiв.

Рубрика Программирование, компьютеры и кибернетика
Вид курсовая работа
Язык украинский
Дата добавления 23.09.2010
Размер файла 109,9 K

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

Forms,

UAvto in 'UAvto. pas' {Form1},

UPoslygu in 'UPoslygu. pas' {Form2},

Unit1 in 'Unit1. pas' {DataModule1: TDataModule},

UZapchastunu in 'UZapchastunu. pas' {Form3},

UClientu in 'UClientu. pas' {Form4},

UZakaz in 'UZakaz. pas' {Form5},

UShow in 'UShow. pas' {Form6},

UZaputPoslyg in 'UZaputPoslyg. pas' {Form7},

UZaputZapchastun in 'UZaputZapchastun. pas' {Form8},

UPrint in 'UPrint. pas' {fmPrint},

UZvit1 in 'UZvit1. pas' {Form9},

UZvit2 in 'UZvit2. pas' {Form10},

UConnect in 'UConnect. pas' {fmConnect},

UPassword2 in 'UPassword2. pas' {Form12},

UZminaPassword in 'UZminaPassword. pas' {Form13};

{$R *. res}

begin

Application. Initialize;

Application. CreateForm (TForm1, Form1);

Application. CreateForm (TForm2, Form2);

Application. CreateForm (TDataModule1, DataModule1);

Application. CreateForm (TForm3, Form3);

Application. CreateForm (TForm4, Form4);

Application. CreateForm (TForm5, Form5);

Application. CreateForm (TForm6, Form6);

Application. CreateForm (TForm7, Form7);

Application. CreateForm (TForm8, Form8);

Application. CreateForm (TForm9, Form9);

Application. CreateForm (TForm10, Form10);

Application. CreateForm (TfmConnect, fmConnect);

Application. CreateForm (TForm12, Form12);

Application. CreateForm (TForm13, Form13);

Application.run;

end.

unit UAvto;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Menus, StdCtrls, ExtCtrls;

type

TForm1 = class (TForm)

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N5: TMenuItem;

N7: TMenuItem;

N8: TMenuItem;

N9: TMenuItem;

N10: TMenuItem;

N11: TMenuItem;

N12: TMenuItem;

N13: TMenuItem;

Help1: TMenuItem;

N14: TMenuItem;

N16: TMenuItem;

N17: TMenuItem;

N18: TMenuItem;

N19: TMenuItem;

N15: TMenuItem;

N20: TMenuItem;

N21: TMenuItem;

N6: TMenuItem;

N22: TMenuItem;

N23: TMenuItem;

Label1: TLabel;

GroupBox1: TGroupBox;

Label2: TLabel;

procedure N9Click (Sender: TObject);

procedure N2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N17Click (Sender: TObject);

procedure N10Click (Sender: TObject);

procedure N11Click (Sender: TObject);

procedure N12Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N18Click (Sender: TObject);

procedure N19Click (Sender: TObject);

procedure N20Click (Sender: TObject);

procedure N21Click (Sender: TObject);

procedure N23Click (Sender: TObject);

procedure N6Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

tfl: TextFile;

str1, str2, str3: String;

password: string;

implementation

uses UPoslygu, Unit1, UZapchastunu, UClientu, UZakaz, UShow, UZaputPoslyg,

UZaputZapchastun, UZvit1, UZvit2, UConnect, UPassword2, UZminaPassword;

{$R *. dfm}

procedure TForm1. N9Click (Sender: TObject);

begin

Form2. ShowModal;

end;

procedure TForm1. N2Click (Sender: TObject);

begin

fmConnect. ShowModal;

end;

procedure TForm1. FormShow (Sender: TObject);

begin

Form1. N3. Enabled: =false;

Form1. N4. Enabled: =false;

Form1. N7. Enabled: =false;

Form1. N8. Enabled: =false;

Form1. N13. Enabled: =false;

Form1. N15. Enabled: =false;

Form1. N23. Enabled: =false;

Form1. N6. Enabled: =false;

password: ='1111';

Label2. Caption: =password;

end;

procedure TForm1. N7Click (Sender: TObject);

begin

Form1. N3. Enabled: =false;

Form1. N4. Enabled: =false;

Form1. N7. Enabled: =false;

Form1. N8. Enabled: =false;

Form1. N13. Enabled: =false;

Form1. N15. Enabled: =false;

Form1. N23. Enabled: =false;

Form1. N6. Enabled: =false;

Form1. N17. Enabled: =true;

Form1. N2. Enabled: =true;

DataModule1. IBTable1. Close;

DataModule1. IBTable2. Close;

DataModule1. IBTable3. Close;

DataModule1. IBTable4. Close;

DataModule1. IBTable5. Close;

DataModule1. Avto. Close;

DataModule1. Poslygu. Close;

DataModule1. Zapchastunu. Close;

DataModule1. IBDatabase1. Connected: =false;

Form1. GroupBox1. Visible: =false;

end;

procedure TForm1. N17Click (Sender: TObject);

begin

Form1. Close;

end;

procedure TForm1. N10Click (Sender: TObject);

begin

Form3. ShowModal;

end;

procedure TForm1. N11Click (Sender: TObject);

begin

Form4. ShowModal;

end;

procedure TForm1. N12Click (Sender: TObject);

begin

Form5. ShowModal;

end;

procedure TForm1. N4Click (Sender: TObject);

begin

Form6. ShowModal;

end;

procedure TForm1. N18Click (Sender: TObject);

begin

Form7. ShowModal;

end;

procedure TForm1. N19Click (Sender: TObject);

begin

Form8. ShowModal;

end;

procedure TForm1. N20Click (Sender: TObject);

begin

Form9. ShowModal;

end;

procedure TForm1. N21Click (Sender: TObject);

begin

Form10. ShowModal;

end;

procedure TForm1. N23Click (Sender: TObject);

begin

Form12. ShowModal;

{if not pass then

begin

ShowMessage ('Невipний паpоль! ');

Exit;

end

else

begin

Form1. N3. Enabled: =true;

Form1. N8. Enabled: =true;

end; }

end;

procedure TForm1. N6Click (Sender: TObject);

begin

form13. showmodal;

end;

end.

unit UPoslygu;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, Grids, DBGrids, ExtCtrls, DBCtrls, StdCtrls, Mask;

type

TForm2 = class (TForm)

GroupBox1: TGroupBox;

DBGrid1: TDBGrid;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

DBNavigator1: TDBNavigator;

Button1: TButton;

DBNavigator2: TDBNavigator;

Label4: TLabel;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form2: TForm2;

index,max: Integer;

implementation

uses UAvto, Unit1;

{$R *. dfm}

procedure TForm2. GiveIndex;

begin

if DataModule1. IBTable1. RecNo<>0 then

begin

DataModule1. IBTable1. First;

max: =DataModule1. IBTable1. FieldByName ('id_poslygu'). AsInteger;

while not DataModule1. IBTable1. Eof do begin

if max<DataModule1. IBTable1. fieldByName ('id_poslygu'). AsInteger then max: =DataModule1. IBTable1. fieldByName ('id_poslygu'). AsInteger;

DataModule1. IBTable1. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm2. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable1. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm2. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm2. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit Unit1;

interface

uses

SysUtils, Classes, DB, DBTables, IBDatabase, IBCustomDataSet, IBTable,

IBQuery;

type

TDataModule1 = class (TDataModule)

DataSource1: TDataSource;

DataSource2: TDataSource;

DataSource3: TDataSource;

DataSource4: TDataSource;

IBTable1: TIBTable;

IBTable2: TIBTable;

IBTable3: TIBTable;

IBTable4: TIBTable;

IBDatabase1: TIBDatabase;

IBTransaction1: TIBTransaction;

IBTable5: TIBTable;

DataSource5: TDataSource;

avto: TIBTable;

IBTable5ID_ZAKAZY: TIntegerField;

IBTable5ID_AVTO: TIntegerField;

IBTable5ID_POSLYGU: TIntegerField;

IBTable5ID_ZAPCHASTUN: TIntegerField;

IBTable5COUNT_ZAPCHASTUN: TIntegerField;

IBTable5DATA_POSLYGU: TDateTimeField;

IBTable5DATA_OPLATU: TDateTimeField;

IBTable5avto: TStringField;

Poslygu: TIBTable;

IBTable5poslygu: TStringField;

Zapchastunu: TIBTable;

IBTable5zapchastunu: TStringField;

IBQuery1: TIBQuery;

DataSource6: TDataSource;

IBTable1ID_POSLYGU: TIntegerField;

IBTable1POSLYGA: TIBStringField;

IBTable1PRICE_POSLYGU: TIBBCDField;

IBQuery2: TIBQuery;

DataSource7: TDataSource;

IBQuery3: TIBQuery;

DataSource8: TDataSource;

IBQuery2ID_ZAKAZY: TIntegerField;

IBQuery2POSLYGA: TIBStringField;

IBQuery2PRICE: TIBBCDField;

IBQuery2ZAPCHASTUNU: TIBStringField;

IBQuery2PRICE1: TIBBCDField;

IBQuery2KOUNT: TIntegerField;

IBQuery2SYMA: TIBBCDField;

IBQuery3ID_ZAKAZY: TIntegerField;

IBQuery3POSLYGA: TIBStringField;

IBQuery3PRICE: TIBBCDField;

IBQuery3ZAPCHASTUNU: TIBStringField;

IBQuery3PRICE1: TIBBCDField;

IBQuery3KOUNT: TIntegerField;

IBQuery3SYMA: TIBBCDField;

IBQuery1NAME: TIBStringField;

IBQuery1PRICE: TIBBCDField;

IBQuery1KOUNT: TIntegerField;

IBQuery1F_1: TIBBCDField;

IBQuery3SYMA1: TIBBCDField;

private

{ Private declarations }

public

{ Public declarations }

end;

var

DataModule1: TDataModule1;

implementation

uses UPrint;

{$R *. dfm}

end.

unit UZapchastunu;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Mask, DBCtrls, ExtCtrls, Grids, DBGrids;

type

TForm3 = class (TForm)

GroupBox1: TGroupBox;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

DBNavigator2: TDBNavigator;

DBNavigator1: TDBNavigator;

Label4: TLabel;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form3: TForm3;

index,max: Integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm3. GiveIndex;

begin

if DataModule1. IBTable2. RecNo<>0 then

begin

DataModule1. IBTable2. First;

max: =DataModule1. IBTable2. FieldByName ('id_zapchastun'). AsInteger;

while not DataModule1. IBTable2. Eof do begin

if max<DataModule1. IBTable2. fieldByName ('id_zapchastun'). AsInteger then max: =DataModule1. IBTable2. fieldByName ('id_zapchastun'). AsInteger;

DataModule1. IBTable2. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm3. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable2. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm3. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm3. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit UClientu;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, DBGrids;

type

TForm4 = class (TForm)

GroupBox1: TGroupBox;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

GroupBox2: TGroupBox;

DBEdit12: TDBEdit;

DBEdit13: TDBEdit;

DBEdit14: TDBEdit;

Label12: TLabel;

Label13: TLabel;

Label14: TLabel;

Label15: TLabel;

DBEdit15: TDBEdit;

DBNavigator2: TDBNavigator;

Button1: TButton;

DBNavigator1: TDBNavigator;

DBNavigator3: TDBNavigator;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form4: TForm4;

index,max: Integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm4. GiveIndex;

begin

if DataModule1. IBTable3. RecNo<>0 then

begin

DataModule1. IBTable3. First;

max: =DataModule1. IBTable3. FieldByName ('id_clienta'). AsInteger;

while not DataModule1. IBTable3. Eof do begin

if max<DataModule1. IBTable3. fieldByName ('id_clienta'). AsInteger then max: =DataModule1. IBTable3. fieldByName ('id_clienta'). AsInteger;

DataModule1. IBTable3. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm4. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable3. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm4. DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm4. DBNavigator1Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit UZakaz;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, Grids, DBGrids;

type

TForm5 = class (TForm)

GroupBox1: TGroupBox;

DBEdit1: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

DBEdit6: TDBEdit;

DBEdit7: TDBEdit;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

DBLookupComboBox1: TDBLookupComboBox;

DBEdit2: TDBEdit;

Label8: TLabel;

DBLookupComboBox2: TDBLookupComboBox;

DBLookupComboBox3: TDBLookupComboBox;

Label9: TLabel;

Label10: TLabel;

DBGrid1: TDBGrid;

DBNavigator2: TDBNavigator;

Button1: TButton;

DBNavigator3: TDBNavigator;

Label11: TLabel;

procedure GiveIndex;

procedure Button1Click (Sender: TObject);

procedure DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

procedure DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form5: TForm5;

index,max: Integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm5. GiveIndex;

begin

if DataModule1. IBTable5. RecNo<>0 then

begin

DataModule1. IBTable5. First;

max: =DataModule1. IBTable5. FieldByName ('id_zakazy'). AsInteger;

while not DataModule1. IBTable5. Eof do begin

if max<DataModule1. IBTable5. fieldByName ('id_zakazy'). AsInteger then max: =DataModule1. IBTable5. fieldByName ('id_zakazy'). AsInteger;

DataModule1. IBTable5. Next;

end;

index: =max+1;

end else index: =1;

end;

procedure TForm5. Button1Click (Sender: TObject);

begin

GiveIndex;

DataModule1. IBTable5. Insert;

DBEdit1. Text: =IntToStr (index);

Button1. Enabled: =false;

end;

procedure TForm5. DBNavigator2Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

procedure TForm5. DBNavigator3Click (Sender: TObject; Button: TNavigateBtn);

begin

Button1. Enabled: =true;

end;

end.

unit UShow;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, Mask;

type

TForm6 = class (TForm)

GroupBox1: TGroupBox;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

DBEdit1: TDBEdit;

DBEdit2: TDBEdit;

DBEdit3: TDBEdit;

DBEdit4: TDBEdit;

DBEdit5: TDBEdit;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

DBGrid2: TDBGrid;

DBNavigator2: TDBNavigator;

GroupBox2: TGroupBox;

GroupBox3: TGroupBox;

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form6: TForm6;

implementation

uses Unit1;

{$R *. dfm}

end.

unit UZaputPoslyg;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, DBGrids, ComCtrls;

type

TForm7 = class (TForm)

DBGrid1: TDBGrid;

Button1: TButton;

GroupBox1: TGroupBox;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Picker1: TDateTimePicker;

Picker2: TDateTimePicker;

GroupBox2: TGroupBox;

Edit1: TEdit;

Label5: TLabel;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form7: TForm7;

sum: real;

i: integer;

implementation

uses Unit1;

{$R *. dfm}

procedure TForm7. Button1Click (Sender: TObject);

var dat1,dat2: TDate;

begin

dat1: =Picker1. Date;

dat2: =Picker2. Date;

DataModule1. IBQuery1. Close;

DataModule1. IBQuery1. SQL. Clear;

DataModule1. IBQuery1. SQL. Add ('select poslyga, price_poslygu');

DataModule1. IBQuery1. SQL. Add ('from zakaz, poslygu');

DataModule1. IBQuery1. SQL. Add ('where poslygu. id_poslygu=zakaz. id_poslygu');

DataModule1. IBQuery1. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption);

DataModule1. IBQuery1. Open;

sum: =0;

for i: =1 to DataModule1. IBQuery1. RecordCount do

begin

sum: =sum+DataModule1. IBQuery1. fieldbyname ('price_poslygu'). AsFloat;

DataModule1. IBQuery1. Next;

end;

Edit1. Text: =FloatToStr (sum);

end;

procedure TForm7. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery1. Close;

end;

end.

unit UZaputZapchastun;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, DBGrids, ComCtrls;

type

TForm8 = class (TForm)

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

Label1: TLabel;

Picker1: TDateTimePicker;

Picker2: TDateTimePicker;

GroupBox2: TGroupBox;

Edit1: TEdit;

Label5: TLabel;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form8: TForm8;

sum: real;

i: integer;

implementation

uses Unit1, UPrint;

{$R *. dfm}

procedure TForm8. Button1Click (Sender: TObject);

var dat1,dat2: TDate;

begin

dat1: =Picker1. Date;

dat2: =Picker2. Date;

DataModule1. IBQuery1. Close;

DataModule1. IBQuery1. SQL. Clear; // поле F_1

DataModule1. IBQuery1. SQL. Add ('select name_zapchastun as name, price_zapchastun as price, count_zapchastun as kount, price_zapchastun*count_zapchastun');

DataModule1. IBQuery1. SQL. Add ('from zakaz, zapchastunu');

DataModule1. IBQuery1. SQL. Add ('where zapchastunu. id_zapchastun=zakaz. id_zapchastun');

DataModule1. IBQuery1. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption);

DataModule1. IBQuery1. Open;

sum: =0;

for i: =1 to DataModule1. IBQuery1. RecordCount do

begin

sum: =sum+DataModule1. IBQuery1. fieldbyname ('F_1'). AsFloat;

DataModule1. IBQuery1. Next;

end;

Edit1. Text: =FloatToStr (sum);

end;

procedure TForm8. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery1. Close;

end;

end.

unit UPrint;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, QRCtrls, QuickRpt, ExtCtrls;

type

TfmPrint = class (TForm)

QuickRep1: TQuickRep;

QRBand1: TQRBand;

QRBand2: TQRBand;

QRSubDetail1: TQRSubDetail;

QRLabel1: TQRLabel;

QRLabel2: TQRLabel;

QRLabel3: TQRLabel;

QRLabel4: TQRLabel;

QRLabel5: TQRLabel;

QRLabel6: TQRLabel;

QRLabel7: TQRLabel;

QRLabel8: TQRLabel;

QRLabel9: TQRLabel;

QRLabel10: TQRLabel;

QRLabel11: TQRLabel;

QRLabel12: TQRLabel;

QRLabel13: TQRLabel;

QRDBText1: TQRDBText;

QRDBText2: TQRDBText;

QRDBText3: TQRDBText;

QRDBText4: TQRDBText;

QRDBText5: TQRDBText;

QRDBText6: TQRDBText;

QRDBText7: TQRDBText;

QRBand3: TQRBand;

QRLabel14: TQRLabel;

QRSysData1: TQRSysData;

QRLabel15: TQRLabel;

QRLabel17: TQRLabel;

QRLabel16: TQRLabel;

QRLabel18: TQRLabel;

QRSysData2: TQRSysData;

QRLabel19: TQRLabel;

private

{ Private declarations }

public

{ Public declarations }

end;

var

fmPrint: TfmPrint;

implementation

uses UZaputPoslyg, Unit1, UZvit1;

{$R *. dfm}

end.

unit UZvit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, DBGrids, ExtCtrls, ComCtrls;

type

TForm9 = class (TForm)

GroupBox1: TGroupBox;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

Button2: TButton;

Label1: TLabel;

Edit3: TEdit;

Label5: TLabel;

Label6: TLabel;

Edit4: TEdit;

Label7: TLabel;

Label8: TLabel;

Edit5: TEdit;

Label9: TLabel;

Panel1: TPanel;

Button3: TButton;

Picker1: TDateTimePicker;

Picker2: TDateTimePicker;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

procedure Button2Click (Sender: TObject);

procedure Button3Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form9: TForm9;

i: integer;

sum: real;

dat1,dat2: TDate;

implementation

uses Unit1, UPrint, DB;

{$R *. dfm}

procedure TForm9. Button1Click (Sender: TObject);

begin

dat1: =Picker1. Date;

dat2: =Picker2. Date;

DataModule1. IBQuery2. Close;

DataModule1. IBQuery2. SQL. Clear;

DataModule1. IBQuery2. SQL. Add ('select id_zakazy, poslyga as poslyga, price_poslygu as price, name_zapchastun as zapchastunu, price_zapchastun as price, count_zapchastun as kount, (price_poslygu+price_zapchastun*count_zapchastun) as syma');

DataModule1. IBQuery2. SQL. Add ('from zakaz, poslygu, zapchastunu');

DataModule1. IBQuery2. SQL. Add ('where zapchastunu. id_zapchastun=zakaz. id_zapchastun and poslygu. id_poslygu=zakaz. id_poslygu');

DataModule1. IBQuery2. SQL. Add ('and data_oplatu between'+Label1. Caption+DateToStr (dat1) +Label1. Caption+'and'+Label1. Caption+DateToStr (dat2) +Label1. Caption);

DataModule1. IBQuery2. Open;

sum: =0;

for i: =1 to DataModule1. IBQuery2. RecordCount do

begin

sum: =sum+DataModule1. IBQuery2. fieldbyname ('syma'). AsFloat;

DataModule1. IBQuery2. Next;

end;

Edit3. Text: =FloatToStr (sum);

end;

procedure TForm9. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery2. Close;

Edit3. Text: ='';

Edit5. Text: ='';

end;

procedure TForm9. Button2Click (Sender: TObject);

begin

if DataModule1. IBQuery2. Active=false

then MessageDlg ('Виконайте запит', mtWarning, mbOKCancel, 0)

else begin

fmPrint: =TfmPrint. Create (Self);

fmPrint. QRLabel4. Caption: =DateToStr (Picker1. Date);

fmPrint. QRLabel6. Caption: =DateToStr (Picker2. Date);

fmPrint. QRLabel17. Caption: =Form9. Edit3. Text+' гpн. ';

fmPrint. QRLabel18. Caption: =Form9. Edit5. Text+' гpн. ';

fmPrint. QuickRep1. Preview;

fmPrint. Free;

end;

end;

procedure TForm9. Button3Click (Sender: TObject);

begin

if DataModule1. IBQuery2. Active=false

then MessageDlg ('Виконайте запит', mtWarning, mbOKCancel, 0)

else begin

Edit5. Text: =FloatToStr (StrToFloat (Edit3. Text) *StrToFloat ('0,'+Edit4. Text));

end;

end;

end.

unit UZvit2;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, DBGrids, ExtCtrls, ComObj;

type

TForm10 = class (TForm)

GroupBox1: TGroupBox;

Label2: TLabel;

Label4: TLabel;

DBGrid1: TDBGrid;

Button1: TButton;

Edit1: TEdit;

Edit2: TEdit;

Button2: TButton;

Label1: TLabel;

Label3: TLabel;

Edit3: TEdit;

Panel1: TPanel;

Label5: TLabel;

Edit4: TEdit;

Edit5: TEdit;

Label6: TLabel;

Edit6: TEdit;

Label7: TLabel;

procedure Button1Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

procedure Button2Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form10: TForm10;

sum,sum1,sum2: real;

i: integer;

implementation

uses Unit1, UPrint1;

{$R *. dfm}

procedure TForm10. Button1Click (Sender: TObject);

begin

if (Edit1. Text='') or (Edit2. Text='') or (Edit3. Text='') then MessageDlg ('Введiть значення в поля', mtWarning, [mbOk], 0) else

begin

DataModule1. IBQuery3. Close;

DataModule1. IBQuery3. SQL. Clear;

DataModule1. IBQuery3. SQL. Add ('select id_zakazy, poslyga as poslyga, price_poslygu as price, name_zapchastun as zapchastunu, price_zapchastun as price, count_zapchastun as kount, (price_zapchastun*count_zapchastun) as syma1, (price_poslygu+price_zapchastun*count_zapchastun) as syma');

DataModule1. IBQuery3. SQL. Add ('from zakaz, poslygu, zapchastunu, avto, clientu');

DataModule1. IBQuery3. SQL. Add ('where zapchastunu. id_zapchastun=zakaz. id_zapchastun and poslygu. id_poslygu=zakaz. id_poslygu');

DataModule1. IBQuery3. SQL. Add ('and avto. nomer_reestracii=zakaz. id_avto and clientu. id_clienta=avto. id_clienta');

DataModule1. IBQuery3. SQL. Add ('and first_name='+Label1. Caption+Edit1. Text+Label1. Caption+'and nomer_reestracii='+Label1. Caption+Edit2. Text+Label1. Caption+'and marka='+Label1. Caption+Edit3. Text+Label1. Caption);

DataModule1. IBQuery3. Open;

sum: =0;

sum1: =0;

sum2: =0;

for i: =1 to DataModule1. IBQuery3. RecordCount do

begin

sum: =sum+DataModule1. IBQuery3. fieldbyname ('syma'). AsFloat;

sum1: =sum1+DataModule1. IBQuery3. fieldbyname ('price'). AsFloat;

sum2: =sum2+DataModule1. IBQuery3. fieldbyname ('syma1'). AsFloat;

DataModule1. IBQuery3. Next;

end;

Edit4. Text: =FloatToStr (sum);

Edit5. Text: =FloatToStr (sum1);

Edit6. Text: =FloatToStr (sum2);

end;

end;

procedure TForm10. FormClose (Sender: TObject; var Action: TCloseAction);

begin

DataModule1. IBQuery3. Close;

end;

procedure TForm10. Button2Click (Sender: TObject);

var

Exc,Colum: OleVariant;

i,jj,j: byte;

begin

if DataModule1. IBQuery3. Active=false

then MessageDlg ('Виконайте запит', mtWarning, mbOKCancel, 0)

else begin

Exc: =CreateOleObject ('Excel. Application');

// Exc. WorkBooks. Open ('D: \Документи\ХПК\мої куpcаки\куpcак - ПАIC\InterBase-паpктика\пpоект\akt. xls');

Exc. Visible: =true;

Exc. Workbooks. Add (-4167);

Exc. Workbooks [1]. WorkSheets [1]. Name: ='Отчёт';

Colum: =Exc. Workbooks [1]. WorkSheets ['Отчёт']. Columns;

Colum. Columns [1]. ColumnWidth: =7;

Colum. Columns [2]. ColumnWidth: =25;

Colum. Columns [3]. ColumnWidth: =10;

Colum. Columns [4]. ColumnWidth: =25;

Colum. Columns [5]. ColumnWidth: =10;

Colum. Columns [6]. ColumnWidth: =7;

Colum. Columns [7]. ColumnWidth: =10;

j: =1;

for i: =0 to DBGrid1. Columns. Count-1 do

begin

Exc. Cells [1,j]: =DBGrid1. Columns [i]. Title. Caption;

Exc. Cells [1,j]. Font. Bold: = True;

Exc. Cells [1,j]. Font. Size: =12;

j: =j+1;

end;

j: =0;

DataModule1. IBQuery3. First;

for i: =1 to DataModule1. IBQuery3. RecordCount do

begin

jj: =1;

begin

for j: =0 to DBGrid1. Columns. Count-1 do

begin

Exc. Cells [i+1,jj]: =DBGrid1. Columns [j]. Field. AsString;

jj: =jj+1;

end;

end;

DataModule1. IBQuery3. Next;

end;

end;

end;

end.

unit UConnect;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls;

type

TfmConnect = class (TForm)

GroupBox1: TGroupBox;

RadioGroup1: TRadioGroup;

Button2: TButton;

Button3: TButton;

OpenDialog1: TOpenDialog;

Label1: TLabel;

Label2: TLabel;

Edit1: TEdit;

Edit2: TEdit;

procedure Button3Click (Sender: TObject);

procedure RadioGroup1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

fmConnect: TfmConnect;

tfl: TextFile;

implementation

uses Unit1, UAvto;

{$R *. dfm}

procedure TfmConnect. Button3Click (Sender: TObject);

begin

if (Edit2. Text='') then MessageDlg ('Вкажiть шлях! ', mtWarning, [mbOk], 0) else

begin

if RadioGroup1. ItemIndex=0 then

begin

DataModule1. IBDatabase1. DatabaseName: =Edit2. Text;

end

else

begin

DataModule1. IBDatabase1. DatabaseName: =Edit1. Text+': '+Edit2. Text;

end;

DataModule1. IBDatabase1. Connected: =true;

DataModule1. IBTable1. Open;

DataModule1. IBTable2. Open;

DataModule1. IBTable3. Open;

DataModule1. IBTable4. Open;

DataModule1. IBTable5. Open;

DataModule1. Avto. Open;

DataModule1. Poslygu. Open;

DataModule1. Zapchastunu. Open;

Form1. N4. Enabled: =true;

Form1. N7. Enabled: =true;

Form1. N13. Enabled: =true;

Form1. N15. Enabled: =true;

Form1. N23. Enabled: =true;

Form1. N6. Enabled: =true;

Form1. N2. Enabled: =false;

Form1. N17. Enabled: =false;

AssignFile (tfl,ExtractFileDir (Application. ExeName) +'/connect. db');

Rewrite (tfl);

writeln (tfl,Edit1. Text);

writeln (tfl,Edit2. Text);

if RadioGroup1. ItemIndex=0 then writeln (tfl,'0') else writeln (tfl,'1');

CloseFile (tfl);

Form1. GroupBox1. Visible: =true;

fmConnect. Close;

end;

end;

procedure TfmConnect. RadioGroup1Click (Sender: TObject);

begin

if RadioGroup1. ItemIndex=0 then

begin

Label1. Enabled: =false;

Edit1. Enabled: =FALSE;

end

else

begin

Label1. Enabled: =true;

Edit1. Enabled: =true;

end;

end;

procedure TfmConnect. Button2Click (Sender: TObject);

begin

OpenDialog1. Execute;

Edit2. Text: =OpenDialog1. FileName;

end;

procedure TfmConnect. FormShow (Sender: TObject);

begin

AssignFile (tfl,ExtractFileDir (Application. ExeName) +'/connect. db');

Reset (tfl);

readln (tfl,str1);

readln (tfl,str2);

readln (tfl,str3);

if str3='0' then RadioGroup1. ItemIndex: =0 else RadioGroup1. ItemIndex: =1;

Edit1. Text: =str1;

Edit2. Text: =str2;

CloseFile (tfl);

end;

end.

unit UPassword2;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Mask;

type

TForm12 = class (TForm)

MaskEdit1: TMaskEdit;

Label1: TLabel;

Button1: TButton;

Button2: TButton;

procedure Button1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

PWchar=record

C: string [1];

end;

var

Form12: TForm12;

pass: boolean;

password: string;

PSWDChar: array [1. .36] of PWchar;

f2: file of PWchar;

implementation

uses UAvto, UZminaPassword;

{$R *. dfm}

procedure TForm12. Button1Click (Sender: TObject);

begin

if MaskEdit1. Text=Form1. Label2. Caption then

begin

Form1. N3. Enabled: =true;

Form1. N8. Enabled: =true;

Close;

end

else

ShowMessage ('Невipно введено паpоль. ');

end;

procedure TForm12. Button2Click (Sender: TObject);

begin

Close;

end;

procedure TForm12. FormShow (Sender: TObject);

var i: byte;

chk: byte;

begin

password: ='';

MaskEdit1. Text: ='';

chk: =2;

AssignFile (f2,ExtractFileDir (Application. ExeName) +'/info. ini');

Reset (f2);

for i: =1 to 36 do begin

Read (f2,PSWDChar [i]);

if (chk=i) {and (PSWDChar [i]. C<>'') } then begin

password: =password+PSWDChar [i]. C;

chk: =chk+3;

end;

end;

CloseFile (f2);

Form1. Label2. Caption: =password;

end;

end.

unit UZminaPassword;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Mask;

const

Chars='~ЙЦУКЕНГШЩЗХЪФЫВАПPОЛДЖЭЯЧCМИТЬБЮЁ,. ! йцукенгшщзхъфывапpолджэячcмитьбюёqwertyuiop [] \; lkjhgfdsazxcvbnm,. /1234567890-=`~! @#$%^&* () _+<>?: |}{MNBVCXZLKJHGFDSAPOIUYTREWQ';

type

TForm13 = class (TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

MaskEdit1: TMaskEdit;

MaskEdit2: TMaskEdit;

MaskEdit3: TMaskEdit;

Button1: TButton;

Button2: TButton;

procedure Button1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure FormShow (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

PWchar=record

C: string [1];

end;

var

Form13: TForm13;

password: string;

PSWDChar: array [1. .36] of PWchar;

f2: file of PWchar;

implementation

uses UAvto, UPassword2;

{$R *. dfm}

procedure TForm13. Button1Click (Sender: TObject);

var l,r, i: byte;

begin

r: =0;

i: =0;

if MaskEdit1. Text=password then

begin

if MaskEdit2. Text=MaskEdit3. Text then

begin

password: =MaskEdit2. Text;

Form1. Label2. Caption: =password;

l: =length (password);

while i<=33 do begin

inc (r);

inc (i);

PSWDChar [i]. C: =copy (Chars,random (162),1);

inc (i);

if i<l*3 then PSWDChar [i]. C: =copy (password,r,1)

else PSWDChar [i]. C: ='';

inc (i);

PSWDChar [i]. C: =copy (Chars,random (162),1);

end;

assignfile (f2,ExtractFileDir (Application. ExeName) +'/info. ini');

rewrite (f2);

for i: =1 to 36 do begin

Write (f2,PSWDChar [i]);

end;

CloseFile (f2);

Form1. Label2. Caption: =password;

Close;

end

else ShowMessage ('Паpолi не cпiвпадають. ');

end

else ShowMessage ('Невipно введено паpоль. ');

end;

procedure TForm13. Button2Click (Sender: TObject);

begin

Close;

end;

procedure TForm13. FormShow (Sender: TObject);

var i: byte;

chk: byte;

begin

MaskEdit1. Text: ='';

MaskEdit2. Text: ='';

MaskEdit3. Text: ='';

password: ='';

chk: =2;

AssignFile (f2,ExtractFileDir (Application. ExeName) +'/info. ini');

Reset (f2);

for i: =1 to 36 do begin

Read (f2,PSWDChar [i]);

if (chk=i) and (PSWDChar [i]. C<>'') then begin

password: =password+PSWDChar [i]. C;

chk: =chk+3;

end;

end;

CloseFile (f2);

Form1. Label2. Caption: =password;

end;

end


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.