Form Design :
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
pajak.Text = 0.015 * gaji.Text
Case "Kepala Bgian" : gaji.Text = 2500000
pajak.Text = 0.015 * gaji.Text
Case "Staf" : gaji.Text = 1250000
pajak.Text = 0.015 * gaji.Text
End Select
End Sub
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("Staf")
status.Items.Add("Menikah")
status.Items.Add("Belum Menikah")
For i = 1 To 4
jumlahanak.Items.Add(i)
Next i
For i = 1 To 10
jamlembur.Items.Add(i)
Next i
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") : tunjanganistri.Text = 0.09 * gaji.Text
Case ("Belum Menikah") : tunjanganistri.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
tunjangananak.Text = 0.07 * gaji.Text
ElseIf jumlahanak.Text = 1 And status.Text = "Menikah" Then
tunjangananak.Text = 0.03 * gaji.Text
Else
tunjangananak.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 = 7500
ElseIf jabatan.Text = "Kepala Bagian" Then
honorlembur.Text = 10000
ElseIf jabatan.Text = "Staf" Then
honorlembur.Text = 5000
Else
honorlembur.Text = 0
End If
total.Text = Val(honorlembur.Text * jamlembur.Text) + Val(gaji.Text) + Val(tunjanganistri.Text) + Val(tunjangananak.Text) - Val(pajak.Text)
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
End Class
Private Sub btnbaru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbaru.Click
nik.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunjanganistri.Text = ""
jumlahanak.Text = ""
tunjangananak.Text = ""
jamlembur.Text = ""
honorlembur.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
Tidak ada komentar:
Posting Komentar