Coding Foxpro Sederhana

Bonvisa Satu Hati

Form.active
if used("mahasiswa")
 sele mahasiswa
 set order to tag nim
endif
 
if awalmahasiswa=.t.
 thisform.textmati()
 thisform.tampildata()
 awalmahasiswa=.f.
else
 thisform.refresh()
 thisform.textkosong()
 thisform.textmati()
endif


form.init
public editmahasiswa, awalmahasiswa
editmahasiswa=.f.
awalmahasiswa=.f.

form.unload
release editmahasiswa, awalmahasiswa

form.tampildata
with thisform
 .text1.value=nim
 .text2.value=nama
 .text3.value=jurusan
 .text4.value=jenjang
 .text5.value=semester
 .text6.value=thn_akademik
 .text7.value=jml_sks
Endwith

Form.texthidup
with thisform
 .text1.enabled=.t.
 .text2.enabled=.t.
 .text3.enabled=.t.
 .text4.enabled=.t.
 .text5.enabled=.t.
 .text6.enabled=.t.
 .text7.enabled=.t.
endwith

form.textkosong
with thisform
 .text1.value=' '
 .text2.value=' '
 .text3.value=' '
 .text4.value=' '
 .text5.value=0
 .text6.value=' '
 .text7.value=0
Endwith

Form.textmati
with thisform
 .text1.enabled=.f.
 .text2.enabled=.f.
 .text3.enabled=.f.
 .text4.enabled=.f.
 .text5.enabled=.f.
 .text6.enabled=.f.
 .text7.enabled=.f.
endwith


input.click 
thisform.texthidup()
thisform.textkosong()
thisform.text1.setfocus()

hapus.click 
jwb=messagebox("BENAR MAU DIHAPUS..?",4+64,"INFO HAPUS")
IF JWB=6
 DELE
 PACK
ENDIF
thisform.textkosong()
thisform.textmati()
thisform.grid1.refresh()
thisform.release()

simpan.click
sele mahasiswa
set order to tag nim
seek upper(alltrim(thisform.text1.value))

if found()
mjw=messagebox('Data Sudah diedit, mau disimpan..?',4+64,'Informasi')
    if mjw=6
  repl nim          WITH thisform.text1.value
   repl nama         WITH thisform.text2.value
   repl jurusan      WITH thisform.text3.value
   repl jenjang      WITH thisform.text4.value
   repl semester     WITH thisform.text5.value
   repl thn_akademik WITH thisform.text6.value
   repl jml_sks      WITH thisform.text7.value
   thisform.textmati()
   THISFORM.tampildata()
   thisform.grid1.refresh()
 else
  thisform.textkosong()
  thisform.textmati()
  thisform.refresh()
 endif
else
 APPEND BLANK
  repl nim          WITH thisform.text1.value
  repl nama         WITH thisform.text2.value
  repl jurusan      WITH thisform.text3.value
  repl jenjang      WITH thisform.text4.value
  repl semester     WITH thisform.text5.value
  repl thn_akademik WITH thisform.text6.value
  repl jml_sks      WITH thisform.text7.value
  thisform.textmati()
  THISFORM.tampildata()
  thisform.grid1.refresh()
endif

kode.lostfocus
*sele mahasiswa
*set order to tag nim
seek upper(alltrim(thisform.text1.value))
if found()
mjw=messagebox('Maaf Data Sudah Ada, mau diedit..?',4+64,'Informasi')
    if mjw=6
  thisform.tampildata()
  thisform.text1.setfocus()
 else
  thisform.textkosong()
  thisform.textmati()
  thisform.refresh()
 endif
endif

grid1.afterrowcolchange
LPARAMETERS nColIndex
thisform.tampildata()
thisform.grid1.refresh()

0 comments "Coding Foxpro Sederhana", Baca atau Masukkan Komentar

Post a Comment