Professional Documents
Culture Documents
Commond 1: Lakukan Penambahan Record Simpan Data
Commond 1: Lakukan Penambahan Record Simpan Data
IF this.Caption='Tambah Data'
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
this.Caption='Simpan'
thisform.hidup
thisform.kosong
thisform.text1.SetFocus
ELSE
IF EMPTY(thisform.text1.Value)
MESSAGEBOX('Data id poli kosong, data tidak
tersimpan',0+64,'Kosong')
RETURN
ENDIF
this.Caption='Tambah Data'
thisform.command2.Enabled= .T.
thisform.command3.Enabled= .T.
ENDIF
Commond 2
IF this.Caption='Koreksi Data'
thisform.command1.Enabled= .F.
thisform.command3.Enabled= .F.
this.Caption='Simpan'
thisform.hidup
thisform.kosong
thisform.text1.SetFocus
ELSE
IF EMPTY(thisform.text1.Value)
MESSAGEBOX('Data id poli kosong, data tidak
tersimpan',0+64,'Kosong')
RETURN
ENDIF
this.Caption='Tambah Data'
thisform.command1.Enabled= .T.
thisform.command3.Enabled= .T.
ENDIF
Text 1
IF EMPTY(this.Value)
RETURN
ENDIF
IF thisform.command1.Enabled= .T. &&isi data
SEEK ALLTRIM(this.Value) &&cari data
IF FOUND() &&jika ketemu
thisform.tampil
MESSAGEBOX('Data sudah ada',0+64,'Ada')
thisform.kosong
return(.f.)
ELSE &&data tidak ada
ENDIF
ENDIF
Form 1
Kosong
thisform.text1.Value=' '
thisform.text2.Value=' '
Mati
thisform.text1.Enabled= .F.
thisform.text2.Enabled= .F.
Tampil
thisform.text1.Value=idpoli
thisform.text2.Value=tupoli
Simpan
Hidup
thisform.text1.Enabled= .T.
thisform.text2.Enabled= .T.
Init
* thisform.mati
Simpan
IF SEEK (ALLTRIM(thisform.text1.Value))
MESSAGEBOX('Maaf id poli tersebut sudah ada',0+16,'Peringatan')
RETURN
ENDIF
APPEND BLANK
REPLACE idpoli WITH thisform.text1.Value
REPLACE tupoli WITH thisform.text2.Value
thisform.text1.Value=' '
thisform.text2.Value=' '
thisform.text1.Enabled= .F.
thisform.text2.Enabled= .F.
thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command1.SetFocus
thisform.Refresh
hapus
DELETE
thisform.text1.Value=' '
thisform.text2.Value=' '
thisform.text1.SetFocus
thisform.grdPoli.Refresh
batal
thisform.text1.Value=' '
thisform.text2.Value=' '
thisform.text1.Enabled= .F.
thisform.text2.Enabled= .F.
thisform.command1.Enabled= .T.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command1.SetFocus
thisform.Refresh