Berikut Listing Program nya:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nik.Items.Add("001")
nik.Items.Add("002")
nik.Items.Add("003")
nik.Items.Add("001")
nik.Items.Add("002")
nik.Items.Add("003")
jabatan.Items.Add("Mandor")
jabatan.Items.Add("Kepala Bagian")
jabatan.Items.Add("Staff")
jabatan.Items.Add("Kepala Bagian")
jabatan.Items.Add("Staff")
status.Items.Add("Menikah")
status.Items.Add("Tidak Menikah")
status.Items.Add("Tidak Menikah")
For i = 1 To 4
jumlahanak.Items.Add(i)
Next i
For i = 1 To 10
jam.Items.Add(i)
Next i
BuatTabel()
End Sub
jumlahanak.Items.Add(i)
Next i
For i = 1 To 10
jam.Items.Add(i)
Next i
BuatTabel()
End Sub
Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
Select Case jabatan.Text
Case "Mandor" : gaji.Text = 1750000
Case "Kepala Bagian" : gaji.Text = 2500000
Case "Staff" : gaji.Text = 1250000
End Select
pajak.Text = 0.015 * gaji.Text
End Sub
Select Case jabatan.Text
Case "Mandor" : gaji.Text = 1750000
Case "Kepala Bagian" : gaji.Text = 2500000
Case "Staff" : gaji.Text = 1250000
End Select
pajak.Text = 0.015 * gaji.Text
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
Select Case status.Text
Case "Menikah" : tunjistri.Text = 0.09 * gaji.Text
Case "Tidak Menikah" : tunjistri.Text = 0
End Select
End Sub
Select Case status.Text
Case "Menikah" : tunjistri.Text = 0.09 * gaji.Text
Case "Tidak Menikah" : tunjistri.Text = 0
End Select
End Sub
Private Sub jumlahanak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jumlahanak.SelectedIndexChanged
If jumlahanak.Text >= 2 And status.Text = "Menikah" Then
tunjanak.Text = 0.07 * gaji.Text
ElseIf jumlahanak.Text = 1 And status.Text = "Tidak Menikah" Then
tunjanak.Text = 0.03 * gaji.Text
Else
tunjanak.Text = 0
End If
End Sub
If jumlahanak.Text >= 2 And status.Text = "Menikah" Then
tunjanak.Text = 0.07 * gaji.Text
ElseIf jumlahanak.Text = 1 And status.Text = "Tidak Menikah" Then
tunjanak.Text = 0.03 * gaji.Text
Else
tunjanak.Text = 0
End If
End Sub
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
If jabatan.Text = "Mandor" Then
honor.Text = jam.Text * 7500
ElseIf jabatan.Text = "Kepala Bagian" Then
honor.Text = jam.Text * 310000
ElseIf jabatan.Text = "Staff" Then
honor.Text = jam.Text * 5000
Else
honor.Text = 0
End If
total.Text = Val(honor.Text) + Val(gaji.Text) + Val(tunjistri.Text) + Val(tunjanak.Text) + Val(pajak.Text)
End Sub
If jabatan.Text = "Mandor" Then
honor.Text = jam.Text * 7500
ElseIf jabatan.Text = "Kepala Bagian" Then
honor.Text = jam.Text * 310000
ElseIf jabatan.Text = "Staff" Then
honor.Text = jam.Text * 5000
Else
honor.Text = 0
End If
total.Text = Val(honor.Text) + Val(gaji.Text) + Val(tunjistri.Text) + Val(tunjanak.Text) + Val(pajak.Text)
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 = "Batara Silaban"
Case "002" : nama.Text = "Yeni Manurung"
Case "003" : nama.Text = "Nurul Hidayati"
End Select
End Sub
Select Case nik.Text
Case "001" : nama.Text = "Batara Silaban"
Case "002" : nama.Text = "Yeni Manurung"
Case "003" : nama.Text = "Nurul Hidayati"
End Select
End Sub
Private Sub btnbaru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbaru.Click
nama.Text = ""
nik.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunjistri.Text = ""
jumlahanak.Text = ""
tunjanak.Text = ""
jam.Text = ""
honor.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
nama.Text = ""
nik.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunjistri.Text = ""
jumlahanak.Text = ""
tunjanak.Text = ""
jam.Text = ""
honor.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
End
End Sub
Private Sub LV_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LV.SelectedIndexChanged
End Sub
Sub BuatTabel()
LV.Columns.Add("NIK", 80, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 180, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan", 80, HorizontalAlignment.Center)
LV.Columns.Add("Gaji", 80, HorizontalAlignment.Center)
LV.Columns.Add("Status", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan Istri", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jumlah Anak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan Anak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jam Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Honor Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Pajak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Total", 80, HorizontalAlignment.Center)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Sub BuatTabel()
LV.Columns.Add("NIK", 80, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 180, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan", 80, HorizontalAlignment.Center)
LV.Columns.Add("Gaji", 80, HorizontalAlignment.Center)
LV.Columns.Add("Status", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan Istri", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jumlah Anak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangan Anak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jam Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Honor Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Pajak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Total", 80, 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(jabatan.Text)
Lst.SubItems.Add(gaji.Text)
Lst.SubItems.Add(status.Text)
Lst.SubItems.Add(tunjistri.Text)
Lst.SubItems.Add(jumlahanak.Text)
Lst.SubItems.Add(tunjanak.Text)
Lst.SubItems.Add(jam.Text)
Lst.SubItems.Add(honor.Text)
Lst.SubItems.Add(pajak.Text)
Lst.SubItems.Add(total.Text)
LV.Items.Add(Lst)
End Sub
Dim Lst As New ListViewItem
Lst.Text = nik.Text
Lst.SubItems.Add(nama.Text)
Lst.SubItems.Add(jabatan.Text)
Lst.SubItems.Add(gaji.Text)
Lst.SubItems.Add(status.Text)
Lst.SubItems.Add(tunjistri.Text)
Lst.SubItems.Add(jumlahanak.Text)
Lst.SubItems.Add(tunjanak.Text)
Lst.SubItems.Add(jam.Text)
Lst.SubItems.Add(honor.Text)
Lst.SubItems.Add(pajak.Text)
Lst.SubItems.Add(total.Text)
LV.Items.Add(Lst)
End Sub
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
IsiTabel()
nik.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunjistri.Text = ""
jumlahanak.Text = ""
tunjanak.Text = ""
jam.Text = ""
honor.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
End Class
IsiTabel()
nik.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunjistri.Text = ""
jumlahanak.Text = ""
tunjanak.Text = ""
jam.Text = ""
honor.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
End Class
No comments:
Post a Comment