PROGRAM PENGGAJIAN
DENGAN LIST VIEW
listing Program:
Public Class Form1
Sub BuatTabel()
LV.Columns.Add("NIK", 80, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 119, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan", 80, HorizontalAlignment.Left)
LV.Columns.Add("Gaji", 80, HorizontalAlignment.Left)
LV.Columns.Add("Status", 80, HorizontalAlignment.Left)
LV.Columns.Add("Tunjangan", 80, HorizontalAlignment.Left)
LV.Columns.Add("Pajak", 80, HorizontalAlignment.Left)
LV.Columns.Add("Total Gaji", 80, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = False
End Sub
Sub IsiTabel()
Dim lst As New ListViewItem
lst.Text = NIK.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(jbtn.Text)
lst.SubItems.Add(gaji.Text)
lst.SubItems.Add(stts.Text)
lst.SubItems.Add(tunjangan.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(total.Text)
LV.Items.Add(lst)
End Sub
Private Sub NIK_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NIK.SelectedIndexChanged
Select Case NIK.Text
Case "001" : nama.Text = "Andi"
Case "002" : nama.Text = "Rista"
Case "003" : nama.Text = "Rudi"
Case "004" : nama.Text = "Rina"
Case "005" : nama.Text = "Rika"
Case "006" : nama.Text = "Stevan"
Case "007" : nama.Text = "Woody"
End Select
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
BuatTabel()
NIK.Items.Add("001")
NIK.Items.Add("002")
NIK.Items.Add("003")
NIK.Items.Add("004")
NIK.Items.Add("005")
NIK.Items.Add("006")
NIK.Items.Add("007")
jbtn.Items.Add("Direktur")
jbtn.Items.Add("Manager")
jbtn.Items.Add("Staf")
jbtn.Items.Add("Sekretaris")
jbtn.Items.Add("OB")
stts.Items.Add("Menikah")
stts.Items.Add("Belum Menikah")
End Sub
Private Sub jbtn_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jbtn.SelectedIndexChanged
Select Case jbtn.Text
Case "Direktur" : gaji.Text = 3500000
Case "Manager" : gaji.Text = 2500000
Case "Staf" : gaji.Text = 1250000
Case "Sekretaris" : gaji.Text = 1800000
Case "OB" : gaji.Text = 800000
End Select
pajak.Text = 0.15 * gaji.Text
End Sub
Private Sub stts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stts.SelectedIndexChanged
Select Case stts.Text
Case "Menikah" : tunjangan.Text = 0.15 * gaji.Text
Case "Tidak Menikah " : tunjangan.Text = 0
End Select
total.Text = Val(gaji.Text) + Val(tunjangan.Text) - Val(pajak.Text)
End Sub
Private Sub simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click
IsiTabel()
NIK.Text = ""
nama.Text = ""
jbtn.Text = ""
gaji.Text = ""
stts.Text = ""
tunjangan.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
LV.Items.Clear()
End Sub
Private Sub hpus_pilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hpus_pilih.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Keluar.Click
End
End Sub
Private Sub reset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles reset.Click
NIK.Text = ""
nama.Text = ""
jbtn.Text = ""
gaji.Text = ""
stts.Text = ""
tunjangan.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
Private Sub total_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles total.TextChanged
End Sub
End Class
http://mesran.blogspot.com/2013/05/tugas-ti-p1101.html
0 Komentar untuk "TUGAS LIST VIEW"