Курсовая работа: Расчет стоимости пластиковых оконных конструкций и дверей
SpinEdit2.MaxValue:=strtoint(maxv);
SpinEdit1.Value:=strtoint(minh);
SpinEdit2.Value:=strtoint(minv);
ShowMessage('Введите размеры и
нажмите "ОК"');
6:application.ProcessMessages;
if start=true then begin
l:=spinedit1.Value;
h:=spinedit2.Value;
plos:=(l*h)*0.000001;
if plos<=0.5 then
res:=(plos*pay)+((plos*pay)/100)*30
else res:=plos*pay;
if
StringGrid1.RowCount<b then StringGrid1.RowCount:=b+1;
StringGrid1.Cells[0,b]:='Входная дверь';
StringGrid1.Cells[1,b]:=floattostr(plos);
StringGrid1.Cells[2,b]:=floattostr(res);
b:=b+1;
start:=false;SpinEdit1.Value:=0;
SpinEdit2.Value:=0; end
else goto 6;
end;n:='';end;end;dob:=b;
ShowMessage('Расчет стоимости
завершен!!!');
SpeedButton3.Visible:=false;SpeedButton9.Visible:=true;
SpeedButton2.Visible:=True;SpeedButton12.Visible:=True;end;
procedure
TForm8.SpeedButton3Click(Sender: TObject);
begin start:=true; end;
procedure
TForm8.FormCreate(Sender: TObject);
begin e:=0;
start:=false;
StringGrid2.Cells[0,0]:='Площадь';StringGrid2.Cells[1,0]:='Монтаж';
StringGrid2.Cells[2,0]:='Подоконник';StringGrid2.Cells[3,0]:='Профиль SO9';
StringGrid2.Cells[4,0]:='Тонировка';StringGrid2.Cells[5,0]:='Ламин.';
StringGrid2.Cells[6,0]:='Итог';end;
procedure
TForm8.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var
CanSelect: Boolean);
begin
Label14.Caption
:=StringGrid1.Cells [0, ARow];
stol:=Arow;end;
procedure
TForm8.SpeedButton4Click(Sender: TObject);
Var sen,sen1:real;
begin
if (label14.Caption='Поворотный')or(label14.Caption='Откидной') then
if StringGrid1.Cells [3,
stol]<>'да' then
begin
sen1:=strtofloat(StringGrid1.Cells
[2, stol]);
sen:=sen1+16;
StringGrid1.Cells [2,
stol]:=floattostr(sen);
StringGrid1.Cells [3,
stol]:='да';
ShowMessage('Расчет закончен!');end
else Showmessage('На этом модуле уже
стоит маскитка!')
else Showmessage('На данный модуль
нельзя ставить маскитку!');end;
procedure
TForm8.SpeedButton5Click(Sender: TObject);
begin
if Form8.StringGrid2.Cells
[5,1]='' then
form15.Showmodal else
Showmessage('Окно можно ламинировать только
один раз!');end;
procedure
TForm8.SpeedButton6Click(Sender: TObject);
begin
if
Form8.StringGrid2.Cells[4,1]='' then
form17.Show else
Showmessage('Окно можно тонировать
только один раз!');end;
procedure
TForm8.SpeedButton7Click(Sender: TObject);
begin
if
Form8.StringGrid2.Cells[2,1]='да'
then
Showmessage('На окно можно ставить
только один подоконник!')
else Form18.Showmodal;end;
procedure
TForm8.SpeedButton10Click(Sender: TObject);
begin
if
Form8.StringGrid2.Cells [3,1]<>'да' then
form19.Showmodal
else Showmessage('На этом окне профиль уже учтён!');end;
procedure
TForm8.SpeedButton11Click(Sender: TObject);
begin
if impost>=2 then
begin e:=e+1;
if e<=(impost-1) then
form20.Showmodal
else showmessage('Превышено
допустимое число!');end
else showmessage('Импост считается
только между двумя глухими модулями!');
end;
procedure
TForm8.SpeedButton12Click(Sender: TObject);
Var
i:integer;p2,s:real;beginp2:=0;s:=0;
for i:=1 to dob do
if
StringGrid1.Cells[1,i]<>'' then
p2:=p2+Strtofloat(StringGrid1.Cells[1,i]);
StringGrid2.Cells[0,1]:=Floattostr(p2);
for i:=1 to dob do
if
StringGrid1.Cells[2,i]<>'' then
s:=s+strtofloat(StringGrid1.Cells[2,i]);
if impost=1 then
s:=s+p2*7;
StringGrid2.Cells[6,1]:=floattostr(s);
SpeedButton12.Visible:=false;SpeedButton5.Visible:=true;
SpeedButton6.Visible:=true;SpeedButton7.Visible:=true;
SpeedButton10.Visible:=true;SpeedButton11.Visible:=true;
SpeedButton14.Visible:=true;SpeedButton8.Visible:=true;end;
procedure
TForm8.SpeedButton8Click(Sender: TObject);
Var pl,sen:real;
begin
if StringGrid2.Cells
[1,1]<>'да' then
begin
pl:=strtofloat(StringGrid2.Cells
[6,1]);
sen:=(pl/100)*12;
sen:=sen+pl;
StringGrid2.Cells
[6,1]:=floattostr(sen);
StringGrid2.Cells [1,1]:='да';
ShowMessage('Расчет закончен!');end
else Showmessage('На этом окне монтаж уже расчитан!') end;
procedure
TForm8.SpeedButton13Click(Sender: TObject);
begin
if
StringGrid2.Cells[6,1]<>'' then
Form9.Edit5.Text:=StringGrid2.Cells[6,1];
form9.Show;end;
procedure
TForm8.FormShow(Sender: TObject);
begin
SpeedButton3.Visible:=false;
SpeedButton9.Visible:=true;
StringGrid1.Cells[0,0]:='Модули';
StringGrid1.Cells[1,0]:='Площадь';
StringGrid1.Cells[2,0]:='Стоимость';
StringGrid1.Cells[3,0]:='Москитка';end;
procedure
TForm8.SpeedButton14Click(Sender: TObject);
begin form14.show;end;end.
unit Unit9;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask,
Buttons, jpeg, ExtCtrls;
type
TForm9 = class(TForm)
Image1: TImage; Label1:
TLabel;Label2: TLabel;Label3: TLabel;Label4: TLabel;
Label5: TLabel; Label6:
TLabel;RadioButton1: TRadioButton;
RadioButton2:
TRadioButton;RadioButton3: TRadioButton;
SpeedButton1:
TSpeedButton;Edit1: TEdit;Edit2: TEdit;Edit3: TEdit;Edit4: TEdit;
Edit5: TEdit; procedure
SpeedButton1Click(Sender: TObject);
procedure
Edit1KeyPress(Sender: TObject; var Key: Char);
procedure
Edit2KeyPress(Sender: TObject; var Key: Char);
procedure
Edit3KeyPress(Sender: TObject; var Key: Char);
procedure Edit4KeyPress(Sender:
TObject; var Key: Char);
procedure
Edit5KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form9: TForm9;
implementation
{$R *.dfm}
procedure
TForm9.SpeedButton1Click(Sender: TObject);
Var
evro,dol,rub:real;kursE,kursD:real;
begin
kursD:=0;kursE:=0;evro:=0;dol:=0;rub:=0;
If
RadioButton1.Checked=True then begin
kursD:=Strtofloat(Edit2.Text);
dol:=Strtofloat(Edit4.Text);
Edit3.Text:=floattoStr(dol*kursD);end;
If
RadioButton2.Checked=True then begin
kursE:=Strtofloat(Edit1.Text);
evro:=Strtofloat(Edit5.Text);
Edit3.Text:=floattoStr(evro*kursE);end;
If
RadioButton3.Checked=True then begin
kursE:=Strtofloat(Edit1.Text);
kursD:=Strtofloat(Edit2.Text);
evro:=Strtofloat(Edit5.Text);
Edit4.Text:=floattoStr((evro*kursE)/kursD);end;end;
procedure
TForm9.Edit1KeyPress(Sender: TObject; var Key: Char);
var vrPos, vrLength,
vrSelStart: byte;
const I: byte = 1;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrPos := Pos(',', Text);
vrSelStart := SelStart;
end;
case Key of '0'..'9':
begin
if (vrPos > 0) and
(vrLength - vrPos > I) and (vrSelStart >= vrPos) then
Key := #0;
end; ',', '.':
begin
if (vrPos > 0) or
(vrSelStart = 0) or (vrLength = 0) then
Key := #0 else Key
:= #44; end; #8: ; else Key := #0; end;end;
procedure
TForm9.Edit2KeyPress(Sender: TObject; var Key: Char);
var vrPos, vrLength,
vrSelStart: byte;
const I: byte = 1;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrPos := Pos(',', Text);
vrSelStart := SelStart;
end;
case Key of '0'..'9':
begin
if (vrPos > 0) and
(vrLength - vrPos > I) and (vrSelStart >= vrPos) then
Key := #0; end;
',', '.':
begin
if (vrPos > 0) or
(vrSelStart = 0) or (vrLength = 0) then
Key := #0 else Key :=
#44; end; #8: ; else Key := #0; end;end;
procedure
TForm9.Edit3KeyPress(Sender: TObject; var Key: Char);
var vrPos, vrLength,
vrSelStart: byte;
const I: byte = 1;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrPos := Pos(',', Text);
vrSelStart := SelStart;
end;
case Key of '0'..'9':
begin
if (vrPos > 0) and
(vrLength - vrPos > I) and (vrSelStart >= vrPos) then
Key := #0; end;
',', '.':
begin
if (vrPos > 0) or
(vrSelStart = 0) or (vrLength = 0) then Key := #0
else Key := #44; end;
#8: ; else Key := #0; end;end;
procedure
TForm9.Edit4KeyPress(Sender: TObject; var Key: Char);
var vrPos, vrLength,
vrSelStart: byte;
const I: byte = 1;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrPos := Pos(',', Text);
vrSelStart := SelStart;
end;
case Key of '0'..'9':
begin
if (vrPos > 0) and
(vrLength - vrPos > I) and (vrSelStart >= vrPos) then
Key := #0; end;
',', '.':
begin
if (vrPos > 0) or
(vrSelStart = 0) or (vrLength = 0) then
Key := #0 else Key :=
#44; end; #8: ; else Key := #0; end;end;
procedure
TForm9.Edit5KeyPress(Sender: TObject; var Key: Char);
var vrPos, vrLength,
vrSelStart: byte;
const I: byte = 1;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrPos := Pos(',', Text);
vrSelStart := SelStart;
end;
case Key of '0'..'9':
begin
if (vrPos > 0) and
(vrLength - vrPos > I) and (vrSelStart >= vrPos) then
Key := #0; end;
',', '.':
begin
if (vrPos > 0) or
(vrSelStart = 0) or (vrLength = 0) then
Key := #0 else Key :=
#44; end; #8: ; else Key := #0; end;end;end.
unit Unit10;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt,
ExtCtrls, StdCtrls, QRPrntr, ImgList, Buttons,
RpBase, RpSystem,
RpDefine, RpRave;
type
TForm10 = class(TForm)
QuickRep1: TQuickRep;
QRSubDetail1: TQRSubDetail; QRLabel5: TQRLabel;
QRRichText1: TQRRichText;
QRLabel1: TQRLabel; QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRImage1: TQRImage; QRImage2: TQRImage;
QRImage3: TQRImage;
QRImage4: TQRImage; QRImage5: TQRImage;
QRImage6: TQRImage;
Image1: TImage; SpeedButton2: TSpeedButton;
SpeedButton1:
TSpeedButton; procedure FormCreate(Sender: TObject);
procedure
SpeedButton1Click(Sender: TObject);
procedure
SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form10: TForm10;
nzak:integer;
implementation
uses Unit1,unit7;
{$R *.dfm}
procedure TForm10.FormCreate(Sender:
TObject);
begin QrrichText1.ParentRichEdit:=Form1.RichEdit1;
end;
procedure
TForm10.SpeedButton1Click(Sender: TObject);
Var
h:integer;f:textfile;s:string;dlg:Word;
begin
AssignFile(f,dir+'\nzak.txt');
Reset(f);
Read(f,s);
nzak:=StrToInt(s);
nzak:=nzak+1;
s := IntToStr(nzak);
CloseFile(f);
rewrite(f);
write(f,s);
closefile(f);
Form1.RichEdit1.Lines.SaveToFile(dir+'\БД\'+fiozak+'(№'+inttostr(nzak)+')'+'.rtf');
dlg:=MessageDlg('Вы хотите сохранить заказ?',mtConfirmation,mbYesNoCancel,0);
if dlg = mrYes then
QuickRep1.PrintBackground
else
for h:=1 to 6 do
image1.Picture.SaveToFile(dir+'\temp\'+inttostr(h)+'.bmp');
Form1.RichEdit1.Lines.Clear;Close;end;
procedure
TForm10.SpeedButton2Click(Sender: TObject);
begin
QuickRep1.Preview;end;end.
unit Unit11;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, Spin, jpeg, ExtCtrls;
type
TForm11 = class(TForm)
Image1: TImage;
SpeedButton2: TSpeedButton; SpeedButton1: TSpeedButton;
Label1: TLabel; SpinEdit1:
TSpinEdit; procedure SpeedButton1Click(Sender: TObject);
procedure
SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form11: TForm11;
implementation
uses Unit16,Unit1;
{$R *.dfm}
procedure
TForm11.SpeedButton1Click(Sender: TObject);
begin close; end;
procedure
TForm11.SpeedButton2Click(Sender: TObject);
begin
kolok:=SpinEdit1.Value;
form16.show;
SpinEdit1.Value:=1;close;end;end.
unit Unit12;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, Spin, Mask, ComCtrls, Grids, jpeg, ExtCtrls,ShellAPI,Unit1;
type
TForm12 = class(TForm)
GroupBox2:
TGroupBox;Label1: TLabel;Image1: TImage;
SpeedButton4:
TSpeedButton; RichEdit1: TRichEdit; SpeedButton2: TSpeedButton;
SpeedButton1:
TSpeedButton; SpeedButton5: TSpeedButton;ListBox1: TListBox;
procedure
SpeedButton1Click(Sender: TObject);
procedure
SpeedButton4Click(Sender: TObject);
procedure SpeedButton5Click(Sender:
TObject);
procedure
ListBox1Enter(Sender: TObject);
procedure
FormKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender:
TObject);
private
FPrefix: array[0..255] of
char;
{ Private declarations }
public
{ Public declarations }
end;
var Form12: TForm12;
Count:integer;
implementation
{$R *.dfm}
procedure
TForm12.SpeedButton1Click(Sender: TObject);
begin close; end;
procedure
TForm12.SpeedButton4Click(Sender: TObject);
begin
richedit1.Lines.LoadFromFile(dir+'\БД\'+listbox1.Items.Strings[listbox1.ItemIndex]);
end;
procedure
TForm12.SpeedButton5Click(Sender: TObject);
begin
RichEdit1.Print('Распечатка заказа');
end;
procedure
TForm12.ListBox1Enter(Sender: TObject);
begin
FPrefix[0] := #0;
Label1.Caption :=
StrPas(FPrefix);
end;
procedure
TForm12.FormKeyPress(Sender: TObject; var Key: Char);
Var curKey: array[0..1] of
char;
ndx: integer;
begin
if ActiveControl =
ListBox1 then begin
if key = #8 {Backspace (клавиша возврата)}
then begin
if FPrefix[0] <> #0
then begin
FPrefix[StrLen(FPrefix) -
1] := #0;end end else begin
curKey[0] := Key;
curKey[1] := #0;
StrCat(FPrefix, curKey);
ndx :=
SendMessage(ListBox1.Handle, LB_FINDSTRING,
-1, longint(@FPrefix));
if ndx <> LB_ERR
then
ListBox1.ItemIndex :=
ndx;end;
Label1.Caption :=
StrPas(FPrefix);
Key := #0;end;end;
procedure
TForm12.FormShow(Sender: TObject);
var F: TSearchRec; Path:
string; Attr: Integer;
begin
Path := dir+'\БД\*.rtf';
Attr := faAnyFile;
FindFirst(Path, Attr, F);
if F.name <> '' then
begin
ListBox1.Items.Add(F.name);
{Добавление в TListBox имени найденного файла}
while FindNext(F) = 0 do
ListBox1.Items.Add(F.name);
end; FindClose(F);end;end.
unit Unit13;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls,
Buttons, unit1,jpeg, ExtCtrls;
type
TForm13 = class(TForm)
Image1: TImage;
SpeedButton3: TSpeedButton; SpeedButton2: TSpeedButton;
SpeedButton1:
TSpeedButton; StringGrid1: TStringGrid;Label2: TLabel;Label3: TLabel;
Label1: TLabel; procedure
FormCreate(Sender: TObject);
procedure
SpeedButton1Click(Sender: TObject);
procedure
SpeedButton2Click(Sender: TObject);
procedure
SpeedButton3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form13: TForm13;
implementation
{$R *.dfm}
procedure
TForm13.FormCreate(Sender: TObject);
begin
Form13.StringGrid1.Cells[0,0]:='Наименование';
Form13.StringGrid1.Cells[0,1]:='Глухой модуль';
Form13.StringGrid1.Cells[0,2]:='Поворотный модуль';
Form13.StringGrid1.Cells[0,3]:='Поворотно-откидной';
Form13.StringGrid1.Cells[0,4]:='Входная дверь';
Form13.StringGrid1.Cells[0,5]:='Балконная поворотная';
Form13.StringGrid1.Cells[0,6]:='Поворотно-откидная ';
Form13.StringGrid1.Cells[1,0]:='Высота(мм)';
Form13.StringGrid1.Cells[2,0]:='Ширина(мм)';
Form13.StringGrid1.Cells[3,0]:='Высота(мм)';
Form13.StringGrid1.Cells[4,0]:='Ширина(мм)';end;
procedure
TForm13.SpeedButton1Click(Sender: TObject);
begin
Form13.StringGrid1.Cells[1,1]:=inttostr(470);
Form13.StringGrid1.Cells[1,2]:=inttostr(520);
Form13.StringGrid1.Cells[1,3]:=inttostr(520);
Form13.StringGrid1.Cells[1,4]:=inttostr(1000);
Form13.StringGrid1.Cells[1,5]:=inttostr(410);
Form13.StringGrid1.Cells[1,6]:=inttostr(410);
Form13.StringGrid1.Cells[2,1]:=inttostr(400);
Form13.StringGrid1.Cells[2,2]:=inttostr(410);
Form13.StringGrid1.Cells[2,3]:=inttostr(410);
Form13.StringGrid1.Cells[2,4]:=inttostr(530);
Form13.StringGrid1.Cells[2,5]:=inttostr(410);
Form13.StringGrid1.Cells[2,6]:=inttostr(410);
Form13.StringGrid1.Cells[3,1]:=inttostr(2135);
Form13.StringGrid1.Cells[3,2]:=inttostr(2250);
Form13.StringGrid1.Cells[3,3]:=inttostr(2250);
Form13.StringGrid1.Cells[3,4]:=inttostr(2250);
Form13.StringGrid1.Cells[3,5]:=inttostr(2250);
Form13.StringGrid1.Cells[3,6]:=inttostr(2250);
Form13.StringGrid1.Cells[4,1]:=inttostr(2135);
Form13.StringGrid1.Cells[4,2]:=inttostr(800);
Form13.StringGrid1.Cells[4,3]:=inttostr(800);
Form13.StringGrid1.Cells[4,4]:=inttostr(990);
Form13.StringGrid1.Cells[4,5]:=inttostr(800);
Form13.StringGrid1.Cells[4,6]:=inttostr(800);end;
procedure
TForm13.SpeedButton2Click(Sender: TObject);
Var s:string;f:textfile;
begin
{$I-}
AssignFile(f,dir+'\Технические допуски\');
{$I+}
If IOResult=0 then begin
s:=dir+'\Технические допуски\';
Rewrite(f,s+'\Глухой модуль.dat');
Writeln(f,Form13.StringGrid1.Cells[1,1]);
Writeln(f,Form13.StringGrid1.Cells[2,1]);
Writeln(f,Form13.StringGrid1.Cells[3,1]);
Writeln(f,Form13.StringGrid1.Cells[4,1]);
CloseFile(f);
Rewrite(f,s+'\Поворотный модуль.dat');
Writeln(f,Form13.StringGrid1.Cells[1,2]);
Writeln(f,Form13.StringGrid1.Cells[2,2]);
Writeln(f,Form13.StringGrid1.Cells[3,2]);
Writeln(f,Form13.StringGrid1.Cells[4,2]);
CloseFile(f);
Rewrite(f,s+'\Поворотно-откидной.dat');
Writeln(f,Form13.StringGrid1.Cells[1,3]);
Writeln(f,Form13.StringGrid1.Cells[2,3]);
Writeln(f,Form13.StringGrid1.Cells[3,3]);
Writeln(f,Form13.StringGrid1.Cells[4,3]);
CloseFile(f);
Rewrite(f,s+'\Входная дверь.dat');
Writeln(f,Form13.StringGrid1.Cells[1,4]);
Writeln(f,Form13.StringGrid1.Cells[2,4]);
Writeln(f,Form13.StringGrid1.Cells[3,4]);
Writeln(f,Form13.StringGrid1.Cells[4,4]);
CloseFile(f);
Rewrite(f,s+'\Балконная поворотная.dat');
Writeln(f,Form13.StringGrid1.Cells[1,5]);
Writeln(f,Form13.StringGrid1.Cells[2,5]);
Writeln(f,Form13.StringGrid1.Cells[3,5]);
Writeln(f,Form13.StringGrid1.Cells[4,5]);
CloseFile(f);
Rewrite(f,s+'\Поворотно-откидная.dat');
Writeln(f,Form13.StringGrid1.Cells[1,6]);
Writeln(f,Form13.StringGrid1.Cells[2,6]);
Writeln(f,Form13.StringGrid1.Cells[3,6]);
Writeln(f,Form13.StringGrid1.Cells[4,6]);
CloseFile(f);
ShowMessage('Данные сохранены успешно!');end
else Exit; end;
procedure
TForm13.SpeedButton3Click(Sender: TObject);
begin close; end; end.
unit Unit14;
interface
uses
Windows, Messages, SysUtils,
Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, Spin, jpeg, ExtCtrls;
type
TForm14 = class(TForm)
Image1: TImage; Label20:
TLabel; SpinEdit1: TSpinEdit; Label1: TLabel;
SpeedButton14:
TSpeedButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var Form14: TForm14;
implementation
{$R *.dfm}
end.
unit Unit15;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, jpeg, ExtCtrls;
type
TForm15 = class(TForm)
Image1: TImage;
RadioButton1: TRadioButton; RadioButton2: TRadioButton;
SpeedButton8:
TSpeedButton; procedure SpeedButton8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form15: TForm15;
implementation
uses Unit8;
{$R *.dfm}
procedure
TForm15.SpeedButton8Click(Sender: TObject);
Var sum,t:real;
begin
if Form8.StringGrid2.Cells
[5,1]='' then begin
If
RadioButton1.Checked=true then begin
t:=strtofloat(Form8.StringGrid2.Cells
[6,1]);
sum:=t+((t/100)*30);
Form8.StringGrid2.Cells
[6,1]:=floattostr(sum);
Form8.StringGrid2.Cells
[5,1]:='Одна сторона';
Close; end;
If
RadioButton2.Checked=true then begin
t:=strtofloat(Form8.StringGrid2.Cells
[6,1]);
sum:=t+((t/100)*40);
Form8.StringGrid2.Cells
[6,1]:=floattostr(sum);
Form8.StringGrid2.Cells
[5,1]:='Две стороны'; Close;end;end;end;end.
unit Unit16;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
Buttons, unit1,Mask,ExtCtrls, jpeg, ComCtrls;
type
TForm16 = class(TForm)
Image1: TImage; Label1:
TLabel;Edit1: TEdit;Edit2: TEdit;Label2: TLabel;
Label3: TLabel; Memo1:
TMemo; Label6: TLabel; SpeedButton1: TSpeedButton;
SpeedButton2:
TSpeedButton; DateTimePicker1: TDateTimePicker;
MaskEdit2: TMaskEdit;
MaskEdit3: TMaskEdit; Label8: TLabel; Label7: TLabel;
Label10: TLabel; Memo4:
TMemo; Label4: TLabel;
procedure
SpeedButton2Click(Sender: TObject);
procedure
SpeedButton1Click(Sender: TObject);
procedure
Edit1KeyPress(Sender: TObject; var Key: Char);
procedure
Edit2KeyPress(Sender: TObject; var Key: Char);
procedure
FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form16: TForm16;
implementation
uses Unit10, Unit7;
{$R *.dfm}
procedure
TForm16.SpeedButton2Click(Sender: TObject);
Var f: Integer;
begin
if (Edit1.Text='')
or(Edit2.Text='')or(Memo1.Text='') then
Showmessage('Сначала введите
необходимую информацию!') else
if(MaskEdit3.Text='')and(MaskEdit2.Text='(8)
')then
Showmessage('Введите хотя бы один
номер телефона!')
else begin
fiozam:=Edit1.Text;
fiozak:=Edit2.Text;
adres:=Memo1.Text;
got:=Memo4.Text;
data:=datetostr(DateTimePicker1.Date);
domtel:=MaskEdit3.Text;
sottel:=MaskEdit2.Text;
for f := 0 to
ComponentCount - 1 do begin
if (Components[f] is
TEdit) then
(Components[f] as
TEdit).Text:='';
if (Components[f] is
TMemo) then
(Components[f] as
TMemo).Text:='';
if (Components[f] is
TMaskEdit) then
(Components[f] as
TMaskEdit).Text:='';
form7.Show; Close;
end;end;end;
procedure
TForm16.SpeedButton1Click(Sender: TObject);
begin Close; end;
procedure
TForm16.Edit1KeyPress(Sender: TObject; var Key: Char);
var vrLength,
vrSelStart: byte;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrSelStart := SelStart;
end;
case Key of 'А'..'Я':begin end;
'а'..'я':begin end;
#8:begin end;
#32:begin end;
#46:
else Key := #0;end;end;
procedure
TForm16.Edit2KeyPress(Sender: TObject; var Key: Char);
var vrLength,
vrSelStart: byte;
begin
with Sender as TEdit do
begin
vrLength := Length(Text);
vrSelStart := SelStart;
end;
case Key of 'А'..'Я':begin end;
'а'..'я':begin end;
#8:begin end;
#32:begin end;
#46: else Key := #0;
end;end;
procedure
TForm16.FormCreate(Sender: TObject);
begin datetimepicker1.Date:=Date;end;end.
unit Unit17;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, jpeg,unit1, ExtCtrls,unit8;
type
TForm17 = class(TForm)
Image1: TImage; SpeedButton8:
TSpeedButton; SpeedButton1: TSpeedButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox; ComboBox3: TComboBox;
RadioButton1:
TRadioButton; RadioButton2: TRadioButton;
RadioButton3:
TRadioButton; procedure RadioButton1Click(Sender: TObject);
procedure
RadioButton2Click(Sender: TObject);
procedure
RadioButton3Click(Sender: TObject);
procedure
SpeedButton8Click(Sender: TObject);
procedure
ComboBox1Change(Sender: TObject);
procedure
ComboBox2Change(Sender: TObject);
procedure
ComboBox3Change(Sender: TObject);
procedure
SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var plo,zen:real;
Form17: TForm17; senton:string; t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12
,t13,h1,h2,h3,h4,h5,h6,h7,h8,r1,r2,r3,r4:string;
implementation
uses Unit22;
{$R *.dfm}
procedure
TForm17.RadioButton1Click(Sender: TObject);
Var f:textfile;
begin
if
RadioButton1.Checked=True then begin
ComboBox1.Enabled:=True;
ComboBox2.Enabled:=False;
ComboBox3.Enabled:=False;
{$I-}
AssignFile(f,dir+'\Цены\Тонировка\Prof.dat');
{$I+}
If IOResult=0 then begin
Reset(f);
while not EoF(f) do begin
readln(f,t1);
readln(f,t2);
readln(f,t3);
readln(f,t4);
readln(f,t5);
readln(f,t6);
readln(f,t7);
readln(f,t8);
readln(f,t9);
readln(f,t10);
readln(f,t11);
readln(f,t12);
readln(f,t13); end end
else begin Exit;
Showmessage('Ошибка чтения
файла цены');
CloseFile(f);
end;end;end;
procedure
TForm17.RadioButton2Click(Sender: TObject);
Var f:textfile;
begin
if
RadioButton2.Checked=True then begin
ComboBox1.Enabled:=False;
ComboBox2.Enabled:=True;
ComboBox3.Enabled:=False;
{$I-}
AssignFile(f,dir+'\Цены\Тонировка\Dekor.dat');
{$I+}
If IOResult=0 then begin
Reset(f);
while not EoF(f) do begin
readln(f,r1);
readln(f,r2);
readln(f,r3);
readln(f,r4); end end
else begin Exit;
Showmessage('Ошибка чтения
файла цены');
CloseFile(f);
end;end;end;
procedure
TForm17.RadioButton3Click(Sender: TObject);
Var f:textfile;
begin
if RadioButton3.Checked=True
then begin
ComboBox1.Enabled:=False;
ComboBox2.Enabled:=False;
ComboBox3.Enabled:=True;
{$I-}
AssignFile(f,dir+'\Цены\Тонировка\Udar.dat');
{$I+}
If IOResult=0 then begin
Reset(f);
while not EoF(f) do begin
readln(f,h1);
readln(f,h2);
readln(f,h3);
readln(f,h4);
readln(f,h5);
readln(f,h6);
readln(f,h7);
readln(f,h8); end end
else begin Exit;
Showmessage('Ошибка чтения
файла цены');
CloseFile(f);
end;end;end;
procedure
TForm17.SpeedButton8Click(Sender: TObject);
Var f: Integer;
begin
if
Form8.StringGrid2.Cells[4,1]='' then begin
if
(RadioButton1.Checked<>true)and(RadioButton2.Checked<>true)and
(RadioButton3.Checked<>true)
then
Showmessage('Сначала что-нибудь нужно выбрать!')
else
if
(Combobox1.Text='')and(Combobox2.Text='')and
(Combobox3.Text='') then
Showmessage('Выберите конкретный тип тонировки!')
else begin
plo:=StrtoFloat(Form8.StringGrid2.Cells[0,1]);
zen:=strtofloat(Form8.StringGrid2.Cells[6,1])+(strtofloat(senton)*plo);
Form8.StringGrid2.Cells[6,1]:=floattostr(zen);
Form8.StringGrid2.Cells[4,1]:=ton;
for f := 0 to
ComponentCount - 1 do
if (Components[f] is
TCombobox) then
(Components[f] as
TCombobox).Items.Clear;Close;end;
end else begin
Showmessage('Окно можно тонировать
только один раз!');
Close;end;end;
procedure
TForm17.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.Text='R
Silver 20' then begin
ton:=ComboBox1.Text;
senton:=t1;end;
if ComboBox1.Text='R
Silver 35' then begin
ton:=ComboBox1.Text;
senton:=t2; end;
if ComboBox1.Text='R
Silver 50' then begin
ton:=ComboBox1.Text;
senton:=t3; end;
if ComboBox1.Text='R Grey
10' then begin
ton:=ComboBox1.Text;
senton:=t4; end;
if ComboBox1.Text='R Blue
15' then begin
ton:=ComboBox1.Text;
senton:=t5; end;
if ComboBox1.Text='R Gold
15 ' then begin
ton:=ComboBox1.Text;
senton:=t6; end;
if ComboBox1.Text='R Green
10' then begin
ton:=ComboBox1.Text;
senton:=t7; end;
if ComboBox1.Text='R
Bronze 10' then begin
ton:=ComboBox1.Text;
senton:=t8;end;
if ComboBox1.Text='HP
Natural 20 ' then begin
ton:=ComboBox1.Text;
senton:=t9;end;
if ComboBox1.Text='HP
Natural 35 ' then begin
ton:=ComboBox1.Text;
senton:=t10; end;
if ComboBox1.Text='HP
Bronze 35 ' then begin
ton:=ComboBox1.Text;
senton:=t11; end;
if ComboBox1.Text='HP Blue
35 ' then begin
ton:=ComboBox1.Text;
senton:=t12; end;
if ComboBox1.Text='HP
Green 30 ' then begin
ton:=ComboBox1.Text;
senton:=t13;end;end;
procedure
TForm17.ComboBox2Change(Sender: TObject);
begin
if ComboBox2.Text='Matt
White' then begin
ton:=ComboBox2.Text;
senton:=r1;end;
if ComboBox2.Text='Matt
Bronze' then begin
ton:=ComboBox2.Text;
senton:=r2;end;
if ComboBox2.Text='Matt
Silver' then begin
ton:=ComboBox2.Text;
senton:=r3;end;
if ComboBox2.Text='Black
Out' then begin
ton:=ComboBox2.Text;
senton:=r4;end;end;
procedure
TForm17.ComboBox3Change(Sender: TObject);
begin
if ComboBox3.Text='100 MIC
Silver 20' then begin
ton:=ComboBox3.Text;
senton:=h1;end;
if ComboBox3.Text='Safety
2 MIL' then begin
ton:=ComboBox3.Text;
senton:=h2;end;
if ComboBox3.Text='Safety
4 MIL' then begin
ton:=ComboBox3.Text;
senton:=h3;end;
if ComboBox3.Text='Safety
7 MIL' then begin
ton:=ComboBox3.Text;
senton:=h4;end;
if ComboBox3.Text='Класс защиты А1' then begin
ton:=ComboBox3.Text;
senton:=h5;end;
if ComboBox3.Text='Класс защиты А2' then begin
ton:=ComboBox3.Text;
senton:=h6;end;
if ComboBox3.Text='Класс защиты А3' then begin
ton:=ComboBox3.Text;
senton:=h7;end;
if ComboBox3.Text='Стекло 4мм' then begin
ton:=ComboBox3.Text;
senton:=h8;end;end;
procedure
TForm17.SpeedButton1Click(Sender: TObject);
begin form22.Show;end;end.
unit Unit18;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, Spin, jpeg, ExtCtrls,unit1,unit8;
type
TForm18 = class(TForm)
Image1: TImage; Label1:
TLabel; Label2: TLabel; SpeedButton8: TSpeedButton;
RadioButton1:
TRadioButton;RadioButton2: TRadioButton;ComboBox1: TComboBox;
SpinEdit1: TSpinEdit;
CheckBox1: TCheckBox;
procedure
SpeedButton8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form18: TForm18;
h100,h150,h200,h250,h300,h350,h400,h450,h500,h600,h700,h800:string;
implementation
{$R *.dfm}
procedure
TForm18.SpeedButton8Click(Sender: TObject);
Var f:textfile;k:integer;l,z:real;
begin l:=0; z:=0;
if
Form8.StringGrid2.Cells[2,1]='да'
then begin
Showmessage('На окно можно ставить
только один подоконник!');
Close; end else
if
(RadioButton1.Checked<>true)and(RadioButton2.Checked<>true)
then Showmessage('Сначала что-нибудь
нужно выбрать!')
else
if
(Combobox1.Text='')or(SpinEdit1.Value<=0)then
Showmessage('Введите все необходимые
данные!')
else begin
if
RadioButton2.Checked=True then begin
markP:='Ulьtra';
{$I-}
AssignFile(f,dir+'\Цены\Подоконники\Ultra.dat');
{$I+}
If IOResult=0 then
begin Reset(f);
while not EoF(f) do begin
readln(f,h100);
readln(f,h150);
readln(f,h200);
readln(f,h250);
readln(f,h300);
readln(f,h350);
readln(f,h400);
readln(f,h450);
readln(f,h500);
readln(f,h600);
readln(f,h700); readln(f,h800);
end;
if Combobox1.Text='100'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h100);
podsen:=floattostr(l);
razpod:='100'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='150'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h150);
podsen:=floattostr(l);
razpod:='150'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='200'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h200);
podsen:=floattostr(l);
razpod:='200'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='250'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h250);
podsen:=floattostr(l);
razpod:='250'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='300'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h300);
podsen:=floattostr(l);
razpod:='300'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='350'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h350);
podsen:=floattostr(l);
razpod:='350'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='400'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h400);
podsen:=floattostr(l);
razpod:='400'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='450'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h450);
podsen:=floattostr(l);
razpod:='450'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='500'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h500);
podsen:=floattostr(l);
razpod:='500'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='600'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h600);
podsen:=floattostr(l);
razpod:='600'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='700'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h700);
podsen:=floattostr(l);
razpod:='700'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='800'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h800);
podsen:=floattostr(l);
razpod:='800'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
end else begin Exit;
Showmessage('Ошибка чтения файла цены');
end; CloseFile(f); Close; end;
if RadioButton1.Checked=True
then begin
markP:='Moller';
{$I-}
AssignFile(f,dir+'\Цены\Подоконники\Moller.dat');
{$I+}
If IOResult=0 then begin
Reset(f);
while not EoF(f) do begin
readln(f,h150);
readln(f,h200);
readln(f,h250);
readln(f,h300);
readln(f,h350);
readln(f,h400);
readln(f,h450);
readln(f,h500);
readln(f,h600); end;
if
(Combobox1.Text='100')or(Combobox1.Text='700')or(Combobox1.Text='800') then
Showmessage('Такого размера нет,
выберите другой!')
else begin
if Combobox1.Text='150'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h150);
podsen:=floattostr(l);
razpod:='150'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='200'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h200);
podsen:=floattostr(l);
razpod:='200'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='250'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h250);
podsen:=floattostr(l);
razpod:='250'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[0,6]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='300'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h300);
podsen:=floattostr(l);
razpod:='300'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='350'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h350);
podsen:=floattostr(l);
razpod:='350'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='400'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h400);
podsen:=floattostr(l);
razpod:='400'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='450'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h450);
podsen:=floattostr(l);
razpod:='450'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='500'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h500);
podsen:=floattostr(l);
razpod:='500'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end;
if Combobox1.Text='600'
then begin
l:=(SpinEdit1.Value*0.001)*strtofloat(h600);
podsen:=floattostr(l);
razpod:='600'+'x'+inttostr(SpinEdit1.Value);
if CheckBox1.Checked=true
then l:=l+2.1;
z:=strtofloat(Form8.StringGrid2.Cells[6,1])+l;
Form8.StringGrid2.Cells[6,1]:=floattostr(z);
Form8.StringGrid2.Cells[2,1]:='да'; end; Close
end; end else begin Exit;
Showmessage('Ошибка чтения
файла цены'); end;
CloseFile(f);
end;end;end;end.
unit Unit19;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls,unit8, Spin, jpeg, ExtCtrls;
type
TForm19 = class(TForm)
Image1: TImage; Label13:
TLabel;SpinEdit1: TSpinEdit; SpeedButton8: TSpeedButton;
Label1: TLabel; procedure
SpeedButton8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form19: TForm19;
implementation
{$R *.dfm}
procedure
TForm19.SpeedButton8Click(Sender: TObject);
Var pl,sum:real;k:integer;
begin
if
Form8.StringGrid2.Cells [3,1]<>'да' then
begin
pl:=strtofloat(Form8.StringGrid2.Cells
[6,1]);
sum:=SpinEdit1.Value*0.003;
sum:=pl+sum;
Form8.StringGrid2.Cells
[6,1]:=floattostr(sum);
Form8.StringGrid2.Cells
[3,1]:='да';
Close;endelse
Showmessage('На этом окне профиль уже учтён!')end;end.
unit Unit20;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons,
StdCtrls, Spin, jpeg, ExtCtrls;
type
TForm20 = class(TForm)
Image1: TImage;
Label13: TLabel; SpinEdit1: TSpinEdit; Label1: TLabel;
SpeedButton8:
TSpeedButton; procedure SpeedButton8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form20: TForm20;
implementation
uses Unit8;
{$R *.dfm}
procedure
TForm20.SpeedButton8Click(Sender: TObject);
Var pl,sum:real;k:integer;
begin
pl:=strtofloat(Form8.StringGrid2.Cells
[6,1]);
sum:=SpinEdit1.Value*0.025;
sum:=pl+sum;
Form8.StringGrid2.Cells
[6,1]:=floattostr(sum);
if (Components[k] is
TSpinEdit) then
(Components[k] as
TSpinEdit).Value:=0;Close end; end.
unit Unit21;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, Buttons,
jpeg, unit1, ExtCtrls;
type
TForm21 = class(TForm)
StringGrid3: TStringGrid;
Image1: TImage; SpeedButton1: TSpeedButton;
SpeedButton2:
TSpeedButton; procedure FormCreate(Sender: TObject);
procedure
SpeedButton2Click(Sender: TObject);
procedure
SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form21: TForm21;
implementation
{$R *.dfm}
procedure
TForm21.FormCreate(Sender: TObject);
begin
StringGrid3.Cells[0,0]:='Ширина';
StringGrid3.Cells[1,0]:='Moller(Германия)';
StringGrid3.Cells[2,0]:='Ulьtra(Ростов)';
StringGrid3.Cells[0,1]:='100';StringGrid3.Cells[0,2]:='150';
StringGrid3.Cells[0,3]:='200';StringGrid3.Cells[0,4]:='250';
StringGrid3.Cells[0,5]:='300';StringGrid3.Cells[0,6]:='350';
StringGrid3.Cells[0,7]:='400';StringGrid3.Cells[0,8]:='450';
StringGrid3.Cells[0,9]:='500';StringGrid3.Cells[0,10]:='600';
StringGrid3.Cells[0,11]:='700';StringGrid3.Cells[0,12]:='800';
StringGrid3.Cells[1,2]:='10,6';StringGrid3.Cells[1,3]:='12,1';
StringGrid3.Cells[1,4]:='14,5';StringGrid3.Cells[1,5]:='16,8';
StringGrid3.Cells[1,6]:='19,7';StringGrid3.Cells[1,7]:='22,4';
StringGrid3.Cells[1,8]:='25,4';StringGrid3.Cells[1,9]:='31,9';
StringGrid3.Cells[1,10]:='35,9';StringGrid3.Cells[2,1]:='3,8';
StringGrid3.Cells[2,2]:='5,7';StringGrid3.Cells[2,3]:='7,6';
StringGrid3.Cells[2,4]:='9,5';StringGrid3.Cells[2,5]:='11,5';
StringGrid3.Cells[2,6]:='13,4';StringGrid3.Cells[2,7]:='15,3';
StringGrid3.Cells[2,8]:='17,2';StringGrid3.Cells[2,9]:='19,1';
StringGrid3.Cells[2,10]:='21';StringGrid3.Cells[2,11]:='22,9';
StringGrid3.Cells[2,12]:='30,5';end;
procedure
TForm21.SpeedButton2Click(Sender: TObject);
Var s:string;f:textfile;
begin
{$I-}
AssignFile(f,dir+'\Цены\Подоконники\');
{$I+}
If IOResult=0 then
s:=dir+'\Цены\Подоконники\';
{$I-}
Rewrite(f,s+'Moller.dat');
{$I+}
If IOResult=0 then begin
Writeln(f,StringGrid3.Cells[1,2]);Writeln(f,StringGrid3.Cells[1,3]);
Writeln(f,StringGrid3.Cells[1,4]);Writeln(f,StringGrid3.Cells[1,5]);
Writeln(f,StringGrid3.Cells[1,6]);Writeln(f,StringGrid3.Cells[1,7]);
Writeln(f,StringGrid3.Cells[1,8]);Writeln(f,StringGrid3.Cells[1,9]);
Writeln(f,StringGrid3.Cells[1,10]);CloseFile(f);
Rewrite(f,s+'Ultra.dat');Writeln(f,StringGrid3.Cells[2,1]);
Writeln(f,StringGrid3.Cells[2,2]);Writeln(f,StringGrid3.Cells[2,3]);
Writeln(f,StringGrid3.Cells[2,4]);Writeln(f,StringGrid3.Cells[2,5]);
Writeln(f,StringGrid3.Cells[2,6]);Writeln(f,StringGrid3.Cells[2,7]);
Writeln(f,StringGrid3.Cells[2,8]);Writeln(f,StringGrid3.Cells[2,9]);
Writeln(f,StringGrid3.Cells[2,10]);Writeln(f,StringGrid3.Cells[2,11]);
Writeln(f,StringGrid3.Cells[2,12]);CloseFile(f);
ShowMessage('Данные сохранены успешно!');end else begin
Exit;ShowMessage('Ошибка при зиписи в файл!');end;end;
procedure
TForm21.SpeedButton1Click(Sender: TObject);
begin Close;end;end.
unit Unit22;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids,
Buttons, jpeg,Unit1, ExtCtrls;
type
TForm22 = class(TForm)
Image1: TImage;
StringGrid1: TStringGrid;Label1: TLabel; Label2: TLabel;
StringGrid2: TStringGrid;StringGrid3:
TStringGrid; Label3: TLabel;
SpeedButton2:
TSpeedButton; SpeedButton1: TSpeedButton;
procedure
FormCreate(Sender: TObject);
procedure
SpeedButton2Click(Sender: TObject);
procedure
SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var Form22: TForm22;
implementation
uses Unit13;
{$R *.dfm}
procedure
TForm22.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[0,0]:='Название';StringGrid1.Cells[1,0]:='Цвет';
StringGrid1.Cells[2,0]:='Светопропуск';StringGrid1.Cells[3,0]:='Цена(1м.кв)';
StringGrid1.Cells[0,1]:='R
Silver 20';StringGrid1.Cells[0,2]:='R Silver 35';
StringGrid1.Cells[0,3]:='R
Silver 50';StringGrid1.Cells[0,4]:='R Grey 10';
StringGrid1.Cells[0,5]:='R
Blue 15';StringGrid1.Cells[0,6]:='R Gold 15';
StringGrid1.Cells[0,7]:='R
Green 10';StringGrid1.Cells[0,8]:='R Bronze 10';
StringGrid1.Cells[0,9]:='HP
Natural 20';StringGrid1.Cells[0,10]:='HP Natural 35';
StringGrid1.Cells[0,11]:='HP
Bronze 35';StringGrid1.Cells[0,12]:='HP Blue 35';
StringGrid1.Cells[0,13]:='HP
Green 30';StringGrid1.Cells[1,1]:='Серебро';
StringGrid1.Cells[1,2]:='Серебро';StringGrid1.Cells[1,3]:='Серебро';
StringGrid1.Cells[1,4]:='Серый';StringGrid1.Cells[1,5]:='Голубой';
StringGrid1.Cells[1,6]:='Золото';StringGrid1.Cells[1,7]:='Зеленый';
StringGrid1.Cells[1,8]:='Бронза';StringGrid1.Cells[1,9]:='Нейтральный';
StringGrid1.Cells[1,10]:='Нейтральный';StringGrid1.Cells[1,11]:='Бронза';
StringGrid1.Cells[1,12]:='Голубой';StringGrid1.Cells[1,13]:='Зеленый';
StringGrid1.Cells[2,1]:='18';StringGrid1.Cells[2,2]:='28';StringGrid1.Cells[2,3]:='47';
StringGrid1.Cells[2,4]:='7';StringGrid1.Cells[2,5]:='15';StringGrid1.Cells[2,6]:='15';
StringGrid1.Cells[2,7]:='10';StringGrid1.Cells[2,8]:='8';StringGrid1.Cells[2,9]:='24';
StringGrid1.Cells[2,10]:='35';StringGrid1.Cells[2,11]:='37';StringGrid1.Cells[2,12]:='35';
StringGrid1.Cells[2,13]:='30';StringGrid1.Cells[3,1]:='14,3';StringGrid1.Cells[3,2]:='15,3';
StringGrid1.Cells[3,3]:='15,3';StringGrid1.Cells[3,4]:='15,3';StringGrid1.Cells[3,5]:='15,3';
StringGrid1.Cells[3,6]:='15,3';StringGrid1.Cells[3,7]:='15,3';
StringGrid1.Cells[3,8]:='15,3';StringGrid1.Cells[3,9]:='19,1';
StringGrid1.Cells[3,10]:='19,1';StringGrid1.Cells[3,11]:='19,1';
StringGrid1.Cells[3,12]:='19,1';StringGrid1.Cells[3,13]:='19,1';
StringGrid2.Cells[0,0]:='Название';StringGrid2.Cells[1,0]:='Цвет';
StringGrid2.Cells[2,0]:='Светопропуск';StringGrid2.Cells[3,0]:='Цена(1м.кв)';
StringGrid2.Cells[0,1]:='Matt
White';StringGrid2.Cells[0,2]:='Matt Bronze';
StringGrid2.Cells[0,3]:='Matt
Silver';StringGrid2.Cells[0,4]:='Black Out';
StringGrid2.Cells[1,1]:='Белый';StringGrid2.Cells[1,2]:='Бронза';
StringGrid2.Cells[1,3]:='Серебро';StringGrid2.Cells[1,4]:='Черный';
StringGrid2.Cells[2,1]:='69';StringGrid2.Cells[2,2]:='36';
StringGrid2.Cells[2,3]:='16';StringGrid2.Cells[2,4]:='0';
StringGrid2.Cells[3,1]:='15,3';StringGrid2.Cells[3,2]:='15,3';
StringGrid2.Cells[3,3]:='15,3';StringGrid2.Cells[3,4]:='17,5';
StringGrid3.Cells[0,0]:='Название';StringGrid3.Cells[1,0]:='Цвет';
StringGrid3.Cells[2,0]:='Светопропуск';StringGrid3.Cells[3,0]:='Цена(1м.кв)';
StringGrid3.Cells[0,1]:='100MIC
Silver 20';StringGrid3.Cells[0,2]:='Safety 2 MIL';
StringGrid3.Cells[0,3]:='Safety
4 MIL';StringGrid3.Cells[0,4]:='Safety 7 MIL';
StringGrid3.Cells[0,5]:='Класс защиты
А1';StringGrid3.Cells[0,6]:='Класс защиты А2';
StringGrid3.Cells[0,7]:='Класс защиты
А3';StringGrid3.Cells[0,8]:='Стекло 4мм';
StringGrid3.Cells[1,1]:='Серебро';StringGrid3.Cells[1,2]:='Прозрачная';
StringGrid3.Cells[1,3]:='Прозрачная';StringGrid3.Cells[1,4]:='Прозрачная';
StringGrid3.Cells[1,8]:='Бронза в массе';StringGrid3.Cells[2,1]:='20';
StringGrid3.Cells[2,2]:='98';StringGrid3.Cells[2,3]:='89';
StringGrid3.Cells[2,4]:='89';StringGrid3.Cells[3,1]:='32,3';
StringGrid3.Cells[3,2]:='24,9';StringGrid3.Cells[3,3]:='27';
StringGrid3.Cells[3,4]:='32,3';StringGrid3.Cells[3,5]:='39,7';
StringGrid3.Cells[3,6]:='52,9';StringGrid3.Cells[3,7]:='79,4';
StringGrid3.Cells[3,8]:='24,4';end;
procedure
TForm22.SpeedButton2Click(Sender: TObject);
Var s:string;f:textfile;begin{$I-}
AssignFile(f,dir+'\Цены\Тонировка\');{$I+}
If IOResult=0 then s:=dir+'\Цены\Тонировка\';{$I-}
Rewrite(f,s+'Prof.dat');
{$I+} If IOResult=0 then begin
Writeln(f,StringGrid1.Cells[3,1]);Writeln(f,StringGrid1.Cells[3,2]);
Writeln(f,StringGrid1.Cells[3,3]);Writeln(f,StringGrid1.Cells[3,4]);
Writeln(f,StringGrid1.Cells[3,5]);Writeln(f,StringGrid1.Cells[3,6]);
Writeln(f,StringGrid1.Cells[3,7]);Writeln(f,StringGrid1.Cells[3,8]);
Writeln(f,StringGrid1.Cells[3,9]);Writeln(f,StringGrid1.Cells[3,10]);
Writeln(f,StringGrid1.Cells[3,11]);Writeln(f,StringGrid1.Cells[3,12]);
Writeln(f,StringGrid1.Cells[3,13]);CloseFile(f);Rewrite(f,s+'Dekor.dat');
Writeln(f,StringGrid2.Cells[3,1]);Writeln(f,StringGrid2.Cells[3,2]);
Writeln(f,StringGrid2.Cells[3,3]);Writeln(f,StringGrid2.Cells[3,4]);
CloseFile(f);Rewrite(f,s+'Udar.dat');Writeln(f,StringGrid3.Cells[3,1]);
Writeln(f,StringGrid3.Cells[3,2]);Writeln(f,StringGrid3.Cells[3,3]);
Writeln(f,StringGrid3.Cells[3,4]);Writeln(f,StringGrid3.Cells[3,5]);
Writeln(f,StringGrid3.Cells[3,6]);Writeln(f,StringGrid3.Cells[3,7]);
Writeln(f,StringGrid3.Cells[3,8]);CloseFile(f);
ShowMessage('Данные сохранены успешно!');end else beginExit;
ShowMessage('Ошибка при зиписи в файл!');end;end;
procedure
TForm22.SpeedButton1Click(Sender: TObject);
begin Close;end;end.
|