0% found this document useful (0 votes)
48 views1 page

Procedure Tform1.Cmdkeluarclick (Sender: Tobject)

This document contains procedures for a form that handles sales transactions. It includes procedures for: 1) Calculating subtotal, discount, and total amounts based on quantity and rate entered. 2) Enabling/disabling fields and changing button captions when adding or editing transactions. 3) Searching, navigating, adding, updating, and clearing the transaction records in a database table.

Uploaded by

master_82
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views1 page

Procedure Tform1.Cmdkeluarclick (Sender: Tobject)

This document contains procedures for a form that handles sales transactions. It includes procedures for: 1) Calculating subtotal, discount, and total amounts based on quantity and rate entered. 2) Enabling/disabling fields and changing button captions when adding or editing transactions. 3) Searching, navigating, adding, updating, and clearing the transaction records in a database table.

Uploaded by

master_82
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

procedure TForm1.

elamaKeyPress(Sender: TObject; var Key: Char);

procedure tform1.aktif;

var lm, trf:real; begin if key=#13 then begin lm:=strtofloat(elama.Text); trf:=strtofloat(etarif.Text); esubtotal.Text:=floattostr(lm*trf); if lm > 10 then begin ediskon.Text:=floattostr(strtofloat(esubtotal.Text)*0.1); etotal.Text:=floattostr(strtofloat(esubtotal.Text)strtofloat(ediskon.Text)); end else if lm > 5 then begin ediskon.Text:=floattostr(strtofloat(esubtotal.Text)*0.07); etotal.Text:=floattostr(strtofloat(esubtotal.Text)strtofloat(ediskon.Text)); end else begin ediskon.Text:=floattostr(strtofloat(esubtotal.Text)*0.05); etotal.Text:=floattostr(strtofloat(esubtotal.Text)strtofloat(ediskon.Text));
end end end; procedure TForm1.ebayarKeyPress(Sender: TObject; var Key: Char);

begin ckode.Enabled:=true; ebayar.Enabled:=true; elama.Enabled:=true; bsimpan.Caption:=&Simpan; btambah.Caption:=&Tambah;


end; procedure tform1.FormActivate; begin bersih; noaktif; tbbarang.Refresh; ecari.Enabled:=true; ecari.SetFocus; end; procedure tform1.btambahClick;

begin if key=#13 then ekembali.Text:=floattostr(strtofloat(ebayar.Text)- strtofloat(etotal.Text)) end; procedure TForm1.cmdkeluarClick(Sender: TObject); begin if (application.MessageBox('Mau keluar?','Konfirmasi',mb_yesno)=idyes) then close; end; procedure tform1.bfirstClick;
begin tbbarang.First end;

begin if btambah.Caption=&Tambah then begin aktif; ekode.SetFocus; end else if btambah.Caption=&Edit then begin aktif; bsimpan.Caption:=Update; ekode.enabled:=false; end end;
procedure tform1.bbatalClick;

begin bersih; noaktif; btambah.Caption:=&Tambah; end;


procedure tform1.bsimpanClick;

procedure tform1.bbackClick;
begin if tbbarang.Bof then showmessage(Anda Diakhir Record!) else tbbarang.prior; end;

procedure tform1.bcariClick;
begin tbbarang.IndexName:=; if not tbbarang.FindKey([ecari.Text]) then begin showmessage(Data Tidak Ada); exit; end else ekode.Text:=tbbarang[Kdbarang]; btambah.Caption:=&Edit end;

begin if bsimpan.Caption=&Simpan then begin tbbarang.Append; tbbarang[Kdbarang]:=ekode.Text; tbbarang.Post; bersih; noaktif; end else if bsimpan.Caption=Update then begin tbbarang.Edit; tbbarang[Nmbarang]:=enama.Text; tbbarang.Post; bersih; noaktif; end end;

You might also like