Public Class Form1
Sub buattabel()
lv.Columns.Add("npm", 80, HorizontalAlignment.Center)
lv.Columns.Add("nama", 180, HorizontalAlignment.Left)
lv.Columns.Add("jenjang", 80, HorizontalAlignment.Center)
lv.Columns.Add("jurusan", 180, HorizontalAlignment.Left)
lv.Columns.Add("kodedosen", 80, HorizontalAlignment.Center)
lv.Columns.Add("namadosen", 180, HorizontalAlignment.Left)
lv.Columns.Add("kodematakuliah", 80, HorizontalAlignment.Center)
lv.Columns.Add("nilaikehadiran", 180, HorizontalAlignment.Left)
lv.Columns.Add("nilaitugas", 80, HorizontalAlignment.Center)
lv.Columns.Add("nilaiuts", 180, HorizontalAlignment.Left)
lv.Columns.Add("nilaiuas", 80, HorizontalAlignment.Center)
lv.Columns.Add("nilaiakhir", 180, HorizontalAlignment.Left)
lv.Columns.Add("nilaihuruf", 80, HorizontalAlignment.Center)
lv.Columns.Add("keterangan", 180, HorizontalAlignment.Left)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub isitabel()
Dim lst As New ListViewItem
lst.Text = npm.Text
lst.Text = jenjang.Text
lst.Text = jurusan.Text
lst.Text = kodedosen.Text
lst.Text = namadosen.Text
lst.Text = kodematakuliah.Text
lst.Text = nilaikehadiran.Text
lst.Text = nilaitugas.Text
lst.Text = nilaiuts.Text
lst.Text = nilaiuas.Text
lst.Text = nilaiakhir.Text
lst.Text = nilaihuruf.Text
lst.Text = keterangan.Text
lst.SubItems.Add(nama.Text)
lv.Items.Add(lst)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
npm.Items.Add("12110486")
npm.Items.Add("12110905")
npm.Items.Add("12110987")
npm.Items.Add("12110977")
kodedosen.Items.Add("0987")
kodedosen.Items.Add("0098")
kodedosen.Items.Add("0023")
kodedosen.Items.Add("0781")
kodematakuliah.Items.Add("0043")
kodematakuliah.Items.Add("7896")
kodematakuliah.Items.Add("9078")
kodematakuliah.Items.Add("8964")
Dim i As Integer
For i = 1 To 100
nilaikehadiran.Items.Add(i)
nilaitugas.Items.Add(i)
nilaiuts.Items.Add(i)
nilaiuas.Items.Add(i)
Next
End Sub
Private Sub npm_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles npm.SelectedIndexChanged
Select npm.Text
Case "12110486"
nama.Text = "Azmy Lauranita"
jenjang.Text = "SI"
jurusan.Text = "Teknik Informatika"
Case "12110905"
nama.Text = "Niken"
jenjang.Text = "SI"
jurusan.Text = "Sistem Informasi"
Case "12110987"
nama.Text = "laura"
jenjang.Text = "D3"
jurusan.Text = "Manajemen Umum"
Case "12110977"
nama.Text = "Arjuna"
jenjang.Text = "DI"
jurusan.Text = "Komputerisasi Akutansi"
End Select
End Sub
Private Sub kodedosen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kodedosen.SelectedIndexChanged
Select Case kodedosen.Text
Case "0987"
namadosen.Text = "Mesran, M.Kom"
Case "0098"
namadosen.Text = "Alex Riki Sinaga, M.Kom"
Case "0023"
namadosen.Text = "Megaria Purba, M.Kom"
Case "0781"
namadosen.Text = "Guidio L Ginting, S.Kom"
End Select
End Sub
Private Sub kodematakuliah_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Select Case kodematakuliah.Text
Case "221AKTI"
kodematakuliah.Text = "Pemograman Visual 1 "
Case "876KSI"
kodematakuliah.Text = "Struktur Data"
Case "1178KMI"
kodematakuliah.Text = "Kalkulus"
Case "1341BRU"
kodematakuliah.Text = "Komunikasi Data"
End Select
End Sub
Private Sub btnsimpankelistview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpankelistview.Click
isitabel()
npm.Text = ""
nama.Text = ""
jenjang.Text = ""
jurusan.Text = ""
kodedosen.Text = ""
namadosen.Text = ""
kodematakuliah.Text = ""
kodematakuliah.Text = ""
nilaikehadiran.Text = ""
nilaitugas.Text = ""
nilaiuts.Text = ""
nilaiuas.Text = ""
nilaihuruf.Text = ""
nilaiakhir.Text = ""
keterangan.Text = ""
End Sub
Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
nilaiakhir.Text = 0.1 * nilaikehadiran.Text + 0.15 * nilaitugas.Text + 0.3 * nilaiuts.Text + 0.45 * nilaiuas.Text
Select Case nilaiakhir.Text
Case Is >= 100
nilaihuruf.Text = "A"
keterangan.Text = "LULUS"
Case 70 To 79
nilaihuruf.Text = "B"
keterangan.Text = "LULUS"
Case 60 To 69
nilaihuruf.Text = "C"
keterangan.Text = "LULUS"
Case 50 To 59
nilaihuruf.Text = "D"
keterangan.Text = "GAGAL"
Case Is <= 49
nilaihuruf.Text = "E"
keterangan.Text = "GAGAL"
End Select
End Sub
End Class
Ini adalah hasil listView :
Tidak ada komentar:
Posting Komentar