unit Unit1; interface uses Windows, Messages, SysUtils, - TopicsExpress



          

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; cmbkode: TComboBox; Label3: TLabel; Label4: TLabel; Label5: TLabel; Enadet: TEdit; Espesialis: TEdit; Ebiaya: TEdit; GroupBox1: TGroupBox; Label6: TLabel; Label7: TLabel; Label8: TLabel; Ekobat: TEdit; Enabat: TEdit; Eharga: TEdit; Btobay: TButton; Etobay: TEdit; Label9: TLabel; Eubay: TEdit; Label10: TLabel; Ekembali: TEdit; Bbersih: TButton; Bkeluar: TButton; procedure EkobatKeyPress(Sender: TObject; var Key: Char); procedure BtobayClick(Sender: TObject); procedure EubayKeyPress(Sender: TObject; var Key: Char); procedure BbersihClick(Sender: TObject); procedure BkeluarClick(Sender: TObject); procedure cmbkodeClick(Sender: TObject); procedure EnadetChange(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.EkobatKeyPress(Sender: TObject; var Key: Char); begin if Ekobat.Text = B001 then begin Enabat.Text := Paracetamol; Eharga.Text := 10000; end else if Ekobat.Text = B002 then begin Enabat.Text := Paratusin; Eharga.Text := 12000; end else if Ekobat.Text = B003 then begin Enabat.Text := Amoxilin; Eharga.Text := 15000; end else begin Enabat.Text := -; Eharga.Text := 0; end end; procedure TForm1.BtobayClick(Sender: TObject); Var Biaya,Harga,Total:longint; begin Biaya:=strtoint(Ebiaya.Text); Harga:=strtoint(Eharga.Text); Total:=Biaya+Harga; Etobay.Text:=inttostr(Total); Eubay.SetFocus; end; procedure TForm1.EubayKeyPress(Sender: TObject; var Key: Char); var tot,bay,kem : longint; begin if key = #13 then begin tot := strtoint(Etobay.Text); bay := strtoint(Eubay.Text); kem := bay - tot; if (bay < tot) then begin showmessage(Maaf Uang Anda Kurang Rp. + inttostr(tot - bay)); Eubay.Text := ; Eubay.setfocus; end else Ekembali.Text := inttostr(kem); end end; procedure TForm1.BbersihClick(Sender: TObject); begin cmbkode.Text := Pilih; Enadet.Text := ; Espesialis.Text := ; Ebiaya.Text := ; Ekobat.Text := ; Enabat.Text := ; Eharga.Text := ; Etobay.Text := ; Eubay.Text := ; Ekembali.Text := ; end; procedure TForm1.BkeluarClick(Sender: TObject); begin if (application.MessageBox(Are you Sure ????,Confirm,MB_YESNO)=ID_YES) then close; end; procedure TForm1.cmbkodeClick(Sender: TObject); begin if cmbkode.Text =DRD01 Then begin Enadet.Text := dr Oka; Espesialis.Text:= Penyakit Dalam; Ebiaya.Text := 2000000; end Else if cmbkode.Text = DRJ02 Then begin Enadet.Text := dr Yondra ; Espesialis.Text := Gangguan Jiwa; Ebiaya.Text := 1500000; end Else if cmbkode.Text = DRM03 Then begin Enadet.Text := dr Wulan; Espesialis.Text := Mata; Ebiaya.Text := 1000000; end Else begin Enadet.Text := _; Espesialis.Text := _; Ebiaya.Text := 0; end end;
Posted on: Fri, 01 Nov 2013 09:05:03 +0000

Trending Topics



Recently Viewed Topics




© 2015