Coding/Listing :
public
{ Public declarations }
procedure aktif;
procedure nonaktif;
procedure bersih;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.aktif;
begin
cbmerk.Enabled := true;
cbtipe.Enabled := true;
eharga.Enabled := true;
rbdistributor.Enabled := true;
rbinternasional.Enabled := true;
egaransi.Enabled := true;
chwin7.Enabled := true;
eos.Enabled := true;
ejumbel.Enabled := true;
esubtotal.Enabled := true;
epotongan.Enabled := true;
etotal.Enabled := true;
ebayar.Enabled := true;
ekembali.Enabled := true;
end;
procedure TForm1.nonaktif;
begin
cbmerk.Enabled := false;
cbtipe.Enabled := false;
eharga.Enabled := false;
rbdistributor.Enabled := false;
rbinternasional.Enabled := false;
egaransi.Enabled := false;
chwin7.Enabled := false;
eos.Enabled := false;
ejumbel.Enabled := false;
esubtotal.Enabled := false;
epotongan.Enabled := false;
etotal.Enabled := false;
ebayar.Enabled := false;
ekembali.Enabled := false;
end;
procedure TForm1.bersih;
begin
cbmerk.Text := '--Silakan Pilih--';
cbtipe.Text := '--Silakan pilih--';
eharga.Text := '0';
rbdistributor.Checked := false;
rbinternasional.Checked := false;
egaransi.Text := '0';
chwin7.Checked := false;
eos.Text := '0';
ejumbel.Text := '0';
esubtotal.Text := '0';
epotongan.Text := '0';
etotal.Text := '0';
ebayar.Text := '0';
ekembali.Text := '0';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
cbmerk.Items.Add('ACER');
cbmerk.Items.Add('DELL');
cbmerk.Items.Add('TOSHIBA');
end;
procedure TForm1.cbmerkClick(Sender: TObject);
begin
if cbmerk.Text = 'ACER' then
begin
cbtipe.Text := '--Silakan Pilih--';
cbtipe.Items.Add('AC11R');
cbtipe.Items.Add('AC12R');
end
else if cbmerk.Text = 'DELL' then
begin
cbtipe.Text := '--Silakan Pilih--';
cbtipe.Items.Add('DE13L');
cbtipe.Items.Add('DE14L');
end
else if cbmerk.Text = 'TOSHIBA' then
begin
cbtipe.Text := '--Silakan Pilih--';
cbtipe.Items.Add('TO15A');
cbtipe.Items.Add('TO16A');
end
end;
procedure TForm1.cbtipeClick(Sender: TObject);
begin
if cbtipe.Text = 'AC11R' then
eharga.Text := '1100000'
else if cbtipe.Text = 'AC12R' then
eharga.Text := '1200000'
else if cbtipe.Text = 'DE13L' then
eharga.Text := '1300000'
else if cbtipe.Text = 'DE13L' then
eharga.Text := '1400000'
else if cbtipe.Text = 'TO15A' then
eharga.Text := '1500000'
else
eharga.Text := '1600000'
end;
procedure TForm1.rbdistributorClick(Sender: TObject);
begin
if rbdistributor.Checked = true then
egaransi.Text := '200000'
else
egaransi.Text := '0';
end;
procedure TForm1.rbinternasionalClick(Sender: TObject);
begin
if rbinternasional.Checked = true then
egaransi.Text := '400000'
else
egaransi.Text := '0';
end;
procedure TForm1.ejumbelKeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
esubtotal.Text := floattostr((strtofloat(eharga.Text)*strtofloat(ejumbel.Text))+strtofloat(egaransi.Text)+strtofloat(eos.Text));
if strtofloat(ejumbel.Text)>= 5 then
epotongan.Text := floattostr(0.5*strtofloat(esubtotal.Text))
else if strtofloat(ejumbel.Text)>= 2 then
epotongan.Text:= floattostr(0.1*strtofloat(esubtotal.Text))
else
epotongan.Text:=floattostr(0);
etotal.Text := floattostr(strtofloat(esubtotal.Text)-strtofloat(epotongan.Text));
end;
procedure TForm1.ebayarKeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
begin
ekembali.Text := floattostr(strtofloat(ebayar.Text)-strtofloat(etotal.Text));
nonaktif;
end
end;
procedure TForm1.bbersihClick(Sender: TObject);
begin
bersih;
aktif;
end;
procedure TForm1.chwin7Click(Sender: TObject);
begin
if chwin7.Checked = true then
eos.Text := '600000'
else
eos.Text := '0';
ejumbel.SetFocus;
end;
procedure TForm1.bkeluarClick(Sender: TObject);
begin
if(application.MessageBox('Yakin Ingin Keluar Dari Program Ini...?!','Question', 4+32)=6)then
close
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
nonaktif;
bersih;
end;
end.
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :