PROGRAM LISTVIEV PENGGAJIAN KARYAWAN
Desain awal program
Adapun dibawah ini merupkan listing program penggajian karyawan.
Public Class Form1
Sub BuatTabel()
lv.Columns.Add("NIK", 100, HorizontalAlignment.Center)
lv.Columns.Add("Nama", 100, HorizontalAlignment.Center)
lv.Columns.Add("Jabatan", 100, HorizontalAlignment.Center)
lv.Columns.Add("Gaji", 100, HorizontalAlignment.Center)
lv.Columns.Add("Status", 100, HorizontalAlignment.Center)
lv.Columns.Add("Tunj. Keluarga", 100, HorizontalAlignment.Center)
lv.Columns.Add("Pajak", 100, HorizontalAlignment.Center)
lv.Columns.Add("Total Gaji", 100, HorizontalAlignment.Center)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub IsiTabel()
Dim lst As New ListViewItem
lst.Text = Nik.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(jab.Text)
lst.SubItems.Add(gaji.Text)
lst.SubItems.Add(stat.Text)
lst.SubItems.Add(tunj.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(tot.Text)
lv.Items.Add(lst)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
nik.Items.Add("001")
nik.Items.Add("002")
nik.Items.Add("003")
jab.Items.Add("Mandor")
jab.Items.Add("Kepala Bagian")
jab.Items.Add("Staf")
stat.Items.Add("Menikah")
stat.Items.Add("Tidak Menikah")
BuatTabel()
End Sub
Private Sub jab_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesjab.SelectedIndexChanged
Select Case jab.Text
Case "Mandor" : gaji.Text = 175000
Case "Kepala Bagian" : gaji.Text = 250000
Case "Staf" : gaji.Text = 125000
End Select
pajak.Text = 0.15 * gaji.Text
End Sub
Private Sub nik_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesnik.SelectedIndexChanged
Select Case nik.Text
Case "001" : nama.Text = "Oncom"
Case "002" : nama.Text = "Udin"
Case "003" : nama.Text = "Ujong"
End Select
End Sub
Private Sub stat_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesstat.SelectedIndexChanged
Select Case stat.Text
Case "Menikah" : tunj.Text = 0.15 * gaji.Text
Case "Tidak Menikah" : tunj.Text = 0
End Select
End Sub
Private Sub proses_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles proses.Click
tot.Text = Val(gaji.Text) + Val(tunj.Text) - Val(pajak.Text)
IsiTabel()
nik.Text = ""
nama.Text = ""
jab.Text = ""
stat.Text = ""
pajak.Text = ""
tunj.Text = ""
gaji.Text = ""
tot.Text = ""
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles keluar.Click
End
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles btnhapus.Click
lv.Items.Clear()
End Sub
Private Sub btnhapus2_Click(ByVal sender As System.Object, ByVale As System.EventArgs)
lv.Items.Remove(lv.SelectedItems(0))
End Sub
Private Sub baru_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles baru.Click
nik.Text = ""
nama.Text = ""
jab.Text = ""
stat.Text = ""
pajak.Text = ""
tunj.Text = ""
gaji.Text = ""
tot.Text = ""
End Sub
End Class
Desain akhir program
Tidak ada komentar:
Posting Komentar