Procedure Tform1.Cmdkeluarclick (Sender: Tobject)
Procedure Tform1.Cmdkeluarclick (Sender: Tobject)
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 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;
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;