3)Listing Program
Public Class
Data_gaji
Sub Bersih(ByVal F As Form)
Dim x As Object
For Each x In F.Controls
If TypeOf x Is TextBox Then
x.text = ""
If TypeOf x Is ComboBox Then
x.text = ""
Next
End Sub
Sub IsiTabel()
Dim lst As New ListViewItem
lst.Text =
nip.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(jabatan.Text)
lst.SubItems.Add(Gaji.Text)
lst.SubItems.Add(Status.Text)
lst.SubItems.Add(Tjistri.Text)
lst.SubItems.Add(jumanak.Text)
lst.SubItems.Add(TjAnak.Text)
lst.SubItems.Add(JamLem.Text)
lst.SubItems.Add(Gajilem.Text)
lst.SubItems.Add(Pajak.Text)
lst.SubItems.Add(totgaji.Text)
LV.Items.Add(lst)
End Sub
Private Sub
btnhapus_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnhapus.Click
Call Bersih(Me)
End Sub
Private Sub
btnsimpan_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnsimpan.Click
Call IsiTabel()
End Sub
Private Sub
btnhapus2_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnhapus2.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub btnHapus1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnHapus1.Click
LV.Items.Clear()
End Sub
Private Sub
btnKeluar_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnKeluar.Click
End
End Sub
Private Sub
Data_gaji_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
MyBase.Load
nip.Items.Add("03101")
nip.Items.Add("03202")
nip.Items.Add("01201")
nip.Items.Add("01101")
nip.Items.Add("02110")
jabatan.Items.Add("Mandor")
jabatan.Items.Add("Kepala Bagian")
jabatan.Items.Add("Staf")
status.Items.Add("Manikah")
status.Items.Add("Belum Menikah")
End Sub
Private Sub
nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
nip.SelectedIndexChanged
If nip.Text = "03101"
Then
nama.Text =
"Andy"
ElseIf nip.Text = "03202"
Then
nama.Text =
"Yana"
ElseIf nip.Text = "01201"
Then
nama.Text =
"Siska"
ElseIf nip.Text = "01101"
Then
nama.Text =
"Puspita"
ElseIf nip.Text = "02110"
Then
nama.Text =
"Emilia"
Else
nama.Text =
""
End If
End Sub
Private Sub
jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
jabatan.SelectedIndexChanged
If jabatan.Text = "Mandor"
Then
gaji.Text =
1750000
ElseIf jabatan.Text = "Kepala
Bagian" Then
gaji.Text =
2500000
ElseIf jabatan.Text = "Staf"
Then
gaji.Text =
1250000
Else
gaji.Text =
0
End If
End Sub
Private Sub
btnProses_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnProses.Click
Tjistri.Text =
0.09 * gaji.Text
If jumanak.Text = 1 Then
tjanak.Text
= 0.03 * gaji.Text
pajak.Text
= 0.015 * gaji.Text
ElseIf jumanak.Text = 2 Then
tjanak.Text
= 0.07 * gaji.Text
pajak.Text
= 0.015 * gaji.Text
ElseIf jumanak.Text >= 2 Then
tjanak.Text
= 0.07 * gaji.Text
pajak.Text = 0.015 * gaji.Text
ElseIf jumanak.Text = 0 Then
tjanak.Text
= 0
pajak.Text
= 0.015 * gaji.Text
End If
If jabatan.Text = "Mandor"
Then
gajilem.Text = 7500 * jamlem.Text
ElseIf jabatan.Text = "Kepala
Bagian" Then
gajilem.Text = 1000 * jamlem.Text
ElseIf jabatan.Text = "Staf"
Then
gajilem.Text = 5000 * jamlem.Text
Else
gajilem.Text = 0
End If
totgaji.Text =
Val(gaji.Text) + Val(Tjistri.Text) + Val(tjanak.Text) + Val(gajilem.Text) -
Val(pajak.Text)
End Sub
Private Sub
status_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
status.SelectedIndexChanged
If status.Text = "Menikah"
Then
Tjistri.Text = 0.09
Else
Tjistri.Text = 0
End If
End Class