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")
Jabatan.Items.Add("Mandor")
Jabatan.Items.Add("Kepala Bagian")
Jabatan.Items.Add("Staff")
Status.Items.Add("Menikah")
Status.Items.Add("Tidak Menikah")
For i =
1 To 4
Jumlahanak.Items.Add(i)
Next i
For i =
1 To 10
Jamlembur.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
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
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
Jumlahanak.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
honorlembur.Text = Jamlembur.Text *
7500
ElseIf
Jabatan.Text = "Kepala Bagian" Then
honorlembur.Text = Jamlembur.Text *
310000
ElseIf
Jabatan.Text = "Staff" Then
honorlembur.Text = Jamlembur.Text *
5000
Else
honorlembur.Text = 0
End If
totalgaji.Text = Val(Jamlembur.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 = "Yuni"
Case
"002" : nama.Text = "Frengki"
Case
"003" : nama.Text = "Ani"
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 = ""
Jamlembur.Text = ""
honorlembur.Text = ""
pajak.Text = ""
totalgaji.Text = ""
End Sub
Private Sub Keluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Keluar.Click
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
Gaji", 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(honorlembur.Text)
Lst.SubItems.Add(honorlembur.Text)
Lst.SubItems.Add(pajak.Text)
Lst.SubItems.Add(totalgaji.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 = ""
Jamlembur.Text = ""
honorlembur.Text = ""
pajak.Text = ""
totalgaji.Text = ""
End Sub
End Class
Tidak ada komentar:
Posting Komentar