Rabu, 06 Juni 2012

coding edit foxpro


Coding form edit
Form --------------------------- load
SET DEFAULT TO g:\kuliah\foxpro
USE mahasiswa AGAIN
SET ORDER TO NPM   && NPM
SET DELETED ON

Form ------------- unload
CLOSE ALL
USE mahasiswa EXCLUSIVE
PACK

Tnpm ------------------------keypress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nkeycode=13 then
            SEEK ALLTRIM(thisform.tnpm.Value)
            IF FOUND() THEN
                        thisform.tnpm.Enabled= .F.
                        thisform.tnama.Value=nama
                        thisform.ttmp.Value=tmp_lahir
                        thisform.ttgl.Value=tgl_lahir
                        thisform.tjurusan.Value=jurusan
                        thisform.tnama.Enabled= .T.
                        thisform.ttgl.Enabled= .T.
                        thisform.ttmp.Enabled= .T.
                        thisform.command1.Enabled= .T.
                        thisform.command4.Enabled= .T.
            ELSE
                        MESSAGEBOX("data Tidak ada")
            ENDIF

ENDIF

Edit -------------------- click
replace npm WITH ALLTRIM(thisform.tnpm.Value)
REPLACE nama WITH thisform.tnama.Value
REPLACE tmp_lahir WITH thisform.ttmp.Value
REPLACE tgl_lahir wITH thisform.ttgl.Value
replace jurusan WITH thisform.tjurusan.Value
IF thisform.tjurusan.Value='TI' OR thisform.tjurusan.Value='SI'
replace jenjang WITH 'S1'
ENDIF

IF thisform.tjurusan.Value='MI' OR thisform.tjurusan.Value='KA'
replace jenjang WITH 'D3'
ENDIF

thisform.tnpm.Value=''
thisform.tnama.Value=''
thisform.ttmp.Value=''
thisform.ttgl.Value=''

thisform.grid1.Refresh
thisform.tnpm.Enabled= .T.
thisform.tnama.Enabled= .F.
thisform.ttmp.Enabled= .F.
thisform.ttgl.Enabled= .F.
thisform.tjurusan.Enabled= .F.
thisform.ttgl.Enabled= .F.

thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command4.Enabled = .F.

hapus --------------------click
DELETE
thisform.grid1.Refresh

thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command4.Enabled = .F.

batal ----------------------------click
thisform.tnpm.Value=''
thisform.tnama.Value=''
thisform.ttmp.Value=''
thisform.ttgl.Value=''
thisform.tjurusan.Value=''

thisform.grid1.Refresh
thisform.tnpm.Enabled= .T.
thisform.tnama.Enabled= .F.
thisform.ttmp.Enabled= .F.
thisform.ttgl.Enabled= .F.
thisform.tjurusan.Enabled= .F.

thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command4.Enabled = .F.
thisform.ttgl.Enabled= .F.

Tidak ada komentar:

Posting Komentar