Codingan Program pembayaran rumah sakit lazarus
unit UPembayaran;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
DateTimePicker;
type
{ TForm1 }
TForm1 = class(TForm)
BBAYAR: TButton;
BRESET: TButton;
BKELUAR: TButton;
DTGL: TDateTimePicker;
ENOMOR: TEdit;
ELAMA: TEdit;
ENAMA: TEdit;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
Image1: TImage;
Image2: TImage;
Label1: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
L6: TLabel;
L5: TLabel;
L4: TLabel;
L3: TLabel;
L2: TLabel;
L1: TLabel;
Label13: TLabel;
L7: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
RAWATJALAN: TRadioButton;
RAWATMONDOK: TRadioButton;
TANPABPJS: TRadioButton;
BPJS: TRadioButton;
procedure BBAYARClick(Sender: TObject);
procedure BKELUARClick(Sender: TObject);
procedure BRESETClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure RAWATJALANClick(Sender: TObject);
procedure RAWATMONDOKClick(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormActivate(Sender: TObject);
begin
ELAMA.Enabled:=FALSE;
ELAMA.Text:='';
ENAMA.Text:='';
ENOMOR.Text:='';
BRESET.Enabled:=False;
L1.Caption:='';
L2.Caption:='';
L3.Caption:='';
L4.Caption:='';
L5.Caption:='';
L6.Caption:='';
L7.Caption:='TOTAL PEMBAYARAN';
end;
procedure TForm1.RAWATJALANClick(Sender: TObject);
begin
ELAMA.Enabled:=FALSE;
end;
procedure TForm1.RAWATMONDOKClick(Sender: TObject);
begin
ELAMA.Enabled:=TRUE;
end;
procedure TForm1.BRESETClick(Sender: TObject);
begin
FormActivate(Sender);
end;
procedure TForm1.BKELUARClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.BBAYARClick(Sender: TObject);
var
total : Double;
diskon : Double;
harga : Double;
lama : Double;
begin
L1.Caption:=ENAMA.Text;
L2.Caption:=FormatDateTime('dd/mm/yyyy',DTGL.DateTime);
L3.Caption:=ENOMOR.Text;
if RAWATJALAN.Checked=True then
begin
L4.Caption:='RAWAT JALAN';
harga:=50000;
total:=harga*diskon;
end
else if RAWATMONDOK.Checked=True then
begin
L4.Caption:='RAWAT MONDOK';
harga:=100000;
lama:=StrToFloat(ELAMA.Text);
total:=(harga*lama)*diskon;
end;
L5.Caption:=ELAMA.Text;
if BPJS.Checked=True then
begin
L6.Caption:='BPJS';
diskon:=0.95;
end
ELSE if TANPABPJS.Checked=True then
begin
L6.Caption:='TANPA BPJS';
diskon:=10000;
end;
total:=harga*diskon;
L7.Caption:=FloatToStr(total);
BRESET.Enabled:=True;
end;
end.
Public Last updated: 2019-07-02 02:33:28 AM