Kode Mata Kuliah = Text Box (Name = Text1)
Nama Mata Kuliah = Combo Box (Name = Combo1)
Jurusan = Combo Box (Name = Combo2)
SKS = Combo Box (Name = Combo3)
Semester = Combo Box (Name = Combo4)
---------------
\<Tambah = Command Button (Name = command 1)
\<Simpan = Command Button (Name = command 2)
\<Edit = Command Button (Name = command 3)
\<Update = Command Button (Name = command 4)
\<Batal = Command Button (Name = command 5)
\<Hapus = Command Button (Name = command 6)
\<Keluar = Command Button (Name = command 7)
---------------
Prosedure :
aktif
kosong
nonaktif
tampil
---------------
Data Basse Name "dbstmik"
Table Name "tbmk"
Tabel sebagai berikut :
kd_matkul - character - width 10 (primary key)
nm_matkul - character - width 40
jurusan - character - width 20
sks - character - width 2
semester - character - width 2
---------------
Koding :
-
Aktif (Form1)
thisform.text1.Enabled= .T.
thisform.combo1.Enabled= .T.
thisform.combo2.Enabled= .T.
thisform.combo3.Enabled= .T.
thisform.combo4.Enabled= .T.
-
Nonaktif (Form1)
thisform.text1.Enabled= .F.
thisform.combo1.Enabled= .F.
thisform.combo2.Enabled= .F.
thisform.combo3.Enabled= .F.
thisform.combo4.Enabled= .F.
-
Kosong (Form1)
thisform.text1.Value=""
thisform.combo1.Value=""
thisform.combo2.Value=""
thisform.combo3.Value=""
thisform.combo4.Value=""
-
Tampil (Form1)
thisform.text1.Value= kd_matkul
thisform.combo1.Value= nama_matkul
thisform.combo2.Value= jurusan
thisform.combo3.Value= sks
thisform.combo4.Value= semester
-
Activate (Form1)
thisform.nonaktif
thisform.command1.Enabled= .T.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .T.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command6.Enabled= .F.
thisform.command7.Enabled= .T.
-
Init (Form1)
SET DELETED ON
SELECT tbmk
SET ORDER TO KD_MATKUL && KD_MATKUL
thisform.nonaktif
thisform.Release
--
Click Tambah (Command1)
thisform.aktif
thisform.kosong
thisform.command1.Enabled= .F.
thisform.command2.Enabled= .T.
thisform.command3.Enabled= .T.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .T.
thisform.command6.Enabled= .T.
thisform.command7.Enabled= .T.
thisform.text1.SetFocus
--
Click Simpan (Command2)
IF MESSAGEBOX(" Apakah Data Akan Disimpan",4+32,"Simpan")=6
SELECT tbmk
SET ORDER TO KD_MATKUL &&KD_MATKUL
IF SEEK(thisform.text1.Value) = .t.
replace kd_matkul WITH thisform.text1.Value;
nama_matkul WITH thisform.combo1.Value;
jurusan WITH thisform.combo2.Value;
sks WITH thisform.combo3.Value;
semester WITH thisform.combo4.Value
Wait WINDOW " proses penyimpanan sedang berjalan.." TIMEOUT 0.5
ELSE
APPEND BLANK
replace kd_matkul WITH thisform.text1.Value;
nama_matkul WITH thisform.combo1.Value;
jurusan WITH thisform.combo2.Value;
sks WITH thisform.combo3.Value;
semester WITH thisform.combo4.Value
Wait WINDOW " proses penyimpanan sedang berjalan.." TIMEOUT 0.5
ENDIF
thisform.grdTbmk.Refresh
thisform.kosong
thisform.command1.Enabled= .T.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command6.Enabled= .F.
thisform.command7.Enabled= .T.
ENDIF
thisform.Refresh
--
Click Edit (Command3)
thisform.text1.Enabled= .F.
thisform.combo1.Enabled= .T.
thisform.combo2.Enabled= .T.
thisform.combo3.Enabled= .T.
thisform.combo4.Enabled= .T.
thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .T.
thisform.command5.Enabled= .T.
thisform.command6.Enabled= .T.
thisform.command7.Enabled= .T.
thisform.Refresh
--
Click Update (Command4)
IF MESSAGEBOX(" Apakah data akan di simpan ulang....?",4+32,"Update")=6
SELECT tbmk
SET ORDER TO KD_MATKUL && KD_MATKUL
IF SEEK(thisform.text1.Value)=.t.
replace kd_matkul WITH thisform.text1.Value;
nama_matkul WITH thisform.combo1.Value;
jurusan WITH thisform.combo2.Value;
sks WITH thisform.combo3.Value;
semester WITH thisform.combo4.Value
Wait WINDOW "proses penyimpanan sedang berjalan.."TIMEOUT 0.5
ENDIF
thisform.grdTbmk.Refresh
thisform.kosong
thisform.command1.Enabled= .T.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command6.Enabled= .F.
thisform.command7.Enabled= .T.
ENDIF
thisform.Refresh
--
Click Batal (Command5)
thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command6.Enabled= .F.
thisform.command7.Enabled= .T.
thisform.kosong
thisform.nonaktif
--
Click Hapus (Command6)
IF MESSAGEBOX(" Apakah data akan di hapus....?",4+32,"Hapus")=6
SELECT tbmk
SET ORDER TO KD_MATKUL && KD_MATKUL
IF SEEK(thisform.text1.Value)=.t.
DELETE FROM TBMK WHERE KD_MATKUL = thisform.text1.Value
ENDIF
thisform.grdTbmk.Refresh
thisform.kosong
thisform.command1.Enabled= .T.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .F.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .F.
thisform.command6.Enabled= .F.
thisform.command7.Enabled= .T.
ENDIF
thisform.Refresh
--
Click Keluar (Command7)
pesan = MESSAGEBOX("Anda yakin mau Keluar...?",4+32,"pesan")=6
thisform.Release
--
LostFocus (Text1)
SELECT tbmk
SET ORDER TO KD_MATKUL &&KD_MATKUL
IF SEEK(ALLTRIM(thisform.text1.Value)) = .t.
thisform.text1.Value=kd_matkul
thisform.combo1.Value=nama_matkul
thisform.combo2.Value=jurusan
thisform.combo3.Value=sks
thisform.combo4.Value=semester
thisform.nonaktif
thisform.command1.Enabled= .F.
thisform.command2.Enabled= .F.
thisform.command3.Enabled= .T.
thisform.command4.Enabled= .F.
thisform.command5.Enabled= .T.
thisform.command6.Enabled= .T.
thisform.command7.Enabled= .T.
ELSE
thisform.combo1.Value=""
thisform.combo2.Value=""
thisform.combo3.Value=""
thisform.combo4.Value=""
ENDIF
thisform.Refresh
Selesai Data Mata Kuliah

1 Comments:
Click here for CommentsSeru nih kalo ngoding bareng km
ConversionConversion EmoticonEmoticon