Рефераты. Расчет стоимости пластиковых оконных конструкций и дверей

Label4.Caption:='Входная дверь';

pay:=strtoint(tri);

if odn='1' then

pay:=pay-6;

{$I-}

AssignFile(dop,dir+'\Технические допуски\Входная дверь.dat');

{$I+}

If IOResult=0 then begin

Reset(dop);

while not EoF(dop) do begin

readln(dop, minv);

readln(dop, minh);

readln(dop, maxv);

readln(dop, maxh);  end; CloseFile(dop);  end;

SpinEdit1.MinValue:=strtoint(minh);

SpinEdit1.MaxValue:=strtoint(maxh);

SpinEdit2.MinValue:=strtoint(minv);

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,

Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13



2012 © Все права защищены
При использовании материалов активная ссылка на источник обязательна.