MEMBUAT PROGRAM BIAYA RUMAH SAKIT MENGGUNAKAN DELPHI 7

a

2. DESIGN PROPERTIES
OBJECT
NAME
CAPTION
Label 1Label1RUMAH SAKIT BAKTI INSANI
Label 2Label2Kode Dokter
Label 3Label3Nama Dokter
Label 4Label4Spesialis
Label 5Label5Biaya Periksa (RP)
Label 6Label6Kode Obat
Label 7Label7Nama Obat
Label 8Label8Harga Obat (RP)
Label 9Label9Uang Bayar (RP)
Label 10Label10Kembali (RP)
Combo Boxcmbkode–
Group BoxGroupBox1DATA OBAT
Edit 1Edokter–
Edit 2Espesialis–
Edit 3ebiaya–
Edit 4ekode–
Edit 5eobat–
Edit 6eharga–
Edit 7etotal–
Edit 8ebayar–
Edit 9ekembali–
Button 1btotalTOTAL
Button 2bkeluar&KELUAR
Button 3
bbersih
&BERSIH
3. LISTING PROGRAM
procedure TFORMRS.FormCreate(Sender: TObject);
begin
cmbkode.Items.Add(‘DRD01’);
cmbkode.Items.Add(‘DRJ02’);
cmbkode.Items.Add(‘DRM03′);
end;
procedure TFORMRS.cmbkodeClick(Sender: TObject);
begin
if cmbkode.Text=’DRD01′ then
begin
edokter.Text:=’dr Okta’;
espesialis.Text:=’Penyakit Dalam’;
ebiaya.Text:=’2000000′;
end
else
if cmbkode.Text=’DRJ02′ then
begin
edokter.Text:=’dr Yondra’;
espesialis.Text:=’Gangguan Jiwa’;
ebiaya.Text:=’150000′;
end
else
if cmbkode.Text=’DRM03′ then
begin
edokter.Text:=’dr Wulan’;
espesialis.Text:=’Mata’;
ebiaya.Text:=’1000000′;
end
else
begin
edokter.Text:=’-‘;
espesialis.Text:=’-‘;
ebiaya.Text:=’0′;
end
end;
procedure TFORMRS.ekodeKeyPress(Sender: TObject; var Key: Char);
begin
if ekode.Text=’B001′ then
begin
eobat.Text:=’Paracetamol’;
eharga.Text:=’10000′
end
else
if ekode.Text=’B002′ then
begin
eobat.Text:=’Paratusin’;
eharga.Text:=’12000′
end
else
if ekode.Text=’B003′ then
begin
eobat.Text:=’Amoxilin’;
eharga.Text:=’15000′
end
else
begin
eobat.Text:=’-‘;
eharga.Text:=’0’;
end
end;
procedure TFORMRS.btotalClick(Sender: TObject);
var biaya,total,harga:longint;
begin
biaya:=strtoint(ebiaya.Text);
harga:=strtoint(eharga.Text);
total:=biaya+harga;
etotal.Text:=inttostr(total);
ebayar.SetFocus;
end;
procedure TFORMRS.ebayarKeyPress(Sender: TObject; var Key: Char);
var total,bayar,kembali:longint;
begin
if key=#13 then
begin
total:=strtoint(etotal.Text);
bayar:=strtoint(ebayar.Text);
kembali:=bayar-total;
if (bayar<total) then
begin
showmessage(‘MAAF UANG ANDA KURANG Rp.’ + inttostr(total-bayar));
ebayar.Text:=”;
ebayar.SetFocus;
end
else
ekembali.Text:=inttostr(kembali);
end
end;
procedure TFORMRS.bkeluarClick(Sender: TObject);
begin
if application.MessageBox(‘Yakin anda akan keluar???’,’informasi’,mb_yesno)=idyes
then
close;
end;
procedure TFORMRS.bbersihClick(Sender: TObject);
begin
cmbkode.Text:=”;
edokter.Text:=”;
espesialis.Text:=”;
ebiaya.Text:=”;
ekode.Text:=”;
eobat.Text:=”;
eharga.Text:=”;
etotal.Text:=”;
ebayar.Text:=”;
ekembali.Text:=”;
end;
end.
  • Maka setelah jadi tampilannya akan seperti ini :

Komentar

Postingan populer dari blog ini

Cara Instalasi Software Borlan Delphi 7 pada (Windows 7 dan Windows 8)

Menampilkan Data Dari Tabel Dalam Database Ke ComboBox